From patchwork Mon Oct 21 17:07:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 13844466 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 13541D0E6C5 for ; Mon, 21 Oct 2024 17:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p6UAOx93vU1E6oQjTS3iTY8r99GdbFUd3UbC4e/RDJ8=; b=r/aBF+J0kpG647oaCMAtCwpbgl Hhlom0kMHcgZ4ZfnwK47E+pTzaKZQ3ECN9survZvp2cbcI9pnb1SgPqct3qEnaJ7B+95rhFNjM+MS y+b0PLmEFa7O8WIXYE+qcPcJp72D/HkbRgr9aLbhPk6BvlTiT4muu9jdDoziclXyCqF+IvW2NBohg SzMVBlpHeLn8WDJBwMDfeS9Q5y6bqfEtcjY2/ub0sIf71bHxgRJGpmvMmlCDTPqhPcelrRh2L2O+0 UgTgQ1/wUZMwUohvx2RYayLL1qGnGQmIhLmIKulsqkA7aN7A6SxqVP3oKXbRsLoOOLHzm/VSU9dpZ I8bC2E9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2vyf-000000085EB-0e8u; Mon, 21 Oct 2024 17:13:57 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2vsw-000000084AU-0dOC for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2024 17:08:03 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6A87EFEC; Mon, 21 Oct 2024 10:08:31 -0700 (PDT) Received: from pluto.fritz.box (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DC3F53F528; Mon, 21 Oct 2024 10:07:59 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, etienne.carriere@st.com, peng.fan@oss.nxp.com, michal.simek@amd.com, quic_sibis@quicinc.com, quic_nkela@quicinc.com, dan.carpenter@linaro.org, Cristian Marussi Subject: [PATCH v2 4/5] firmware: arm_scmi: Use max_msg and max_msg_size devicetree properties Date: Mon, 21 Oct 2024 18:07:25 +0100 Message-ID: <20241021170726.2564329-5-cristian.marussi@arm.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241021170726.2564329-1-cristian.marussi@arm.com> References: <20241021170726.2564329-1-cristian.marussi@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_100802_257456_3E6D97EE X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Override the default built-in max_msg and max_msg_size transport properties when the corresponding properties were found to be described in the devicetree. Signed-off-by: Cristian Marussi --- v1 --> v2 - using new prefixed arm, properties --- drivers/firmware/arm_scmi/driver.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 015a4d52ae37..b9a1d8c1034f 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -3056,8 +3056,20 @@ static const struct scmi_desc *scmi_transport_setup(struct device *dev) if (ret && ret != -EINVAL) dev_err(dev, "Malformed max-rx-timeout-ms DT property.\n"); - dev_info(dev, "SCMI max-rx-timeout: %dms\n", - trans->desc->max_rx_timeout_ms); + ret = of_property_read_u32(dev->of_node, "arm,max-msg-size", + &trans->desc->max_msg_size); + if (ret && ret != -EINVAL) + dev_err(dev, "Malformed arm,max-msg-size DT property.\n"); + + ret = of_property_read_u32(dev->of_node, "arm,max-msg", + &trans->desc->max_msg); + if (ret && ret != -EINVAL) + dev_err(dev, "Malformed arm,max-msg DT property.\n"); + + dev_info(dev, + "SCMI max-rx-timeout: %dms / max-msg-size: %dbytes / max-msg: %d\n", + trans->desc->max_rx_timeout_ms, trans->desc->max_msg_size, + trans->desc->max_msg); return trans->desc; }