From patchwork Thu Oct 12 19:18:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 732481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9775ECDB46E for ; Thu, 12 Oct 2023 19:20:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 93300E0D; Thu, 12 Oct 2023 21:19:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 93300E0D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697138442; bh=cLSWN8tjPNfXfRL9UK3x9LXGEbYmkwgHFyH8YhbtSxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XztYtxNF3r/vuB1oD7VqtOapthZr1Tr45/sTvklbY7GVlZXJrEB7rhoZIN5VNqTjN PrtZpCvFk4CalKc5vuUF9TWHaL0+REuaLVUgUGRwDNo+6m5QSY8z2xdiapb8E4zYX+ ZPixoVhTKVdIso8Rd/BaeHp6LF8yIj9gL4UTBKdQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7D8A6F80557; Thu, 12 Oct 2023 21:19:21 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id AEDEFF80536; Thu, 12 Oct 2023 21:19:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D1910F80310; Thu, 12 Oct 2023 21:19:16 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (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 049F4F8027B for ; Thu, 12 Oct 2023 21:19:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 049F4F8027B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=iOUvUze0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697138355; x=1728674355; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cLSWN8tjPNfXfRL9UK3x9LXGEbYmkwgHFyH8YhbtSxs=; b=iOUvUze0VlK1RC4UL+tKFpJYE8xSOMqpuW6LGrCKcRopCgyv/LUgmUQC swu0kaXQ2CeFs/hrLexAXmD3+lCaD0C6Xw0SNIdM8OchBsXDRRBJwJ9AS emTBWLc/j1W/qetp01swhnrhCr1mqZk8NzUMhwb5ivvN2ALxydX/dSpm3 9lIpOSxhXy4NSAdMB4c4XSOrSPBzO26jJ2HY8ODMTtsGPN49hxOTWIPX7 fwfiHbRvCH10Kqu3t6qgkWTJInxCXbKdld6VGuA68ClwJ1V9ylHu02jYF 3zoz3zBGxuQJA7hvuWWd2IJFCHzhRq78DjqoZD+6oFiJtr5RrMqVIbPuB Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="383875351" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="383875351" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 12:19:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="1001628004" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="1001628004" Received: from gchoudha-mobl.amr.corp.intel.com (HELO pbossart-mobl3.hsd1.md.comcast.net) ([10.212.114.241]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 12:18:59 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Arun T , Kai Vehmanen , Ranjani Sridharan , Pierre-Louis Bossart Subject: [PATCH 1/4] ASoC: SOF: Intel: pci-mtl: use ARL specific firmware definitions Date: Thu, 12 Oct 2023 15:18:47 -0400 Message-Id: <20231012191850.147140-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231012191850.147140-1-pierre-louis.bossart@linux.intel.com> References: <20231012191850.147140-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: WMS5RAI2CYTDQO55SWLD7G4FZIYTSNNN X-Message-ID-Hash: WMS5RAI2CYTDQO55SWLD7G4FZIYTSNNN X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Arun T Split out firmware definitions for Intel Arrow Lake platforms. Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Signed-off-by: Arun T Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/pci-mtl.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sound/soc/sof/intel/pci-mtl.c b/sound/soc/sof/intel/pci-mtl.c index 235e31a26106..0f378f45486d 100644 --- a/sound/soc/sof/intel/pci-mtl.c +++ b/sound/soc/sof/intel/pci-mtl.c @@ -50,9 +50,40 @@ static const struct sof_dev_desc mtl_desc = { .ops_free = hda_ops_free, }; +static const struct sof_dev_desc arl_desc = { + .use_acpi_target_states = true, + .machines = snd_soc_acpi_intel_arl_machines, + .alt_machines = snd_soc_acpi_intel_arl_sdw_machines, + .resindex_lpe_base = 0, + .resindex_pcicfg_base = -1, + .resindex_imr_base = -1, + .irqindex_host_ipc = -1, + .chip_info = &mtl_chip_info, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_4, + .dspless_mode_supported = true, /* Only supported for HDaudio */ + .default_fw_path = { + [SOF_IPC_TYPE_4] = "intel/sof-ipc4/arl", + }, + .default_lib_path = { + [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/arl", + }, + .default_tplg_path = { + [SOF_IPC_TYPE_4] = "intel/sof-ace-tplg", + }, + .default_fw_filename = { + [SOF_IPC_TYPE_4] = "sof-arl.ri", + }, + .nocodec_tplg_filename = "sof-arl-nocodec.tplg", + .ops = &sof_mtl_ops, + .ops_init = sof_mtl_ops_init, + .ops_free = hda_ops_free, +}; + /* PCI IDs */ static const struct pci_device_id sof_pci_ids[] = { { PCI_DEVICE_DATA(INTEL, HDA_MTL, &mtl_desc) }, + { PCI_DEVICE_DATA(INTEL, HDA_ARL_S, &arl_desc) }, { 0, } }; MODULE_DEVICE_TABLE(pci, sof_pci_ids); From patchwork Thu Oct 12 19:18:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 733726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D840CDB47E for ; Thu, 12 Oct 2023 19:21:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 85853DEC; Thu, 12 Oct 2023 21:20:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 85853DEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697138489; bh=BRnHlyoq7yAJKhSu9/5yVO9C4zmQi49Pg9h69jtLTV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WBAjSYUoXoyfvqW46DlHZK3DBtFjpYq0nhk1RZyce1PjeZ97sFsuS9yT6ju9Fu8R4 dO3eNtEHn0XAhdbQltpmfPPvjtf5CEruXAuCZ/2jDfdTy8p4kkrUyFti9+rOt1oTIo eWT1m4ekRjFLsnC2OKZgAUkiDHkm21PDslO0Erag= Received: by alsa1.perex.cz (Postfix, from userid 50401) id BCF33F80587; Thu, 12 Oct 2023 21:19:28 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4C90DF80587; Thu, 12 Oct 2023 21:19:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DF62FF802BE; Thu, 12 Oct 2023 21:19:19 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (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 A8405F8019B for ; Thu, 12 Oct 2023 21:19:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A8405F8019B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Z1sK9QmL DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697138356; x=1728674356; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BRnHlyoq7yAJKhSu9/5yVO9C4zmQi49Pg9h69jtLTV0=; b=Z1sK9QmL/du0dqHCOseRAOgTlIw69YYprQv5Nwv32K/it3tX1qvglEkP qHtTzJG3jvMc9ZEJPA7anyrVhwwTlyhKPk/WCL5JcDDXRU2Esea3b7OsE jN1SYGmgUKaXtMXVcxkbdRzjIL+2nRghUfuTJmh80FewNXuhShYBOGIhM 40BfMwU4uUTeJTNUy3TJKPMgyQhmJh1yjHlsxQjOGJsk/4gteJJrlW8NZ BifeF/1rDlC604PuIANfo+AHwec+M7x/yvYUECo/xdNQvrzs3306iFA4s qVCOS8hCXWkG6Qz3/xaqwtXx/Zen1o3lUxcneq2X+aQZfAiTMg6KG10Xs g==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="383875357" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="383875357" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 12:19:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="1001628005" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="1001628005" Received: from gchoudha-mobl.amr.corp.intel.com (HELO pbossart-mobl3.hsd1.md.comcast.net) ([10.212.114.241]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 12:19:00 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Peter Ujfalusi , Guennadi Liakhovetski , Pierre-Louis Bossart Subject: [PATCH 2/4] ASoC: SOF: Intel: hda-dsp: Make sure that no irq handler is pending before suspend Date: Thu, 12 Oct 2023 15:18:48 -0400 Message-Id: <20231012191850.147140-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231012191850.147140-1-pierre-louis.bossart@linux.intel.com> References: <20231012191850.147140-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: Q7ONY7ZD7LUWC6FPV6ASUZSXEAY53CT5 X-Message-ID-Hash: Q7ONY7ZD7LUWC6FPV6ASUZSXEAY53CT5 X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Ujfalusi In the existing IPC support, the reply to each IPC message is handled in an IRQ thread. The assumption is that the IRQ thread is scheduled without significant delays. On an experimental (iow, buggy) kernel, the IRQ thread dealing with the reply to the last IPC message before powering-down the DSP can be delayed by several seconds. The IRQ thread will proceed with register accesses after the DSP is powered-down which results in a kernel crash. While the bug which causes the delay is not in the audio stack, we must handle such cases with defensive programming to avoid such crashes. Call synchronize_irq() before proceeding to power down the DSP to make sure that no irq thread is pending execution. Closes: https://github.com/thesofproject/linux/issues/4608 Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/hda-dsp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c index 44f39a520bb3..2445ae7f6b2e 100644 --- a/sound/soc/sof/intel/hda-dsp.c +++ b/sound/soc/sof/intel/hda-dsp.c @@ -699,6 +699,9 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend) if (ret < 0) return ret; + /* make sure that no irq handler is pending before shutdown */ + synchronize_irq(sdev->ipc_irq); + hda_codec_jack_wake_enable(sdev, runtime_suspend); /* power down all hda links */ From patchwork Thu Oct 12 19:18:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 732480 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E521CDB46E for ; Thu, 12 Oct 2023 19:21:19 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9D761E80; Thu, 12 Oct 2023 21:20:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9D761E80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697138477; bh=sAHB7fmSUKevt1U+ojjUC0DYZuDwCCtdZ51toos2gaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sJx8BteOwHz7Ucry0ILEIMO4Z0hG6JIz0T6uxpXrN7KF89idI7CvW8VEBxonaNjDe qoJ0u57erpsghlKANh52hVGQuBFYaqeWfDgK2+K1Xas64IE6JSPeBBdMqLpd41hRh1 Pyy97eKRGhm/FIgFnwl1UXUMK8QMR3u1t05appu4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9D2C2F8057A; Thu, 12 Oct 2023 21:19:25 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0B151F8057B; Thu, 12 Oct 2023 21:19:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CB311F80310; Thu, 12 Oct 2023 21:19:18 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (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 D9791F8027B for ; Thu, 12 Oct 2023 21:19:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D9791F8027B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=c9pfFHSD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697138357; x=1728674357; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sAHB7fmSUKevt1U+ojjUC0DYZuDwCCtdZ51toos2gaY=; b=c9pfFHSD3uXjiKIn4Hz+cB+gIQb1GkIL9kBTTDp+z1q1ckG1u/favRjQ icxo4q2frPO6uYK5SesXq4QcP+ya66Hau5zvXyZscz44MYgyT+SnTmmGe 4f+shYHCUPFL35pNafoIkWDcZj33sg5SYTK8B+py76HAKyopGsHuJWfu0 xWGMEhLQT0C409R3CN1oVtx3jwokFwY1VW5z4skTUaUaIfZcBRHvzolRk pzkcukBT0DBuP02WwxfzTkEVOBqJMrP9i9Mhbfo/OmDmw+s4U+qeGv+Kh fm84x9RZun3y09IjoiKW2jskfrgQWIIHsz98bxsygDo6TRS5qLFE8Itex g==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="383875368" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="383875368" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 12:19:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="1001628013" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="1001628013" Received: from gchoudha-mobl.amr.corp.intel.com (HELO pbossart-mobl3.hsd1.md.comcast.net) ([10.212.114.241]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 12:19:00 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Peter Ujfalusi , Seppo Ingalsuo , Ranjani Sridharan , Pierre-Louis Bossart Subject: [PATCH 3/4] ASoC: SOF: ipc4: Dump the notification payload Date: Thu, 12 Oct 2023 15:18:49 -0400 Message-Id: <20231012191850.147140-4-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231012191850.147140-1-pierre-louis.bossart@linux.intel.com> References: <20231012191850.147140-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: TIUER3USCAI3LDT7JNDFAZRZATL74QCD X-Message-ID-Hash: TIUER3USCAI3LDT7JNDFAZRZATL74QCD X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Ujfalusi Now that we have notifications with payload (kcontrol change notifications), it is time to add the payload dump on the rx path as well. Reviewed-by: Seppo Ingalsuo Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/ipc4.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/sof/ipc4.c b/sound/soc/sof/ipc4.c index 3f4d57dba972..8441f4ae4065 100644 --- a/sound/soc/sof/ipc4.c +++ b/sound/soc/sof/ipc4.c @@ -666,6 +666,10 @@ static void sof_ipc4_rx_msg(struct snd_sof_dev *sdev) sof_ipc4_log_header(sdev->dev, "ipc rx done ", ipc4_msg, true); if (data_size) { + if (sof_debug_check_flag(SOF_DBG_DUMP_IPC_MESSAGE_PAYLOAD)) + sof_ipc4_dump_payload(sdev, ipc4_msg->data_ptr, + ipc4_msg->data_size); + kfree(ipc4_msg->data_ptr); ipc4_msg->data_ptr = NULL; ipc4_msg->data_size = 0; From patchwork Thu Oct 12 19:18:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 732479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA907CDB46E for ; Thu, 12 Oct 2023 19:21:53 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D1F9DEC1; Thu, 12 Oct 2023 21:21:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D1F9DEC1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697138511; bh=q5WLXoIBQW7WGaww7V805wk3LOohYxdLIZJQ5SFmGmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZL1XXd2JShs+Q9K2v/1DXO+J0UiD1Um1f45sWVyjQkjZ+TivNaDRUnDNblJAUnZ4z NtzOLf2e1zJ2AAF8NBqa/kM8I/+nxHV78sjeSJMvnKuZSgxv+nc5WlrIhrp9FNho21 dTaXMxr039byc4rqfpq4zTnACbGvfhfQiRpWbt6g= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0BF59F805B3; Thu, 12 Oct 2023 21:19:30 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 79FADF805A1; Thu, 12 Oct 2023 21:19:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1BA33F80578; Thu, 12 Oct 2023 21:19:24 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (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 0630BF802E8 for ; Thu, 12 Oct 2023 21:19:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0630BF802E8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=D1bYwiVx DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697138357; x=1728674357; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=q5WLXoIBQW7WGaww7V805wk3LOohYxdLIZJQ5SFmGmA=; b=D1bYwiVxDDa8Mu1zTNdoZX5Up9tLF/3Ng4VsOKHFNyrPTMDqRTHK6t5W WWljXVtDQt3WP/2np5U70D8hJYWsfrQxUTANgUNDVv8HmS13QJfruT76g Jm5PA2mZgmn0tvF6j+fI++ZDn9XNMCUUTCUTtughW66x7kXskKHHA9d4Q m/85WSEi5PcLRywoQbEgJS59kln0dJRix2xvNDGM7C603dVLSgeOC9OpY oyxzUHKtDkzKDh0eDDb0PZLewaFA4Gb2412ZPiGtvHGgjTXI/sbNdi7KQ MQY1QNT99jsMUi8TxfSmv+ccXbPRRzol98XiWjlexq24VWvf9u9icGU6H Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="383875375" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="383875375" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 12:19:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="1001628022" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="1001628022" Received: from gchoudha-mobl.amr.corp.intel.com (HELO pbossart-mobl3.hsd1.md.comcast.net) ([10.212.114.241]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 12:19:01 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Daniel Baluta , Rander Wang , =?utf-8?q?P=C3=A9ter_Ujfalusi?= , Bard Liao Subject: [PATCH 4/4] ASoC: SOF: make .remove callback return void Date: Thu, 12 Oct 2023 15:18:50 -0400 Message-Id: <20231012191850.147140-5-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231012191850.147140-1-pierre-louis.bossart@linux.intel.com> References: <20231012191850.147140-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 7V32PUQVGBYQQNOVA4JRMBQSRM2L4EIQ X-Message-ID-Hash: 7V32PUQVGBYQQNOVA4JRMBQSRM2L4EIQ X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We don't use the returned value and return 0 anyways, let's follow the example of platform drivers and simplify the definitions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao --- sound/soc/sof/amd/acp.c | 4 ++-- sound/soc/sof/amd/acp.h | 2 +- sound/soc/sof/imx/imx8.c | 4 +--- sound/soc/sof/imx/imx8m.c | 4 +--- sound/soc/sof/imx/imx8ulp.c | 4 +--- sound/soc/sof/intel/byt.c | 4 +--- sound/soc/sof/intel/hda.c | 4 +--- sound/soc/sof/intel/hda.h | 2 +- sound/soc/sof/mediatek/mt8186/mt8186.c | 4 +--- sound/soc/sof/mediatek/mt8195/mt8195.c | 4 +--- sound/soc/sof/ops.h | 6 ++---- sound/soc/sof/sof-priv.h | 2 +- 12 files changed, 14 insertions(+), 30 deletions(-) diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index 19a801908b56..603ea5fc0d0d 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -575,7 +575,7 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) } EXPORT_SYMBOL_NS(amd_sof_acp_probe, SND_SOC_SOF_AMD_COMMON); -int amd_sof_acp_remove(struct snd_sof_dev *sdev) +void amd_sof_acp_remove(struct snd_sof_dev *sdev) { struct acp_dev_data *adata = sdev->pdata->hw_pdata; @@ -588,7 +588,7 @@ int amd_sof_acp_remove(struct snd_sof_dev *sdev) if (adata->dmic_dev) platform_device_unregister(adata->dmic_dev); - return acp_reset(sdev); + acp_reset(sdev); } EXPORT_SYMBOL_NS(amd_sof_acp_remove, SND_SOC_SOF_AMD_COMMON); diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h index 4dcceb764769..6814f2051104 100644 --- a/sound/soc/sof/amd/acp.h +++ b/sound/soc/sof/amd/acp.h @@ -220,7 +220,7 @@ int configure_and_run_sha_dma(struct acp_dev_data *adata, void *image_addr, /* ACP device probe/remove */ int amd_sof_acp_probe(struct snd_sof_dev *sdev); -int amd_sof_acp_remove(struct snd_sof_dev *sdev); +void amd_sof_acp_remove(struct snd_sof_dev *sdev); /* DSP Loader callbacks */ int acp_sof_dsp_run(struct snd_sof_dev *sdev); diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index e375f29b21d1..170740bce839 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -338,7 +338,7 @@ static int imx8_probe(struct snd_sof_dev *sdev) return ret; } -static int imx8_remove(struct snd_sof_dev *sdev) +static void imx8_remove(struct snd_sof_dev *sdev) { struct imx8_priv *priv = sdev->pdata->hw_pdata; int i; @@ -350,8 +350,6 @@ static int imx8_remove(struct snd_sof_dev *sdev) device_link_del(priv->link[i]); dev_pm_domain_detach(priv->pd_dev[i], false); } - - return 0; } /* on i.MX8 there is 1 to 1 match between type and BAR idx */ diff --git a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c index 198a9cd74019..2680f061ba42 100644 --- a/sound/soc/sof/imx/imx8m.c +++ b/sound/soc/sof/imx/imx8m.c @@ -269,14 +269,12 @@ static int imx8m_probe(struct snd_sof_dev *sdev) return ret; } -static int imx8m_remove(struct snd_sof_dev *sdev) +static void imx8m_remove(struct snd_sof_dev *sdev) { struct imx8m_priv *priv = sdev->pdata->hw_pdata; imx8_disable_clocks(sdev, priv->clks); platform_device_unregister(priv->ipc_dev); - - return 0; } /* on i.MX8 there is 1 to 1 match between type and BAR idx */ diff --git a/sound/soc/sof/imx/imx8ulp.c b/sound/soc/sof/imx/imx8ulp.c index c04601965014..ca6edb85ff71 100644 --- a/sound/soc/sof/imx/imx8ulp.c +++ b/sound/soc/sof/imx/imx8ulp.c @@ -278,14 +278,12 @@ static int imx8ulp_probe(struct snd_sof_dev *sdev) return ret; } -static int imx8ulp_remove(struct snd_sof_dev *sdev) +static void imx8ulp_remove(struct snd_sof_dev *sdev) { struct imx8ulp_priv *priv = sdev->pdata->hw_pdata; imx8_disable_clocks(sdev, priv->clks); platform_device_unregister(priv->ipc_dev); - - return 0; } /* on i.MX8 there is 1 to 1 match between type and BAR idx */ diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c index 82ab4b0fabf3..373527b206d7 100644 --- a/sound/soc/sof/intel/byt.c +++ b/sound/soc/sof/intel/byt.c @@ -100,11 +100,9 @@ static int byt_resume(struct snd_sof_dev *sdev) return 0; } -static int byt_remove(struct snd_sof_dev *sdev) +static void byt_remove(struct snd_sof_dev *sdev) { byt_reset_dsp_disable_int(sdev); - - return 0; } static int byt_acpi_probe(struct snd_sof_dev *sdev) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index a1732af2b1be..29f4e043aade 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1317,7 +1317,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) return ret; } -int hda_dsp_remove(struct snd_sof_dev *sdev) +void hda_dsp_remove(struct snd_sof_dev *sdev) { struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; const struct sof_intel_dsp_desc *chip = hda->desc; @@ -1377,8 +1377,6 @@ int hda_dsp_remove(struct snd_sof_dev *sdev) sof_hda_bus_exit(sdev); hda_codec_i915_exit(sdev); - - return 0; } int hda_power_down_dsp(struct snd_sof_dev *sdev) diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 7c575ba9462c..0ebc042c5ce1 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -577,7 +577,7 @@ struct sof_intel_hda_stream { * DSP Core services. */ int hda_dsp_probe(struct snd_sof_dev *sdev); -int hda_dsp_remove(struct snd_sof_dev *sdev); +void hda_dsp_remove(struct snd_sof_dev *sdev); int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask); int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask); int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask); diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c index 3717fdeae3a6..b69fa788b16f 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -391,7 +391,7 @@ static int mt8186_dsp_probe(struct snd_sof_dev *sdev) return ret; } -static int mt8186_dsp_remove(struct snd_sof_dev *sdev) +static void mt8186_dsp_remove(struct snd_sof_dev *sdev) { struct adsp_priv *priv = sdev->pdata->hw_pdata; @@ -399,8 +399,6 @@ static int mt8186_dsp_remove(struct snd_sof_dev *sdev) mt8186_sof_hifixdsp_shutdown(sdev); adsp_sram_power_off(sdev); mt8186_adsp_clock_off(sdev); - - return 0; } static int mt8186_dsp_shutdown(struct snd_sof_dev *sdev) diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index b873e1534dd0..cac0a085f60a 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -388,7 +388,7 @@ static int mt8195_dsp_shutdown(struct snd_sof_dev *sdev) return snd_sof_suspend(sdev->dev); } -static int mt8195_dsp_remove(struct snd_sof_dev *sdev) +static void mt8195_dsp_remove(struct snd_sof_dev *sdev) { struct platform_device *pdev = container_of(sdev->dev, struct platform_device, dev); struct adsp_priv *priv = sdev->pdata->hw_pdata; @@ -396,8 +396,6 @@ static int mt8195_dsp_remove(struct snd_sof_dev *sdev) platform_device_unregister(priv->ipc_dev); adsp_sram_power_on(&pdev->dev, false); adsp_clock_off(sdev); - - return 0; } static int mt8195_dsp_suspend(struct snd_sof_dev *sdev, u32 target_state) diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h index a494bdef3739..5be1cf80bb42 100644 --- a/sound/soc/sof/ops.h +++ b/sound/soc/sof/ops.h @@ -43,12 +43,10 @@ static inline int snd_sof_probe(struct snd_sof_dev *sdev) return sof_ops(sdev)->probe(sdev); } -static inline int snd_sof_remove(struct snd_sof_dev *sdev) +static inline void snd_sof_remove(struct snd_sof_dev *sdev) { if (sof_ops(sdev)->remove) - return sof_ops(sdev)->remove(sdev); - - return 0; + sof_ops(sdev)->remove(sdev); } static inline int snd_sof_shutdown(struct snd_sof_dev *sdev) diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index d4f6702e93dc..40bca5f80428 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -166,7 +166,7 @@ struct snd_sof_dsp_ops { /* probe/remove/shutdown */ int (*probe)(struct snd_sof_dev *sof_dev); /* mandatory */ - int (*remove)(struct snd_sof_dev *sof_dev); /* optional */ + void (*remove)(struct snd_sof_dev *sof_dev); /* optional */ int (*shutdown)(struct snd_sof_dev *sof_dev); /* optional */ /* DSP core boot / reset */