[PATCH v1 5/6] firmware: arm_scmi: Use max_msg and max_msg_size from devicetree

Cristian Marussi posted 6 patches 1 year, 4 months ago
[PATCH v1 5/6] firmware: arm_scmi: Use max_msg and max_msg_size from devicetree
Posted by Cristian Marussi 1 year, 4 months ago
Override max_msg and max_msg_size transport properties when corresponding
devicetree properties are available.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 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 e7dab0eea540..8295e63be38e 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -2986,8 +2986,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, "max-msg-size",
+				   &trans->desc->max_msg_size);
+	if (ret && ret != -EINVAL)
+		dev_err(dev, "Malformed max-msg-size DT property.\n");
+
+	ret = of_property_read_u32(dev->of_node, "max-msg",
+				   &trans->desc->max_msg);
+	if (ret && ret != -EINVAL)
+		dev_err(dev, "Malformed 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;
 }
-- 
2.45.2
Re: [PATCH v1 5/6] firmware: arm_scmi: Use max_msg and max_msg_size from devicetree
Posted by Sudeep Holla 1 year, 4 months ago
On Tue, Jul 30, 2024 at 03:47:06PM +0100, Cristian Marussi wrote:
> Override max_msg and max_msg_size transport properties when corresponding
> devicetree properties are available.
>

I am holding off on these changes to think how these max_msg and max_msg_size
can be used without breaking any platforms allowing space for the header
and the message itself which is around 28 bytes. The binding itself looks
good. We may have to adjust the value passed to the core driver taking
the above into consideration.

--
Regards,
Sudeep
Re: [PATCH v1 5/6] firmware: arm_scmi: Use max_msg and max_msg_size from devicetree
Posted by Nikunj Kela 1 year, 3 months ago
On 8/20/2024 7:48 AM, Sudeep Holla wrote:
> On Tue, Jul 30, 2024 at 03:47:06PM +0100, Cristian Marussi wrote:
>> Override max_msg and max_msg_size transport properties when corresponding
>> devicetree properties are available.
>>
> I am holding off on these changes to think how these max_msg and max_msg_size
> can be used without breaking any platforms allowing space for the header
> and the message itself which is around 28 bytes. The binding itself looks
> good. We may have to adjust the value passed to the core driver taking
> the above into consideration.
>
> --
> Regards,
> Sudeep

Hi Sudeep,

Qualcomm is interested in these parameters being configurable. Just
wanted to make sure you are aware.

Thanks,

-Nikunj
Re: [PATCH v1 5/6] firmware: arm_scmi: Use max_msg and max_msg_size from devicetree
Posted by Cristian Marussi 1 year, 3 months ago
On Thu, Sep 12, 2024 at 12:22:48PM -0700, Nikunj Kela wrote:
> 
> On 8/20/2024 7:48 AM, Sudeep Holla wrote:
> > On Tue, Jul 30, 2024 at 03:47:06PM +0100, Cristian Marussi wrote:
> >> Override max_msg and max_msg_size transport properties when corresponding
> >> devicetree properties are available.
> >>
> > I am holding off on these changes to think how these max_msg and max_msg_size
> > can be used without breaking any platforms allowing space for the header
> > and the message itself which is around 28 bytes. The binding itself looks
> > good. We may have to adjust the value passed to the core driver taking
> > the above into consideration.
> >
> > --
> > Regards,
> > Sudeep
> 

Hi Nikunj,

these additional patches of initial series was still not reviewed by DT
maintainers really and it needed some rework for the reason Sudeep
mmentioned above. This is in my soon-ish todo list :P

Thanks,
Cristian