From patchwork Wed Apr 19 19:40:56 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: 676930 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 5A407C6FD18 for ; Wed, 19 Apr 2023 19:43:13 +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 40393F01; Wed, 19 Apr 2023 21:42:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 40393F01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681933391; bh=FiIvs2GJRoNgRkQ4E3hYGiS2X7wWBcm7oDuUes7XXc0=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bGJmEJcnFu9Z6ADSC6vOC+MZSAIpg4YOdgcJOrFefYpH2VE67/VAHqdYCTA/AqRLY 72oVM+TIllszWr9UFF54wQuYzqHJFUuNJQjgWDOSylbjt0lSCCUUts5dcPPhSUVg+Z gqLYUy5lLnOPwLXw2T1yLYRRZDNWS/MUJfmhxim0= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id E7DBFF80528; Wed, 19 Apr 2023 21:41:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C3BD5F8019B; Wed, 19 Apr 2023 21:41:28 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 8FA5FF800D0 for ; Wed, 19 Apr 2023 21:41:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8FA5FF800D0 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=QAxQcGKU DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681933282; x=1713469282; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FiIvs2GJRoNgRkQ4E3hYGiS2X7wWBcm7oDuUes7XXc0=; b=QAxQcGKUIDvAKju7jCm5maEYL6Io1+s5TeuK8LrQLZO78MEJl4bfki1z URJPhtyAD5FVcVxzGNqOUinMKPDJbu8xZawXVy2Tx8o5ZV0yuQIJEALcS Dsgodv6gCC+PmudSU3SzpR1oPoyzCcuaYaoY/0+84L6FGSUeU2lNBPMIg 1gqKSJSNqIqRTQodIHfhuGN/tNXCVI34GR58pXaR9FA3F5X5/n2VZTU5b rwcATnk3z2InbNMfaKklaQidUr4F8aftzcUc05KtIWKJuKvXQZfty53YQ FsGno5A72fWpStaOhCChc9WlbqVL4w31r4G+4KeQUR7+IULtoGebhgvdp Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="431822104" X-IronPort-AV: E=Sophos;i="5.99,210,1677571200"; d="scan'208";a="431822104" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2023 12:41:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="694191220" X-IronPort-AV: E=Sophos;i="5.99,210,1677571200"; d="scan'208";a="694191220" Received: from gargicha-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.74.38]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2023 12:41:07 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH v2 1/2] ASoC: SOF: ipc: Add no reply inline calls Date: Wed, 19 Apr 2023 14:40:56 -0500 Message-Id: <20230419194057.42205-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230419194057.42205-1-pierre-louis.bossart@linux.intel.com> References: <20230419194057.42205-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 7W53VMMY7QZZ5MGFKIKKX2J4EBWRSZKD X-Message-ID-Hash: 7W53VMMY7QZZ5MGFKIKKX2J4EBWRSZKD 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 CC: tiwai@suse.de, broonie@kernel.org, Curtis Malainey , Pierre-Louis Bossart , Bard Liao , =?utf-8?q?P=C3=A9ter_Ujfalusi?= , Ranjani Sridharan 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: Curtis Malainey 95% of the calls inside SOF to TX an IPC don't care about a reply. Yet the previous commit cleaned up a bunch of replies that were being populated and then thrown away. This adds some functions so users who do not need replies don't feel obligated to provide the space to the API. Signed-off-by: Curtis Malainey Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan --- sound/soc/sof/sof-client.h | 4 ++++ sound/soc/sof/sof-priv.h | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/sound/soc/sof/sof-client.h b/sound/soc/sof/sof-client.h index 2589714eaa91..10571d1ea9a7 100644 --- a/sound/soc/sof/sof-client.h +++ b/sound/soc/sof/sof-client.h @@ -39,6 +39,10 @@ struct sof_client_dev { int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg, void *reply_data, size_t reply_bytes); +static inline int sof_client_ipc_tx_message_no_reply(struct sof_client_dev *cdev, void *ipc_msg) +{ + return sof_client_ipc_tx_message(cdev, ipc_msg, NULL, 0); +} int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg, bool set); diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index 1170989bea57..cd4f6ac126ec 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -711,10 +711,20 @@ static inline void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev) } int sof_ipc_tx_message(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes, void *reply_data, size_t reply_bytes); +static inline int sof_ipc_tx_message_no_reply(struct snd_sof_ipc *ipc, void *msg_data, + size_t msg_bytes) +{ + return sof_ipc_tx_message(ipc, msg_data, msg_bytes, NULL, 0); +} int sof_ipc_set_get_data(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes, bool set); int sof_ipc_tx_message_no_pm(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes, void *reply_data, size_t reply_bytes); +static inline int sof_ipc_tx_message_no_pm_no_reply(struct snd_sof_ipc *ipc, void *msg_data, + size_t msg_bytes) +{ + return sof_ipc_tx_message_no_pm(ipc, msg_data, msg_bytes, NULL, 0); +} int sof_ipc_send_msg(struct snd_sof_dev *sdev, void *msg_data, size_t msg_bytes, size_t reply_bytes); From patchwork Wed Apr 19 19:40:57 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: 675060 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 51177C6FD18 for ; Wed, 19 Apr 2023 19:43: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 00F9CF09; Wed, 19 Apr 2023 21:42:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 00F9CF09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681933397; bh=rsPUngUAn03lfuVuE7g1Ih871ySqjVqo5B6LYMtQj6A=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Akx9LxRVgAIztIQxBdq8bkypMNsteNxj7G7yjP1eMdkTA2i/QzOpqvpycHQ7uAZX2 6Erq21omQ9t2MjAY7i1R8eBsOL8StR1F1X6u2hJPDvdgqB8dQdtrgeLvPQQdIpDF1K 17Z1oJWjz6M3s1JXrENTsID+EM223H+wkvcd0EqQ= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 76145F80149; Wed, 19 Apr 2023 21:41:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EC5E9F8052E; Wed, 19 Apr 2023 21:41:38 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 5BADBF80149 for ; Wed, 19 Apr 2023 21:41:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5BADBF80149 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=TDLVMxJZ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681933283; x=1713469283; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rsPUngUAn03lfuVuE7g1Ih871ySqjVqo5B6LYMtQj6A=; b=TDLVMxJZN2WaLIGeL4iSw4tga8O2hNMyORxLk9Ia9jcZ2uPjn+2uvhOS AHjg6wzP3FAm9gD+9DQAngI7/b8hB11jrAyfdBvQtsYyu4ULg7u7m0P0g NfD1GPKIz2P8R8XlEeKnFX+X34HbRv7c/l9PjaoUHasyWwPo9JgzPlyKz AczKbymyomVyfzcwmKyR4jH73kTRI0hg3+VyRKNG/Pt3AmyPyU/Gr2bix 0BCfcoarg+6bo5M8YtdD3JiaawX+UQ2WIIxBrdX3gNOSueNKrqsxCb3N8 lVnNQ36BONc4ktq+K07YxnqBaT9zZZS8Sgp+9qsvOo/WabOY0cMjR3Etn A==; X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="431822115" X-IronPort-AV: E=Sophos;i="5.99,210,1677571200"; d="scan'208";a="431822115" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2023 12:41:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="694191223" X-IronPort-AV: E=Sophos;i="5.99,210,1677571200"; d="scan'208";a="694191223" Received: from gargicha-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.74.38]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2023 12:41:08 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH v2 2/2] ASoC: SOF: Use no_reply calls for TX Date: Wed, 19 Apr 2023 14:40:57 -0500 Message-Id: <20230419194057.42205-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230419194057.42205-1-pierre-louis.bossart@linux.intel.com> References: <20230419194057.42205-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: KOAJAXVMRQQCTPG3XMSDKGJ3TXC4UHQF X-Message-ID-Hash: KOAJAXVMRQQCTPG3XMSDKGJ3TXC4UHQF 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 CC: tiwai@suse.de, broonie@kernel.org, Curtis Malainey , Pierre-Louis Bossart , Bard Liao , =?utf-8?q?P=C3=A9ter_Ujfalusi?= , Ranjani Sridharan 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: Curtis Malainey Convert all existing calls that pass "NULL, 0" for reply data to the new no_reply calls. Also convert any calls that pass in data but don't actually parse the result. Signed-off-by: Curtis Malainey Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan --- sound/soc/sof/compress.c | 8 ++---- sound/soc/sof/intel/hda-loader.c | 2 +- sound/soc/sof/ipc3-dtrace.c | 12 +++------ sound/soc/sof/ipc3-pcm.c | 6 ++--- sound/soc/sof/ipc3-topology.c | 33 +++++++---------------- sound/soc/sof/ipc3.c | 12 +++------ sound/soc/sof/ipc4-pcm.c | 6 ++--- sound/soc/sof/ipc4-topology.c | 10 +++---- sound/soc/sof/sof-client-ipc-flood-test.c | 3 +-- sound/soc/sof/sof-client-probes-ipc3.c | 12 +++------ sound/soc/sof/sof-client-probes-ipc4.c | 4 +-- 11 files changed, 37 insertions(+), 71 deletions(-) diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c index 8d205eb16d2f..d7b044f33d79 100644 --- a/sound/soc/sof/compress.c +++ b/sound/soc/sof/compress.c @@ -135,7 +135,6 @@ static int sof_compr_free(struct snd_soc_component *component, struct sof_compr_stream *sstream = cstream->runtime->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct sof_ipc_stream stream; - struct sof_ipc_reply reply; struct snd_sof_pcm *spcm; int ret = 0; @@ -148,8 +147,7 @@ static int sof_compr_free(struct snd_soc_component *component, stream.comp_id = spcm->stream[cstream->direction].comp_id; if (spcm->prepared[cstream->direction]) { - ret = sof_ipc_tx_message(sdev->ipc, &stream, sizeof(stream), - &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &stream, sizeof(stream)); if (!ret) spcm->prepared[cstream->direction] = false; } @@ -273,7 +271,6 @@ static int sof_compr_trigger(struct snd_soc_component *component, struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct sof_ipc_stream stream; - struct sof_ipc_reply reply; struct snd_sof_pcm *spcm; spcm = snd_sof_find_spcm_dai(component, rtd); @@ -302,8 +299,7 @@ static int sof_compr_trigger(struct snd_soc_component *component, break; } - return sof_ipc_tx_message(sdev->ipc, &stream, sizeof(stream), - &reply, sizeof(reply)); + return sof_ipc_tx_message_no_reply(sdev->ipc, &stream, sizeof(stream)); } static int sof_compr_copy_playback(struct snd_compr_runtime *rtd, diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c index de8d9ad89bc7..50ce6b190002 100644 --- a/sound/soc/sof/intel/hda-loader.c +++ b/sound/soc/sof/intel/hda-loader.c @@ -557,7 +557,7 @@ int hda_dsp_ipc4_load_library(struct snd_sof_dev *sdev, goto cleanup; } - ret = sof_ipc_tx_message(sdev->ipc, &msg, 0, NULL, 0); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &msg, 0); ret1 = cl_trigger(sdev, hext_stream, SNDRV_PCM_TRIGGER_STOP); if (ret1 < 0) { diff --git a/sound/soc/sof/ipc3-dtrace.c b/sound/soc/sof/ipc3-dtrace.c index b815b0244d9e..1d3bca2d28dd 100644 --- a/sound/soc/sof/ipc3-dtrace.c +++ b/sound/soc/sof/ipc3-dtrace.c @@ -150,7 +150,6 @@ static int ipc3_trace_update_filter(struct snd_sof_dev *sdev, int num_elems, struct sof_ipc_trace_filter_elem *elems) { struct sof_ipc_trace_filter *msg; - struct sof_ipc_reply reply; size_t size; int ret; @@ -172,13 +171,13 @@ static int ipc3_trace_update_filter(struct snd_sof_dev *sdev, int num_elems, dev_err(sdev->dev, "enabling device failed: %d\n", ret); goto error; } - ret = sof_ipc_tx_message(sdev->ipc, msg, msg->hdr.size, &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, msg, msg->hdr.size); pm_runtime_mark_last_busy(sdev->dev); pm_runtime_put_autosuspend(sdev->dev); error: kfree(msg); - return ret ? ret : reply.error; + return ret; } static ssize_t dfsentry_trace_filter_write(struct file *file, const char __user *from, @@ -434,7 +433,6 @@ static int ipc3_dtrace_enable(struct snd_sof_dev *sdev) struct sof_ipc_fw_ready *ready = &sdev->fw_ready; struct sof_ipc_fw_version *v = &ready->version; struct sof_ipc_dma_trace_params_ext params; - struct sof_ipc_reply ipc_reply; int ret; if (!sdev->fw_trace_is_supported) @@ -474,7 +472,7 @@ static int ipc3_dtrace_enable(struct snd_sof_dev *sdev) /* send IPC to the DSP */ priv->dtrace_state = SOF_DTRACE_INITIALIZING; - ret = sof_ipc_tx_message(sdev->ipc, ¶ms, sizeof(params), &ipc_reply, sizeof(ipc_reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, ¶ms, sizeof(params)); if (ret < 0) { dev_err(sdev->dev, "can't set params for DMA for trace %d\n", ret); goto trace_release; @@ -604,7 +602,6 @@ static void ipc3_dtrace_release(struct snd_sof_dev *sdev, bool only_stop) struct sof_ipc_fw_ready *ready = &sdev->fw_ready; struct sof_ipc_fw_version *v = &ready->version; struct sof_ipc_cmd_hdr hdr; - struct sof_ipc_reply ipc_reply; int ret; if (!sdev->fw_trace_is_supported || priv->dtrace_state == SOF_DTRACE_DISABLED) @@ -623,8 +620,7 @@ static void ipc3_dtrace_release(struct snd_sof_dev *sdev, bool only_stop) hdr.size = sizeof(hdr); hdr.cmd = SOF_IPC_GLB_TRACE_MSG | SOF_IPC_TRACE_DMA_FREE; - ret = sof_ipc_tx_message(sdev->ipc, &hdr, hdr.size, - &ipc_reply, sizeof(ipc_reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &hdr, hdr.size); if (ret < 0) dev_err(sdev->dev, "DMA_TRACE_FREE failed with error: %d\n", ret); } diff --git a/sound/soc/sof/ipc3-pcm.c b/sound/soc/sof/ipc3-pcm.c index b7f1eb21ca26..304faf6425ab 100644 --- a/sound/soc/sof/ipc3-pcm.c +++ b/sound/soc/sof/ipc3-pcm.c @@ -19,7 +19,6 @@ static int sof_ipc3_pcm_hw_free(struct snd_soc_component *component, struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct sof_ipc_stream stream; - struct sof_ipc_reply reply; struct snd_sof_pcm *spcm; spcm = snd_sof_find_spcm_dai(component, rtd); @@ -34,7 +33,7 @@ static int sof_ipc3_pcm_hw_free(struct snd_soc_component *component, stream.comp_id = spcm->stream[substream->stream].comp_id; /* send IPC to the DSP */ - return sof_ipc_tx_message(sdev->ipc, &stream, sizeof(stream), &reply, sizeof(reply)); + return sof_ipc_tx_message_no_reply(sdev->ipc, &stream, sizeof(stream)); } static int sof_ipc3_pcm_hw_params(struct snd_soc_component *component, @@ -146,7 +145,6 @@ static int sof_ipc3_pcm_trigger(struct snd_soc_component *component, struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); struct sof_ipc_stream stream; - struct sof_ipc_reply reply; struct snd_sof_pcm *spcm; spcm = snd_sof_find_spcm_dai(component, rtd); @@ -178,7 +176,7 @@ static int sof_ipc3_pcm_trigger(struct snd_soc_component *component, } /* send IPC to the DSP */ - return sof_ipc_tx_message(sdev->ipc, &stream, sizeof(stream), &reply, sizeof(reply)); + return sof_ipc_tx_message_no_reply(sdev->ipc, &stream, sizeof(stream)); } static void ssp_dai_config_pcm_params_match(struct snd_sof_dev *sdev, const char *link_name, diff --git a/sound/soc/sof/ipc3-topology.c b/sound/soc/sof/ipc3-topology.c index b1f425b39db9..fc1eb8e2de2c 100644 --- a/sound/soc/sof/ipc3-topology.c +++ b/sound/soc/sof/ipc3-topology.c @@ -1627,7 +1627,6 @@ static void sof_ipc3_widget_free_comp_dai(struct snd_sof_widget *swidget) static int sof_ipc3_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route *sroute) { struct sof_ipc_pipe_comp_connect connect; - struct sof_ipc_reply reply; int ret; connect.hdr.size = sizeof(connect); @@ -1640,7 +1639,7 @@ static int sof_ipc3_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route * sroute->sink_widget->widget->name); /* send ipc */ - ret = sof_ipc_tx_message(sdev->ipc, &connect, sizeof(connect), &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &connect, sizeof(connect)); if (ret < 0) dev_err(sdev->dev, "%s: route %s -> %s failed\n", __func__, sroute->src_widget->widget->name, sroute->sink_widget->widget->name); @@ -1789,7 +1788,7 @@ static int sof_ipc3_control_free(struct snd_sof_dev *sdev, struct snd_sof_contro fcomp.id = scontrol->comp_id; /* send IPC to the DSP */ - return sof_ipc_tx_message(sdev->ipc, &fcomp, sizeof(fcomp), NULL, 0); + return sof_ipc_tx_message_no_reply(sdev->ipc, &fcomp, sizeof(fcomp)); } /* send pcm params ipc */ @@ -1797,7 +1796,6 @@ static int sof_ipc3_keyword_detect_pcm_params(struct snd_sof_widget *swidget, in { struct snd_soc_component *scomp = swidget->scomp; struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); - struct sof_ipc_pcm_params_reply ipc_params_reply; struct snd_pcm_hw_params *params; struct sof_ipc_pcm_params pcm; struct snd_sof_pcm *spcm; @@ -1841,8 +1839,7 @@ static int sof_ipc3_keyword_detect_pcm_params(struct snd_sof_widget *swidget, in } /* send IPC to the DSP */ - ret = sof_ipc_tx_message(sdev->ipc, &pcm, sizeof(pcm), - &ipc_params_reply, sizeof(ipc_params_reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &pcm, sizeof(pcm)); if (ret < 0) dev_err(scomp->dev, "%s: PCM params failed for %s\n", __func__, swidget->widget->name); @@ -1856,7 +1853,6 @@ static int sof_ipc3_keyword_detect_trigger(struct snd_sof_widget *swidget, int c struct snd_soc_component *scomp = swidget->scomp; struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); struct sof_ipc_stream stream; - struct sof_ipc_reply reply; int ret; /* set IPC stream params */ @@ -1865,7 +1861,7 @@ static int sof_ipc3_keyword_detect_trigger(struct snd_sof_widget *swidget, int c stream.comp_id = swidget->comp_id; /* send IPC to the DSP */ - ret = sof_ipc_tx_message(sdev->ipc, &stream, sizeof(stream), &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &stream, sizeof(stream)); if (ret < 0) dev_err(scomp->dev, "%s: Failed to trigger %s\n", __func__, swidget->widget->name); @@ -1982,7 +1978,6 @@ static int sof_ipc3_widget_bind_event(struct snd_soc_component *scomp, static int sof_ipc3_complete_pipeline(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) { struct sof_ipc_pipe_ready ready; - struct sof_ipc_reply reply; int ret; dev_dbg(sdev->dev, "tplg: complete pipeline %s id %d\n", @@ -1993,7 +1988,7 @@ static int sof_ipc3_complete_pipeline(struct snd_sof_dev *sdev, struct snd_sof_w ready.hdr.cmd = SOF_IPC_GLB_TPLG_MSG | SOF_IPC_TPLG_PIPE_COMPLETE; ready.comp_id = swidget->comp_id; - ret = sof_ipc_tx_message(sdev->ipc, &ready, sizeof(ready), &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &ready, sizeof(ready)); if (ret < 0) return ret; @@ -2009,7 +2004,6 @@ static int sof_ipc3_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget }, .id = swidget->comp_id, }; - struct sof_ipc_reply reply; int ret; if (!swidget->private) @@ -2029,8 +2023,7 @@ static int sof_ipc3_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget break; } - ret = sof_ipc_tx_message(sdev->ipc, &ipc_free, sizeof(ipc_free), - &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &ipc_free, sizeof(ipc_free)); if (ret < 0) dev_err(sdev->dev, "failed to free widget %s\n", swidget->widget->name); @@ -2044,7 +2037,6 @@ static int sof_ipc3_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget * struct snd_sof_dai *dai = swidget->private; struct sof_dai_private_data *private; struct sof_ipc_dai_config *config; - struct sof_ipc_reply reply; int ret = 0; if (!dai || !dai->private) { @@ -2118,8 +2110,7 @@ static int sof_ipc3_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget * /* only send the IPC if the widget is set up in the DSP */ if (swidget->use_count > 0) { - ret = sof_ipc_tx_message(sdev->ipc, config, config->hdr.size, - &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, config, config->hdr.size); if (ret < 0) dev_err(sdev->dev, "Failed to set dai config for %s\n", dai->name); @@ -2132,7 +2123,6 @@ static int sof_ipc3_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget * static int sof_ipc3_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) { - struct sof_ipc_comp_reply reply; int ret; if (!swidget->private) @@ -2146,8 +2136,7 @@ static int sof_ipc3_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget struct sof_dai_private_data *dai_data = dai->private; struct sof_ipc_comp *comp = &dai_data->comp_dai->comp; - ret = sof_ipc_tx_message(sdev->ipc, dai_data->comp_dai, - comp->hdr.size, &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, dai_data->comp_dai, comp->hdr.size); break; } case snd_soc_dapm_scheduler: @@ -2155,8 +2144,7 @@ static int sof_ipc3_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget struct sof_ipc_pipe_new *pipeline; pipeline = swidget->private; - ret = sof_ipc_tx_message(sdev->ipc, pipeline, sizeof(*pipeline), - &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, pipeline, sizeof(*pipeline)); break; } default: @@ -2164,8 +2152,7 @@ static int sof_ipc3_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget struct sof_ipc_cmd_hdr *hdr; hdr = swidget->private; - ret = sof_ipc_tx_message(sdev->ipc, swidget->private, hdr->size, - &reply, sizeof(reply)); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, swidget->private, hdr->size); break; } } diff --git a/sound/soc/sof/ipc3.c b/sound/soc/sof/ipc3.c index 4493bbd7faf1..c67767742093 100644 --- a/sound/soc/sof/ipc3.c +++ b/sound/soc/sof/ipc3.c @@ -1044,15 +1044,13 @@ static int sof_ipc3_set_core_state(struct snd_sof_dev *sdev, int core_idx, bool .hdr.size = sizeof(core_cfg), .hdr.cmd = SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CORE_ENABLE, }; - struct sof_ipc_reply reply; if (on) core_cfg.enable_mask = sdev->enabled_cores_mask | BIT(core_idx); else core_cfg.enable_mask = sdev->enabled_cores_mask & ~BIT(core_idx); - return sof_ipc3_tx_msg(sdev, &core_cfg, sizeof(core_cfg), - &reply, sizeof(reply), false); + return sof_ipc3_tx_msg(sdev, &core_cfg, sizeof(core_cfg), NULL, 0, false); } static int sof_ipc3_ctx_ipc(struct snd_sof_dev *sdev, int cmd) @@ -1061,11 +1059,9 @@ static int sof_ipc3_ctx_ipc(struct snd_sof_dev *sdev, int cmd) .hdr.size = sizeof(pm_ctx), .hdr.cmd = SOF_IPC_GLB_PM_MSG | cmd, }; - struct sof_ipc_reply reply; /* send ctx save ipc to dsp */ - return sof_ipc3_tx_msg(sdev, &pm_ctx, sizeof(pm_ctx), - &reply, sizeof(reply), false); + return sof_ipc3_tx_msg(sdev, &pm_ctx, sizeof(pm_ctx), NULL, 0, false); } static int sof_ipc3_ctx_save(struct snd_sof_dev *sdev) @@ -1081,7 +1077,6 @@ static int sof_ipc3_ctx_restore(struct snd_sof_dev *sdev) static int sof_ipc3_set_pm_gate(struct snd_sof_dev *sdev, u32 flags) { struct sof_ipc_pm_gate pm_gate; - struct sof_ipc_reply reply; memset(&pm_gate, 0, sizeof(pm_gate)); @@ -1091,8 +1086,7 @@ static int sof_ipc3_set_pm_gate(struct snd_sof_dev *sdev, u32 flags) pm_gate.flags = flags; /* send pm_gate ipc to dsp */ - return sof_ipc_tx_message_no_pm(sdev->ipc, &pm_gate, sizeof(pm_gate), - &reply, sizeof(reply)); + return sof_ipc_tx_message_no_pm_no_reply(sdev->ipc, &pm_gate, sizeof(pm_gate)); } static const struct sof_ipc_pm_ops ipc3_pm_ops = { diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c index a2cd21256e44..6a4c91ea47ed 100644 --- a/sound/soc/sof/ipc4-pcm.c +++ b/sound/soc/sof/ipc4-pcm.c @@ -39,7 +39,7 @@ static int sof_ipc4_set_multi_pipeline_state(struct snd_sof_dev *sdev, u32 state msg.data_size = ipc_size; msg.data_ptr = trigger_list; - return sof_ipc_tx_message(sdev->ipc, &msg, ipc_size, NULL, 0); + return sof_ipc_tx_message_no_reply(sdev->ipc, &msg, ipc_size); } int sof_ipc4_set_pipeline_state(struct snd_sof_dev *sdev, u32 id, u32 state) @@ -57,7 +57,7 @@ int sof_ipc4_set_pipeline_state(struct snd_sof_dev *sdev, u32 id, u32 state) msg.primary = primary; - return sof_ipc_tx_message(sdev->ipc, &msg, 0, NULL, 0); + return sof_ipc_tx_message_no_reply(sdev->ipc, &msg, 0); } EXPORT_SYMBOL(sof_ipc4_set_pipeline_state); @@ -272,7 +272,7 @@ static int sof_ipc4_chain_dma_trigger(struct snd_sof_dev *sdev, if (enable) msg.primary |= SOF_IPC4_GLB_CHAIN_DMA_ENABLE_MASK; - return sof_ipc_tx_message(sdev->ipc, &msg, 0, NULL, 0); + return sof_ipc_tx_message_no_reply(sdev->ipc, &msg, 0); } static int sof_ipc4_trigger_pipelines(struct snd_soc_component *component, diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index f493b4ff210b..059eebf0a687 100644 --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -2118,7 +2118,7 @@ static int sof_ipc4_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget msg->data_size = ipc_size; msg->data_ptr = ipc_data; - ret = sof_ipc_tx_message(sdev->ipc, msg, ipc_size, NULL, 0); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, msg, ipc_size); if (ret < 0) { dev_err(sdev->dev, "failed to create module %s\n", swidget->widget->name); @@ -2162,7 +2162,7 @@ static int sof_ipc4_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget msg.primary = header; - ret = sof_ipc_tx_message(sdev->ipc, &msg, 0, NULL, 0); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &msg, 0); if (ret < 0) dev_err(sdev->dev, "failed to free pipeline widget %s\n", swidget->widget->name); @@ -2320,7 +2320,7 @@ static int sof_ipc4_set_copier_sink_format(struct snd_sof_dev *sdev, msg.primary = header; msg.extension = extension; - return sof_ipc_tx_message(sdev->ipc, &msg, msg.data_size, NULL, 0); + return sof_ipc_tx_message_no_reply(sdev->ipc, &msg, msg.data_size); } static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route *sroute) @@ -2405,7 +2405,7 @@ static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route * msg.primary = header; msg.extension = extension; - ret = sof_ipc_tx_message(sdev->ipc, &msg, 0, NULL, 0); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &msg, 0); if (ret < 0) { dev_err(sdev->dev, "failed to bind modules %s:%d -> %s:%d\n", src_widget->widget->name, sroute->src_queue_id, @@ -2464,7 +2464,7 @@ static int sof_ipc4_route_free(struct snd_sof_dev *sdev, struct snd_sof_route *s msg.primary = header; msg.extension = extension; - ret = sof_ipc_tx_message(sdev->ipc, &msg, 0, NULL, 0); + ret = sof_ipc_tx_message_no_reply(sdev->ipc, &msg, 0); if (ret < 0) dev_err(sdev->dev, "failed to unbind modules %s:%d -> %s:%d\n", src_widget->widget->name, sroute->src_queue_id, diff --git a/sound/soc/sof/sof-client-ipc-flood-test.c b/sound/soc/sof/sof-client-ipc-flood-test.c index 4bdecd80248a..c0d6723aed59 100644 --- a/sound/soc/sof/sof-client-ipc-flood-test.c +++ b/sound/soc/sof/sof-client-ipc-flood-test.c @@ -64,7 +64,6 @@ static int sof_debug_ipc_flood_test(struct sof_client_dev *cdev, struct sof_ipc_flood_priv *priv = cdev->data; struct device *dev = &cdev->auxdev.dev; struct sof_ipc_cmd_hdr hdr; - struct sof_ipc_reply reply; u64 min_response_time = U64_MAX; ktime_t start, end, test_end; u64 avg_response_time = 0; @@ -84,7 +83,7 @@ static int sof_debug_ipc_flood_test(struct sof_client_dev *cdev, /* send test IPC's */ while (1) { start = ktime_get(); - ret = sof_client_ipc_tx_message(cdev, &hdr, &reply, sizeof(reply)); + ret = sof_client_ipc_tx_message_no_reply(cdev, &hdr); end = ktime_get(); if (ret < 0) diff --git a/sound/soc/sof/sof-client-probes-ipc3.c b/sound/soc/sof/sof-client-probes-ipc3.c index ef768db5f04d..5e8eb19582a8 100644 --- a/sound/soc/sof/sof-client-probes-ipc3.c +++ b/sound/soc/sof/sof-client-probes-ipc3.c @@ -65,7 +65,6 @@ static int ipc3_probes_init(struct sof_client_dev *cdev, u32 stream_tag, { struct sof_ipc_probe_dma_add_params *msg; size_t size = struct_size(msg, dma, 1); - struct sof_ipc_reply reply; int ret; msg = kmalloc(size, GFP_KERNEL); @@ -77,7 +76,7 @@ static int ipc3_probes_init(struct sof_client_dev *cdev, u32 stream_tag, msg->dma[0].stream_tag = stream_tag; msg->dma[0].dma_buffer_size = buffer_size; - ret = sof_client_ipc_tx_message(cdev, msg, &reply, sizeof(reply)); + ret = sof_client_ipc_tx_message_no_reply(cdev, msg); kfree(msg); return ret; } @@ -93,12 +92,11 @@ static int ipc3_probes_init(struct sof_client_dev *cdev, u32 stream_tag, static int ipc3_probes_deinit(struct sof_client_dev *cdev) { struct sof_ipc_cmd_hdr msg; - struct sof_ipc_reply reply; msg.size = sizeof(msg); msg.cmd = SOF_IPC_GLB_PROBE | SOF_IPC_PROBE_DEINIT; - return sof_client_ipc_tx_message(cdev, &msg, &reply, sizeof(reply)); + return sof_client_ipc_tx_message_no_reply(cdev, &msg); } static int ipc3_probes_info(struct sof_client_dev *cdev, unsigned int cmd, @@ -180,7 +178,6 @@ static int ipc3_probes_points_add(struct sof_client_dev *cdev, { struct sof_ipc_probe_point_add_params *msg; size_t size = struct_size(msg, desc, num_desc); - struct sof_ipc_reply reply; int ret; msg = kmalloc(size, GFP_KERNEL); @@ -191,7 +188,7 @@ static int ipc3_probes_points_add(struct sof_client_dev *cdev, msg->hdr.cmd = SOF_IPC_GLB_PROBE | SOF_IPC_PROBE_POINT_ADD; memcpy(&msg->desc[0], desc, size - sizeof(*msg)); - ret = sof_client_ipc_tx_message(cdev, msg, &reply, sizeof(reply)); + ret = sof_client_ipc_tx_message_no_reply(cdev, msg); kfree(msg); return ret; } @@ -211,7 +208,6 @@ static int ipc3_probes_points_remove(struct sof_client_dev *cdev, { struct sof_ipc_probe_point_remove_params *msg; size_t size = struct_size(msg, buffer_id, num_buffer_id); - struct sof_ipc_reply reply; int ret; msg = kmalloc(size, GFP_KERNEL); @@ -222,7 +218,7 @@ static int ipc3_probes_points_remove(struct sof_client_dev *cdev, msg->hdr.cmd = SOF_IPC_GLB_PROBE | SOF_IPC_PROBE_POINT_REMOVE; memcpy(&msg->buffer_id[0], buffer_id, size - sizeof(*msg)); - ret = sof_client_ipc_tx_message(cdev, msg, &reply, sizeof(reply)); + ret = sof_client_ipc_tx_message_no_reply(cdev, msg); kfree(msg); return ret; } diff --git a/sound/soc/sof/sof-client-probes-ipc4.c b/sound/soc/sof/sof-client-probes-ipc4.c index 66fa7c2f390a..ea21ef176c42 100644 --- a/sound/soc/sof/sof-client-probes-ipc4.c +++ b/sound/soc/sof/sof-client-probes-ipc4.c @@ -129,7 +129,7 @@ static int ipc4_probes_init(struct sof_client_dev *cdev, u32 stream_tag, msg.data_size = sizeof(cfg); msg.data_ptr = &cfg; - return sof_client_ipc_tx_message(cdev, &msg, NULL, 0); + return sof_client_ipc_tx_message_no_reply(cdev, &msg); } /** @@ -156,7 +156,7 @@ static int ipc4_probes_deinit(struct sof_client_dev *cdev) msg.data_size = 0; msg.data_ptr = NULL; - return sof_client_ipc_tx_message(cdev, &msg, NULL, 0); + return sof_client_ipc_tx_message_no_reply(cdev, &msg); } /**