From patchwork Wed Jun 12 16:57:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 10990373 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08C6313AD for ; Wed, 12 Jun 2019 16:59:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E78A3285D9 for ; Wed, 12 Jun 2019 16:59:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8E1828708; Wed, 12 Jun 2019 16:59:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1F670285D9 for ; Wed, 12 Jun 2019 16:59:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3C55A1797; Wed, 12 Jun 2019 18:58:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3C55A1797 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560358742; bh=QyTpq0P2VY5ds9I+gXvE+0NFNNbBw4pXLXKmz19T+9Y=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rgNPeI+2abuBIAZ63GDuiCnBOyZIogCQr3LD9q/tEw+5OXL89PZVmONvOHrReL7h5 fzq6UiQX25Mmh5ItPtVrRFAFDDRa/vyTzODKvOW9UUdKgCJ2eJT/o3XVo8hAPcFvA0 XBHXWHaubrISy5IrOjEwu8j0ApNUuw0hD07Dd+Ng= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 18B5AF896CE; Wed, 12 Jun 2019 18:57:19 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9B654F896EA; Wed, 12 Jun 2019 18:57:15 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 87868F806F5 for ; Wed, 12 Jun 2019 18:57:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 87868F806F5 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 09:57:09 -0700 X-ExtLoop1: 1 Received: from adorrell-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.251.133.122]) by orsmga002.jf.intel.com with ESMTP; 12 Jun 2019 09:57:09 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Wed, 12 Jun 2019 11:57:01 -0500 Message-Id: <20190612165705.1858-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> References: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, Dragos Tarcatu , broonie@kernel.org, Pierre-Louis Bossart Subject: [alsa-devel] [PATCH 1/5] ASOC: SOF: ipc: prevent logging trace messages X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Dragos Tarcatu If the firmware is set for verbose tracing, the kernel log is flooded with ipc rx/ipc rx done messages. Prevent logging those unless the verbose IPC debugging config option is set. Signed-off-by: Dragos Tarcatu Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/ipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index 558b596e2133..f3eb46bc808b 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -196,7 +196,8 @@ static void ipc_log_header(struct device *dev, u8 *text, u32 cmd) #else static inline void ipc_log_header(struct device *dev, u8 *text, u32 cmd) { - dev_dbg(dev, "%s: 0x%x\n", text, cmd); + if ((cmd & SOF_GLB_TYPE_MASK) != SOF_IPC_GLB_TRACE_MSG) + dev_dbg(dev, "%s: 0x%x\n", text, cmd); } #endif From patchwork Wed Jun 12 16:57:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 10990375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 931241398 for ; Wed, 12 Jun 2019 16:59:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80BC5285D9 for ; Wed, 12 Jun 2019 16:59:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7274828708; Wed, 12 Jun 2019 16:59:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 033D2285D9 for ; Wed, 12 Jun 2019 16:59:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 50536179B; Wed, 12 Jun 2019 18:58:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 50536179B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560358788; bh=8JF7NuOTBJCdAio7YQwTMvF0LZpOeYQ+OF/jZpjKXuA=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vYQAY52vUtRK5E27lnBaZmDXjkwqnuOvc6lFAPODbRzuExD31Vwi3OKDCau7BDca1 E/OQkZ+8HluxFRMfK+4ZUti9rNq+yknGO3cpW+LXClFuy7QxOR5TawaBhFz1p/Vx4b qDgyL0UZWO66fwcOsOA9mQXR19NcEcvSLx0SdSvE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 86620F896E0; Wed, 12 Jun 2019 18:57:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16D37F89716; Wed, 12 Jun 2019 18:57:17 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CF3A7F896CE for ; Wed, 12 Jun 2019 18:57:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CF3A7F896CE X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 09:57:10 -0700 X-ExtLoop1: 1 Received: from adorrell-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.251.133.122]) by orsmga002.jf.intel.com with ESMTP; 12 Jun 2019 09:57:09 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Wed, 12 Jun 2019 11:57:02 -0500 Message-Id: <20190612165705.1858-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> References: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart Subject: [alsa-devel] [PATCH 2/5] ASoC: SOF: uapi: align comments with firmware files X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP No functional change, just mirror firmware comment changes Signed-off-by: Pierre-Louis Bossart --- include/sound/sof/topology.h | 4 ++-- include/sound/sof/trace.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/sound/sof/topology.h b/include/sound/sof/topology.h index 4978999fd362..41dcabf89899 100644 --- a/include/sound/sof/topology.h +++ b/include/sound/sof/topology.h @@ -84,9 +84,9 @@ struct sof_ipc_buffer { struct sof_ipc_comp_config { struct sof_ipc_cmd_hdr hdr; uint32_t periods_sink; /**< 0 means variable */ - uint32_t periods_source; /**< 0 means variable */ + uint32_t periods_source;/**< 0 means variable */ uint32_t reserved1; /**< reserved */ - uint32_t frame_fmt; /**< SOF_IPC_FRAME_ */ + uint32_t frame_fmt; /**< SOF_IPC_FRAME_ */ uint32_t xrun_action; /* reserved for future use */ diff --git a/include/sound/sof/trace.h b/include/sound/sof/trace.h index 2187ff7d07ce..9257d5473d97 100644 --- a/include/sound/sof/trace.h +++ b/include/sound/sof/trace.h @@ -66,7 +66,9 @@ struct sof_ipc_dma_trace_posn { #define SOF_IPC_PANIC_WFI (SOF_IPC_PANIC_MAGIC | 0xa) #define SOF_IPC_PANIC_ASSERT (SOF_IPC_PANIC_MAGIC | 0xb) -/* panic info include filename and line number */ +/* panic info include filename and line number + * filename array will not include null terminator if fully filled + */ struct sof_ipc_panic_info { struct sof_ipc_hdr hdr; uint32_t code; /* SOF_IPC_PANIC_ */ From patchwork Wed Jun 12 16:57:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 10990383 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 018FF1395 for ; Wed, 12 Jun 2019 17:01:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0A31289FA for ; Wed, 12 Jun 2019 17:01:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4C5D28A17; Wed, 12 Jun 2019 17:01:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 215DC289FA for ; Wed, 12 Jun 2019 17:01:40 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 68F9117B3; Wed, 12 Jun 2019 19:00:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 68F9117B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560358898; bh=ztzqBTaYEvZnm+T6XjMlEb/Bsgdbh6YhU064yErUuUw=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=N7eI7PJsYPOM8BXX/sebpEEiich4RBzHs1SdE0r7hBFbJdU7V6a9/IFCFjy0j8DK1 xYUDE1myyh5d0HlTwB92IR9Y7aosRRwj5XSi8FnoittF0CWO9cXKvTC6owm6nIamSZ 3MIfYNC5AycJkdA2AJkeb1MZfF3koFlLdgfIte7Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DD915F8973F; Wed, 12 Jun 2019 18:57:29 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 60E2DF89735; Wed, 12 Jun 2019 18:57:21 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5B5E9F8970C for ; Wed, 12 Jun 2019 18:57:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5B5E9F8970C X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 09:57:11 -0700 X-ExtLoop1: 1 Received: from adorrell-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.251.133.122]) by orsmga002.jf.intel.com with ESMTP; 12 Jun 2019 09:57:10 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Wed, 12 Jun 2019 11:57:03 -0500 Message-Id: <20190612165705.1858-4-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> References: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Kai Vehmanen Subject: [alsa-devel] [PATCH 3/5] ASoC: SOF: intel: extend IPC dump information X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Kai Vehmanen Extend the HDA IPC dump implementation with status of key IRQ registers. This is useful to debug IPC timeouts and similar issues. Signed-off-by: Kai Vehmanen Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/cnl.c | 2 ++ sound/soc/sof/intel/hda.c | 29 +++++++++++++++++++++++++++++ sound/soc/sof/intel/hda.h | 2 ++ 3 files changed, 33 insertions(+) diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c index 9a4927b6b6ae..d59305787fc3 100644 --- a/sound/soc/sof/intel/cnl.c +++ b/sound/soc/sof/intel/cnl.c @@ -168,6 +168,8 @@ static void cnl_ipc_dump(struct snd_sof_dev *sdev) u32 hipcida; u32 hipctdr; + hda_ipc_irq_dump(sdev); + /* read IPC status */ hipcida = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDA); hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCCTL); diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index a09dafa35fdb..140b1424f291 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -15,6 +15,9 @@ * Hardware interface for generic Intel audio DSP HDA IP */ +#include +#include + #include #include #include @@ -186,12 +189,38 @@ void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags) } } +void hda_ipc_irq_dump(struct snd_sof_dev *sdev) +{ + struct hdac_bus *bus = sof_to_bus(sdev); + u32 adspis; + u32 intsts; + u32 intctl; + u32 ppsts; + u8 rirbsts; + + /* read key IRQ stats and config registers */ + adspis = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS); + intsts = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS); + intctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL); + ppsts = snd_sof_dsp_read(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPSTS); + rirbsts = snd_hdac_chip_readb(bus, RIRBSTS); + + dev_err(sdev->dev, + "error: hda irq intsts 0x%8.8x intlctl 0x%8.8x rirb %2.2x\n", + intsts, intctl, rirbsts); + dev_err(sdev->dev, + "error: dsp irq ppsts 0x%8.8x adspis 0x%8.8x\n", + ppsts, adspis); +} + void hda_ipc_dump(struct snd_sof_dev *sdev) { u32 hipcie; u32 hipct; u32 hipcctl; + hda_ipc_irq_dump(sdev); + /* read IPC status */ hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 455046612b94..6c7dee2627d0 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -61,6 +61,7 @@ #define SOF_HDA_PP_CAP_ID 0x3 #define SOF_HDA_REG_PP_PPCH 0x10 #define SOF_HDA_REG_PP_PPCTL 0x04 +#define SOF_HDA_REG_PP_PPSTS 0x08 #define SOF_HDA_PPCTL_PIE BIT(31) #define SOF_HDA_PPCTL_GPROCEN BIT(30) @@ -449,6 +450,7 @@ void hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev); void hda_dsp_dump_skl(struct snd_sof_dev *sdev, u32 flags); void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags); void hda_ipc_dump(struct snd_sof_dev *sdev); +void hda_ipc_irq_dump(struct snd_sof_dev *sdev); /* * DSP PCM Operations. From patchwork Wed Jun 12 16:57:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 10990379 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C66D41395 for ; Wed, 12 Jun 2019 17:00:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B27EA1FFB2 for ; Wed, 12 Jun 2019 17:00:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6941280B0; Wed, 12 Jun 2019 17:00:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0625C1FFB2 for ; Wed, 12 Jun 2019 17:00:34 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5CEE217AF; Wed, 12 Jun 2019 18:59:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5CEE217AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560358832; bh=uAXMRFk4BN9Ma5EPFQaUQz9npTonFqqoizNL+FTYlgM=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Wd1wKOjkL7fCBmVm8vUF4MaPisOhgYQuOmzxjjU1mX9xXO3hyP/P1JO94A5evnzgW hO2YhJvjyYlHe340IADARYpG4ajS9Q6Flef0If8eJMvag2fWzqa9nqOrvjcZGSkTu0 YTEWVpQtQzpQbnRzbX5PE2nNQk3dxYCy5tn2gJio= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E832EF89732; Wed, 12 Jun 2019 18:57:21 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 09474F89728; Wed, 12 Jun 2019 18:57:18 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 859E7F896E0 for ; Wed, 12 Jun 2019 18:57:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 859E7F896E0 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 09:57:12 -0700 X-ExtLoop1: 1 Received: from adorrell-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.251.133.122]) by orsmga002.jf.intel.com with ESMTP; 12 Jun 2019 09:57:11 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Wed, 12 Jun 2019 11:57:04 -0500 Message-Id: <20190612165705.1858-5-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> References: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Kai Vehmanen Subject: [alsa-devel] [PATCH 4/5] ASoC: SOF: ignore unrecoverable CTX_SAVE IPC errors at suspend X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Kai Vehmanen As part of the suspend flow, a context save IPC message is sent to the firmware before powering down the DSP. If errors are met, the suspend flow is aborted with current code. Change the behaviour such that if firmware returns -EBUSY or -EAGAIN, return the error codes to PM core as before. The device is left in active state in this case. If other errors are reported, print a warning but do not block the suspend flow. As per interface specification, no valid error can be returned in this scenario. If the hardware has hit a fatal error and is not able to respond successfully, best recovery method is to proceed with suspend and power off the DSP. Signed-off-by: Kai Vehmanen Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/pm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c index 8ef1d51025d8..b7843f02ef67 100644 --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@ -343,11 +343,20 @@ static int sof_suspend(struct device *dev, bool runtime_suspend) #endif /* notify DSP of upcoming power down */ ret = sof_send_pm_ipc(sdev, SOF_IPC_PM_CTX_SAVE); - if (ret < 0) { + if (ret == -EBUSY || ret == -EAGAIN) { + /* + * runtime PM has logic to handle -EBUSY/-EAGAIN so + * pass these errors up + */ dev_err(sdev->dev, "error: ctx_save ipc error during suspend %d\n", ret); return ret; + } else if (ret < 0) { + /* FW in unexpected state, continue to power down */ + dev_warn(sdev->dev, + "ctx_save ipc error %d, proceeding with suspend\n", + ret); } /* power down all DSP cores */ From patchwork Wed Jun 12 16:57:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 10990381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2999E1708 for ; Wed, 12 Jun 2019 17:01:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17785289BD for ; Wed, 12 Jun 2019 17:01:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C04128A00; Wed, 12 Jun 2019 17:01:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50679289FA for ; Wed, 12 Jun 2019 17:01:08 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 88D0917B1; Wed, 12 Jun 2019 19:00:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 88D0917B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560358866; bh=iFeUQ423XdVTK5EW9ul3pyMcgVIeYcAA9sCb8pUEKow=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MT5Xici1TdLo1iZrCYffivgMJmpOlQ1ex2wxweJTeyiCWLF8iyY420VOaERTNlW/3 cGyu//z49OA4E/ZFIR31Oj7mhj8TBtDgPb5LWd3YRGmDmXbz3tYW3lWtBBvrX8QfEh M3Lrb28P0MGidhZVQh1YF1/hkXQklgITFWrabt1M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 68498F8973A; Wed, 12 Jun 2019 18:57:23 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6F1BAF89731; Wed, 12 Jun 2019 18:57:19 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CF3B5F80791 for ; Wed, 12 Jun 2019 18:57:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CF3B5F80791 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 09:57:12 -0700 X-ExtLoop1: 1 Received: from adorrell-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.251.133.122]) by orsmga002.jf.intel.com with ESMTP; 12 Jun 2019 09:57:12 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Wed, 12 Jun 2019 11:57:05 -0500 Message-Id: <20190612165705.1858-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> References: <20190612165705.1858-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart Subject: [alsa-devel] [PATCH 5/5] ASoC: SOF: ipc: clarify operator precedence X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Cppcheck complains about the following warning, fix by adding parentheses [sound/soc/sof/ipc.c:783]: (style) Clarify calculation precedence for '&' and '?'. [sound/soc/sof/ipc.c:785]: (style) Clarify calculation precedence for '&' and '?'. [sound/soc/sof/ipc.c:787]: (style) Clarify calculation precedence for '&' and '?'. Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/ipc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index f3eb46bc808b..20dfca9c93b7 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -780,11 +780,11 @@ int snd_sof_ipc_valid(struct snd_sof_dev *sdev) " lock debug: %s\n" " lock vdebug: %s\n", v->build, v->date, v->time, - ready->flags & SOF_IPC_INFO_GDB ? + (ready->flags & SOF_IPC_INFO_GDB) ? "enabled" : "disabled", - ready->flags & SOF_IPC_INFO_LOCKS ? + (ready->flags & SOF_IPC_INFO_LOCKS) ? "enabled" : "disabled", - ready->flags & SOF_IPC_INFO_LOCKSV ? + (ready->flags & SOF_IPC_INFO_LOCKSV) ? "enabled" : "disabled"); }