Message ID | 20200327163654.13389-4-sudeep.holla@arm.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 8aa6e12bbf9dd6cf1ebf2aad7b09389863a4c2c6 |
Headers | show |
Series | firmware: arm_scmi: Extend SMC/HVC to support multiple channels | expand |
> Subject: [PATCH 3/4] firmware: arm_scmi: Check shmem property for channel > availablity > > Instead of declaring the channel availabilty unconditionally, let us check for > the presence of "shmem" property and return the channel availablity > accordingly. > > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> > --- > drivers/firmware/arm_scmi/smc.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/firmware/arm_scmi/smc.c > b/drivers/firmware/arm_scmi/smc.c index dd4b54c29679..5929c668dc1d > 100644 > --- a/drivers/firmware/arm_scmi/smc.c > +++ b/drivers/firmware/arm_scmi/smc.c > @@ -33,6 +33,11 @@ struct scmi_smc { > > static bool smc_chan_available(struct device *dev, int idx) { > + struct device_node *np = of_parse_phandle(dev->of_node, "shmem", 0); > + if (!np) > + return false; > + > + of_node_put(np); > return true; > } This is global shared mem:) Reviewed-by: Peng Fan <peng.fan@nxp.com> > > -- > 2.17.1
On Wed, Apr 01, 2020 at 01:15:08AM +0000, Peng Fan wrote: > > Subject: [PATCH 3/4] firmware: arm_scmi: Check shmem property for channel > > availablity > > > > Instead of declaring the channel availabilty unconditionally, let us check for > > the presence of "shmem" property and return the channel availablity > > accordingly. > > > > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> > > --- > > drivers/firmware/arm_scmi/smc.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/firmware/arm_scmi/smc.c > > b/drivers/firmware/arm_scmi/smc.c index dd4b54c29679..5929c668dc1d > > 100644 > > --- a/drivers/firmware/arm_scmi/smc.c > > +++ b/drivers/firmware/arm_scmi/smc.c > > @@ -33,6 +33,11 @@ struct scmi_smc { > > > > static bool smc_chan_available(struct device *dev, int idx) { > > + struct device_node *np = of_parse_phandle(dev->of_node, "shmem", 0); > > + if (!np) > > + return false; > > + > > + of_node_put(np); > > return true; > > } > > This is global shared mem:) > No, the dev pointer is not the parent node here but the child devices unless I am reading it wrong. But yes global for the base protocol :) > Reviewed-by: Peng Fan <peng.fan@nxp.com> > Thanks for this and other patches too. -- Regards, Sudeep
diff --git a/drivers/firmware/arm_scmi/smc.c b/drivers/firmware/arm_scmi/smc.c index dd4b54c29679..5929c668dc1d 100644 --- a/drivers/firmware/arm_scmi/smc.c +++ b/drivers/firmware/arm_scmi/smc.c @@ -33,6 +33,11 @@ struct scmi_smc { static bool smc_chan_available(struct device *dev, int idx) { + struct device_node *np = of_parse_phandle(dev->of_node, "shmem", 0); + if (!np) + return false; + + of_node_put(np); return true; }
Instead of declaring the channel availabilty unconditionally, let us check for the presence of "shmem" property and return the channel availablity accordingly. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> --- drivers/firmware/arm_scmi/smc.c | 5 +++++ 1 file changed, 5 insertions(+)