From patchwork Thu Nov 20 03:22:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliot Blennerhassett X-Patchwork-Id: 5345661 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B49A0C11AC for ; Thu, 20 Nov 2014 03:30:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D64392021F for ; Thu, 20 Nov 2014 03:30:05 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A2C7C20108 for ; Thu, 20 Nov 2014 03:30:03 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C4E4D265D3D; Thu, 20 Nov 2014 04:30:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7E9E126593D; Thu, 20 Nov 2014 04:26:01 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D256E26590E; Thu, 20 Nov 2014 04:25:59 +0100 (CET) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by alsa0.perex.cz (Postfix) with ESMTP id 2741926587C for ; Thu, 20 Nov 2014 04:25:44 +0100 (CET) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0NFB007V7IU4ZE20@smtp3.clear.net.nz> for alsa-devel@alsa-project.org; Thu, 20 Nov 2014 16:25:41 +1300 (NZDT) Received: from 121-72-250-62.cable.telstraclear.net (HELO eliot.lan) ([121.72.250.62]) by smtpin1.clear.net.nz with ESMTP; Thu, 20 Nov 2014 16:25:32 +1300 Date: Thu, 20 Nov 2014 16:22:54 +1300 From: eliot@blennerhassett.gen.nz In-reply-to: <1416453777-7155-1-git-send-email-eliot@blennerhassett.gen.nz> To: alsa-devel@alsa-project.org Message-id: <1416453777-7155-8-git-send-email-eliot@blennerhassett.gen.nz> X-Mailer: git-send-email 1.9.1 References: <1416453777-7155-1-git-send-email-eliot@blennerhassett.gen.nz> Cc: tiwai@suse.de, Eliot Blennerhassett Subject: [alsa-devel] [PATCH 07/10] ALSA: asihpi: Turn off msg/resp logging after DSP has crashed. X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eliot Blennerhassett Prevents spewing of useless messages if app keeps trying to access the card. Signed-off-by: Eliot Blennerhassett --- sound/pci/asihpi/hpimsgx.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sound/pci/asihpi/hpimsgx.c b/sound/pci/asihpi/hpimsgx.c index d4790dd..736f453 100644 --- a/sound/pci/asihpi/hpimsgx.c +++ b/sound/pci/asihpi/hpimsgx.c @@ -1,7 +1,7 @@ /****************************************************************************** AudioScience HPI driver - Copyright (C) 1997-2011 AudioScience Inc. + Copyright (C) 1997-2014 AudioScience Inc. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as @@ -35,6 +35,7 @@ static struct pci_device_id asihpi_pci_tbl[] = { static struct hpios_spinlock msgx_lock; static hpi_handler_func *hpi_entry_points[HPI_MAX_ADAPTERS]; +static int logging_enabled = 1; static hpi_handler_func *hpi_lookup_entry_point_function(const struct hpi_pci *pci_info) @@ -312,7 +313,9 @@ static void instream_message(struct hpi_message *phm, void hpi_send_recv_ex(struct hpi_message *phm, struct hpi_response *phr, void *h_owner) { - HPI_DEBUG_MESSAGE(DEBUG, phm); + + if (logging_enabled) + HPI_DEBUG_MESSAGE(DEBUG, phm); if (phm->type != HPI_TYPE_REQUEST) { hpi_init_response(phr, phm->object, phm->function, @@ -352,8 +355,14 @@ void hpi_send_recv_ex(struct hpi_message *phm, struct hpi_response *phr, hw_entry_point(phm, phr); break; } - HPI_DEBUG_RESPONSE(phr); + if (logging_enabled) + HPI_DEBUG_RESPONSE(phr); + + if (phr->error >= HPI_ERROR_DSP_COMMUNICATION) { + hpi_debug_level_set(HPI_DEBUG_LEVEL_ERROR); + logging_enabled = 0; + } } static void adapter_open(struct hpi_message *phm, struct hpi_response *phr)