From patchwork Thu Mar 6 14:56:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liam Girdwood X-Patchwork-Id: 3784501 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 69B899F370 for ; Thu, 6 Mar 2014 14:56:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C1A1201FD for ; Thu, 6 Mar 2014 14:56:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 11C6D2017D for ; Thu, 6 Mar 2014 14:56:57 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5139F2654B0; Thu, 6 Mar 2014 15:56:55 +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.5 required=5.0 tests=BAYES_00,BIGNUM_EMAILS, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 83F9C265388; Thu, 6 Mar 2014 15:56:48 +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 BE9D8265453; Thu, 6 Mar 2014 15:56:44 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by alsa0.perex.cz (Postfix) with ESMTP id AB4E4265388 for ; Thu, 6 Mar 2014 15:56:37 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by azsmga102.ch.intel.com with ESMTP; 06 Mar 2014 06:56:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,600,1389772800"; d="scan'208";a="487247445" Received: from justinda-mobl1.ger.corp.intel.com (HELO loki.ger.corp.intel.com) ([10.252.120.99]) by fmsmga001.fm.intel.com with ESMTP; 06 Mar 2014 06:56:28 -0800 From: Liam Girdwood To: Mark Brown Date: Thu, 6 Mar 2014 14:56:04 +0000 Message-Id: <1394117766-7242-1-git-send-email-liam.r.girdwood@linux.intel.com> X-Mailer: git-send-email 1.8.3.2 Cc: Takashi Iwai , Liam Girdwood , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] ASoC: Intel: Check Haswell IPC process_reply/notification return value. 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 Check the return value for error when processing replies and notifications. The patch 22981243589c: "ASoC: Intel: Add Haswell/Broadwell IPC" from > Feb 20, 2014, leads to the following imaginary static checker warning: > > sound/soc/intel/sst-haswell-ipc.c:898 hsw_irq_thread() > warn: this is always true. > > sound/soc/intel/sst-haswell-ipc.c > 895 /* Handle Immediate reply from DSP Core */ > 896 handled = hsw_process_reply(hsw, ipcx); > ^^^^^^^^^^^^^^^^^ > Returns 1 on success/error and -EIO on error. > > 897 > 898 if (handled) { > 899 /* clear DONE bit - tell DSP we have completed */ > 900 sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX, > 901 SST_IPCX_DONE, 0); > 902 > 903 /* unmask Done interrupt */ > 904 sst_dsp_shim_update_bits_unlocked(sst, SST_IMRX, > 905 SST_IMRX_DONE, 0); > 906 } > Reported-by: Dan Carpenter Signed-off-by: Liam Girdwood --- sound/soc/intel/sst-haswell-ipc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c index 1f1576a..f46bb4d 100644 --- a/sound/soc/intel/sst-haswell-ipc.c +++ b/sound/soc/intel/sst-haswell-ipc.c @@ -895,7 +895,7 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) /* Handle Immediate reply from DSP Core */ handled = hsw_process_reply(hsw, ipcx); - if (handled) { + if (handled > 0) { /* clear DONE bit - tell DSP we have completed */ sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX, SST_IPCX_DONE, 0); @@ -913,7 +913,7 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) handled = hsw_process_notification(hsw); /* clear BUSY bit and set DONE bit - accept new messages */ - if (handled) { + if (handled > 0) { sst_dsp_shim_update_bits_unlocked(sst, SST_IPCD, SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE);