linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Etienne Carriere <etienne.carriere@linaro.org>,
	"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	 Cristian Marussi <cristian.marussi@arm.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Jim Quinlan <jim2101024@gmail.com>
Subject: Re: [PATCH 2/2] firmware: arm_scmi: Add compatibility checks for shmem node
Date: Thu, 3 Jun 2021 18:45:08 +0100	[thread overview]
Message-ID: <20210603174508.4t7l2tidmrtxlsft@bogus> (raw)
In-Reply-To: <be7b6bed-02db-d283-6140-313fea6c4cd1@gmail.com>

On Thu, Jun 03, 2021 at 10:20:32AM -0700, Florian Fainelli wrote:
> On 6/3/21 10:18 AM, Florian Fainelli wrote:
> > On 6/2/21 12:53 AM, Sudeep Holla wrote:
> >> On Wed, Jun 02, 2021 at 09:44:40AM +0200, Etienne Carriere wrote:
> >>> On Wed, 2 Jun 2021 at 09:37, Sudeep Holla <sudeep.holla@arm.com> wrote:
> >>>>
> >>>> On Wed, Jun 02, 2021 at 09:33:03AM +0200, Etienne Carriere wrote:
> >>>>> Hello Sudeep,
> >>>>>
> >>>>>
> >>>>> On Wed, 2 Jun 2021 at 00:51, Sudeep Holla <sudeep.holla@arm.com> wrote:
> >>>>>>
> >>>>>> The shared memory node used for communication between the firmware and
> >>>>>> the OS should be compatible with "arm,scmi-shmem". Add the check for the
> >>>>>> same while parsing the node before fetching the memory regions.
> >>>>>>
> >>>>>> Cc: Cristian Marussi <cristian.marussi@arm.com>
> >>>>>> Cc: Florian Fainelli <f.fainelli@gmail.com>
> >>>>>> Cc: Jim Quinlan <jim2101024@gmail.com>
> >>>>>> Cc: Etienne Carriere <etienne.carriere@linaro.org>
> >>>>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> >>>>>> ---
> >>>>>>  drivers/firmware/arm_scmi/mailbox.c | 3 +++
> >>>>>>  drivers/firmware/arm_scmi/smc.c     | 3 +++
> >>>>>>  2 files changed, 6 insertions(+)
> >>>>>>
> >>>>>> diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c
> >>>>>> index 4626404be541..e3dcb58314ae 100644
> >>>>>> --- a/drivers/firmware/arm_scmi/mailbox.c
> >>>>>> +++ b/drivers/firmware/arm_scmi/mailbox.c
> >>>>>> @@ -69,6 +69,9 @@ 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 (!of_device_is_compatible(shmem, "arm,scmi-shmem"))
> >>>>>> +               return -ENXIO;
> >>>>>
> >>>>> Before this change, one could use another type of memory node, like "mmio-sram".
> >>>>> Is there a strong reason to enforce use of "arm,scmi-shmem" nodes?
> >>>>>
> >>>>
> >>>> No that is for the entire SRAM which still holds and generic on-chip SRAM
> >>>> driver will take care of that, this is only for the subsections that is
> >>>> reserved for the scp shmem. The binding has been always there, just the
> >>>> missing check. When I move to yaml, I realised that and hence the
> >>>> addition of check.
> >>>
> >>> Ok, I understand. True the binding was there but only in the DTS
> >>> examples snipped.
> >>> This constraint on the compatible property of the shmem node should be
> >>> clearly stated in the yaml I think.
> >>>
> >>
> >> Was this missing in your DTS files ? Just curious.
> >>
> > 
> > FWIW, our legacy DTs would have the following:
> > 
> > 	reserved-memory {
> >                 /* This is a placeholder */
> >                 NWMBOX: NWMBOX {
> >                 };
> >         };
> > 
> >        brcm_scmi: brcm_scmi@0 {
> >                 compatible = "arm,scmi-smc", "arm,scmi";
> >                 mboxes = <&brcm_scmi_mailbox 0>, <&brcm_scmi_mailbox 1>;
> >                 mbox-names = "tx", "rx";
> >                 shmem = <&NWMBOX>;
> >                 status = "disabled";
> > 
> > so while we have since switched to the SMC transport, the shared memory
> > still does not have an "arm,scmi-shmem" compatible string, and this is a
> > relatively new thing, so I am not sure we can enforce that just yet?
> 
> Sorry, I incorrectly browsed the binding history, this is not a new
> requirement,  will make sure we fix it at our end, too.

Indeed, I cross checked that when I hit the issue on Juno yesterday.
Anyways this version has build issues, was sent by mistake. I have resend
the correct ones later[1]

-- 
Regards,
Sudeep

[1] https://lore.kernel.org/r/20210602073851.1005607-2-sudeep.holla@arm.com/

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-03 17:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 22:51 [PATCH 1/2] firmware: arm_scpi: Add compatibility checks for shmem node Sudeep Holla
2021-06-01 22:51 ` [PATCH 2/2] firmware: arm_scmi: " Sudeep Holla
2021-06-02  7:29   ` Sudeep Holla
2021-06-02  7:33   ` Etienne Carriere
2021-06-02  7:36     ` Sudeep Holla
2021-06-02  7:44       ` Etienne Carriere
2021-06-02  7:53         ` Sudeep Holla
2021-06-03 17:18           ` Florian Fainelli
2021-06-03 17:20             ` Florian Fainelli
2021-06-03 17:45               ` Sudeep Holla [this message]
2021-06-03 17:42             ` Sudeep Holla
2021-06-03 18:19           ` Etienne Carriere
2021-06-04  9:13             ` Sudeep Holla
2021-06-02  7:27 ` [PATCH 1/2] firmware: arm_scpi: " Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210603174508.4t7l2tidmrtxlsft@bogus \
    --to=sudeep.holla@arm.com \
    --cc=cristian.marussi@arm.com \
    --cc=etienne.carriere@linaro.org \
    --cc=f.fainelli@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=jim2101024@gmail.com \
    --cc=khilman@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=narmstrong@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).