From patchwork Wed Mar 30 20:19:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 555124 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 51D98C433EF for ; Wed, 30 Mar 2022 20:22:03 +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 946BE1ACB; Wed, 30 Mar 2022 22:21:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 946BE1ACB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648671721; bh=219w+WAhFOLOTuSWfHn8ygxlqsJUkzHLHdtOW7b9fFY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=srRJ4pIgzOU14UehmHElPv3GBzvMv6F7k4Lq/Dwbheutsf4PbX+vAtUt9/M+euz8N I9jdzM7wkPrycKz9mKpSSyabqOFk3SbVLoNDOgkW85FySPhfvpYVXjnCK/GUm8y0Ye 78/2KmxP1e+wXnIAoA99ATjGFQeM9EtxdB8yMaGo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C13F5F80524; Wed, 30 Mar 2022 22:19:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 36E5CF80254; Wed, 30 Mar 2022 22:19:51 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 97B37F8025A for ; Wed, 30 Mar 2022 22:19:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 97B37F8025A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="clJh/wdM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648671583; x=1680207583; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=219w+WAhFOLOTuSWfHn8ygxlqsJUkzHLHdtOW7b9fFY=; b=clJh/wdMRyXQjfmQJF9SbP6ANPLMBOk1D94EKByMkqmmJvtOb65F5+he bn8WE25R1nJ2co54BheGPc+ZHUug6QeJVb9Y57cUOuXTdQgOquVw8w6F0 AtDGj0GwGbAQqW/B6P0iuABRWxPm0D1Z7prFs22RfeK/pJwIv55350Kc/ VoCK/2AYlpX20ufQRhkHbEyT4jMhDBBcFzgGOf8WqGRWLqUtfozMxiLus E0emZj/Y0Z0x0SGjdRrl1oCQCnq4jRXwYLXs6pzmLgsLUvGImy8sldP8M i2P3Sl+azK4b//JEM+nD77QZapIjOyAqpxozBt4mpnkS5umdWl98W3SOT g==; X-IronPort-AV: E=McAfee;i="6200,9189,10302"; a="322819826" X-IronPort-AV: E=Sophos;i="5.90,223,1643702400"; d="scan'208";a="322819826" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 13:19:36 -0700 X-IronPort-AV: E=Sophos;i="5.90,223,1643702400"; d="scan'208";a="522045022" Received: from ggunnam-mobl.amr.corp.intel.com (HELO rsridh2-mobl1.localdomain) ([10.254.28.195]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 13:19:36 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Subject: [PATCH 03/11] ASoC: SOF: ipc: Add max_payload_size field in struct snd_sof_ipc Date: Wed, 30 Mar 2022 13:19:18 -0700 Message-Id: <20220330201926.1330402-4-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220330201926.1330402-1-ranjani.sridharan@linux.intel.com> References: <20220330201926.1330402-1-ranjani.sridharan@linux.intel.com> MIME-Version: 1.0 Cc: Daniel Baluta , Kai Vehmanen , tiwai@suse.de, Peter Ujfalusi , Pierre-Louis Bossart , Rander Wang , broonie@kernel.org, Ranjani Sridharan , Bard Liao 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" From: Peter Ujfalusi The max_payload_size is an IPC level constraint. Add a new field, max_payload_size to struct snd_sof_ipc and set it during IPC init. Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan --- sound/soc/sof/ipc.c | 2 ++ sound/soc/sof/sof-priv.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index 5f5753608c79..af2efc1c8436 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -1005,6 +1005,8 @@ int sof_ipc_init_msg_memory(struct snd_sof_dev *sdev) if (!msg->reply_data) return -ENOMEM; + sdev->ipc->max_payload_size = SOF_IPC_MSG_MAX_SIZE; + return 0; } diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index 93de5547b952..f75c6f76297e 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -394,6 +394,9 @@ struct snd_sof_ipc { /* disables further sending of ipc's */ bool disable_ipc_tx; + /* Maximum allowed size of a single IPC message/reply */ + size_t max_payload_size; + struct snd_sof_ipc_msg msg; /* IPC ops based on version */