2020-02-06 13:08:22

by Peng Fan

[permalink] [raw]
Subject: [PATCH 1/2] firmware: arm_scmi: mailbox: share shmem for protocols

From: Peng Fan <[email protected]>

When shmem property of protocol is not specificed, let it use
its parent's shmem property.

Signed-off-by: Peng Fan <[email protected]>
---

Based on Viresh's V6 patchset.

drivers/firmware/arm_scmi/mailbox.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c
index 73077bbc4ad9..68ed58e2a47a 100644
--- a/drivers/firmware/arm_scmi/mailbox.c
+++ b/drivers/firmware/arm_scmi/mailbox.c
@@ -69,6 +69,8 @@ static int mailbox_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
return -ENOMEM;

shmem = of_parse_phandle(cdev->of_node, "shmem", idx);
+ if (!shmem)
+ shmem = of_parse_phandle(dev->of_node, "shmem", idx);
ret = of_address_to_resource(shmem, 0, &res);
of_node_put(shmem);
if (ret) {
--
2.16.4


2020-02-06 15:57:56

by Sudeep Holla

[permalink] [raw]
Subject: Re: [PATCH 1/2] firmware: arm_scmi: mailbox: share shmem for protocols

On Thu, Feb 06, 2020 at 08:59:25PM +0800, [email protected] wrote:
> From: Peng Fan <[email protected]>
>
> When shmem property of protocol is not specificed, let it use
> its parent's shmem property.

I had replied already to the thread without ALKML you had sent earlier,
please refer them.

--
Regards,
Sudeep

2020-02-07 02:09:46

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH 1/2] firmware: arm_scmi: mailbox: share shmem for protocols

> Subject: Re: [PATCH 1/2] firmware: arm_scmi: mailbox: share shmem for
> protocols
>
> On Thu, Feb 06, 2020 at 08:57:25PM +0800, [email protected] wrote:
> > From: Peng Fan <[email protected]>
> >
> > When shmem property of protocol is not specificed, let it use its
> > parent's shmem property.
> >
>

+arm list

> Why do you even need this ? If shmem property of protocol is not specified
> then why is the mailbox property ? Either you need both or none. I don't see
> the point of this patch. I am interested to know how are you even hitting this
> case.

Without this patch, I need add shmem property in each protocol node.
With this patch, I only need to add shmem property in scmi node.

In mailbox_chan_setup, cdev is protocol device, input parameter device
is the parent, saying scmi device.

>
> If you don't have mailbox property, then chan_available is false and hence we
> don't call chan_setup.

chan_avilable only parse mbox properties, not shmem.

Regards,
Peng.

>
> --
> Regards,
> Sudeep