All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Cristian Marussi <cristian.marussi@arm.com>,
	Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 0/1] dt-bindings: arm: Add scmi_devid paramter for
Date: Fri, 4 Mar 2022 11:21:59 +0000	[thread overview]
Message-ID: <YiH2V5pJs4vvsdn2@bogus> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2202241415180.239973@ubuntu-linux-20-04-desktop>

On Thu, Feb 24, 2022 at 02:22:28PM -0800, Stefano Stabellini wrote:
> On Thu, 24 Feb 2022, Cristian Marussi wrote:
> > On Wed, Feb 23, 2022 at 06:51:59PM -0800, Stefano Stabellini wrote:
> > > On Tue, 22 Feb 2022, Oleksii Moisieiev wrote:
> > > > On Tue, Feb 22, 2022 at 04:14:40PM +0000, Sudeep Holla wrote:
> > > > > On Tue, Feb 22, 2022 at 09:06:25AM +0100, Krzysztof Kozlowski wrote:
> > > > > > On 21/02/2022 22:39, Oleksii Moisieiev wrote:
> > > > > > > Hi Krzysztof,
> > > > > > > 
> > 
> > Hi Stefano,
> > 
> > > > > > > On Mon, Feb 21, 2022 at 10:01:43PM +0100, Krzysztof Kozlowski wrote:
> > > > > > >> On 21/02/2022 18:26, Oleksii Moisieiev wrote:
> > > > > > >>> Introducing new parameter called scmi_devid to the device-tree bindings.
> > > > > > >>> This parameter should be set for the device nodes, which has
> > > > > > >>> clocks/power-domains/resets working through SCMI.
> > > > > > >>> Given parameter should set the device_id, needed to set device
> > > > > > >>> permissions in the Firmware. This feature will be extremely useful for
> > > > > > >>> the virtualized systems, which has more that one Guests running on the
> > > > > > >>> system at the same time or for the syestems, which require several
> > > > > > >>> agents with different permissions. Trusted agent will use scmi_devid to
> > > > > > >>> set the Device permissions for the Firmware (See Section 4.2.2.10 [0]
> > > > > > >>> for details).
> > > > > > >>> Agents concept is described in Section 4.2.1 [0].
> > > > > > >>>
> > > > > > >>> scmi_devid in Device-tree node example:
> > > > > > >>> usb@e6590000
> > > > > > >>> {
> > > > > > >>>     scmi_devid = <19>;
> > > > > > >>>     clocks = <&scmi_clock 3>, <&scmi_clock 2>;
> > > > > > >>>     resets = <&scmi_reset 10>, <&scmi_reset 9>;
> > > > > > >>>     power-domains = <&scmi_power 0>;
> > > > > > >>> };
> > > > > > >>
> > > > > > >> And how do you prevent DT overlay adding such devid to any other node
> > > > > > >> thus allowing any other device to send requests with given devid?
> > > > > > >>
> > > > > > > Thank you for the quick response.
> > > > > > > scmi_devid value will be used only by Trusted Agent when the device
> > > > > > > permissions are set. Non-trusted agents, which in our case are
> > > > > > > represented as Guest OS are using scmi drivers, already present in linux
> > > > > > > kernel, ignores scmi_devid and uses scmi_clocks, scmi_power, scmi_reset
> > > > > > > nodes to access to SCMI protocol.
> > > > > > 
> > > > > > Ah, ok.
> > > > > > 
> > > > > > > 
> > > > > > >> Plus few technicalities:
> > > > > > >> 1. Hyphen, not underscore in property name, so scmi-devid.
> > > > > > > 
> > > > > > > Thanks for the tip, I will change that in v2.
> > > > > > 
> > > > > > Few more thoughts:
> > > > > > 1. This looks specific to ARM SCMI, so you also need vendor prefix, so
> > > > > > something like:
> > > > > > arm,scmi-devid
> > > > > > arm,scmi-device-id
> > > > > > 
> > > > > 
> > > > > Keeping the other discussion separate, I wanted to comment on this.
> > > > > I agree with Krzysztof on having vendor specific prefix if we decide to add
> > > > > this device id thing. However, I prefer not to use "arm,scmi-" here.
> > > > > It can be "xen,scmi-" as we had plans to introduce some concepts in SCMI
> > > > > spec that may use looks like this device-id. I would just like to avoid
> > > > > conflicting with that in the future. It may happen to be same in the future
> > > > > (i.e. this xen device-id matches 100% with definition of device-id we might
> > > > > introduce in the spec, but I want to make assumption otherwise and leave
> > > > > scope for divergence however small/little it can be). No issues even if
> > > > > they converge and match 100% later in the far future.
> > > > > 
> > > > 
> > > > xem,scmi- works for me. What do other thinks?
> > >   ^ xen,scmi-
> > > 
> > > If this problem was Xen specific, then it would be fine to use xen,scmi-
> > > As Xen developer, it solves my problem and I am fine with it.
> > > 
> > > However, from a device tree and SCMI point of view, it looks like this
> > > problem is generic and it just happens that Xen is the first
> > > implementation to encounter it.
> > > 
> > > Cristian wrote: "The SCMI spec does not indeed cover the discovery of
> > > such devices and the related associated resources: it indeed delegates
> > > such description to FDT/ACPI as of now." How is that supposed to happen
> > > today with the current DT definitions, regardless of Xen? Is it a gap in
> > > the current device tree binding?
> > 
> > What I meant is that in fact SCMI device IDs are NOT needed in the Linux
> > Kernel DT, in fact also this series does not add any code using it and
> > there is no code as of now in Kernel to issue BASE_SET_DEVICE_PERMISSIONS
> > commands; Linux Guest OS in the above scenario is a Non-Trusted agent and
> > doesn't need to know SCMI DevIDs and must NOT have access to those IDs for
> > security reasons too (as Sudeep was saying): the Trusted Agent (XEN here)
> > and the SCMI platform server are the only ones required to share the
> > knowledge of such Device IDs (and how the related resources are grouped)
> > via some HW description scheme as you are doing indeed in XEN.
> > 
> > So, while on one side such device IDs discovery is delegated by the spec
> > to the HW description mechanisms, it seems just not needed in Kernel DT
> > given the kind or role it has as an SCMI agent in this context: as said
> > in fact there won't be any use as of now in Linux of such DT entries as
> > of now.
> 
> I see. This is one of those "difficult" cases where the device tree
> binding is needed but it is not used by the Linux kernel. (We have a few
> cases like this in system device tree and the more device tree gets
> adopted by other projects the more will see instances like this one.)
>

Indeed, I mentioned this in the other email. It clearly falls under the
larger umbrella of system device tree and not the one used by the Linux.

> In that case, I think it is OK to call it "xen,scmi-" if Rob also
> agrees.
>

Thanks.

> After all, we are currently using in Xen a property called
> "linux,pci-domain". We might as well have Linux in the future use a
> property called "xen,scmi-devid" to even things out :-)

Sure or we may add a generic one in the future as mentioned in the other
email for reasons mentioned there.

--
Regards,
Sudeep

  parent reply	other threads:[~2022-03-04 11:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 17:26 [RFC PATCH 0/1] dt-bindings: arm: Add scmi_devid paramter for Oleksii Moisieiev
2022-02-21 17:26 ` [RFC PATCH 1/1] dt-bindings: arm: Add scmi_devid property description for SCMI Oleksii Moisieiev
2022-02-22 14:22   ` Rob Herring
2022-02-22 14:51     ` Oleksii Moisieiev
2022-02-22 18:25       ` Rob Herring
2022-02-21 21:01 ` [RFC PATCH 0/1] dt-bindings: arm: Add scmi_devid paramter for Krzysztof Kozlowski
2022-02-21 21:39   ` Oleksii Moisieiev
2022-02-22  8:06     ` Krzysztof Kozlowski
2022-02-22  8:55       ` Oleksii Moisieiev
2022-02-22  9:27         ` Krzysztof Kozlowski
2022-02-22 10:30           ` Oleksii Moisieiev
2022-02-22 11:16             ` Krzysztof Kozlowski
2022-02-22 13:54               ` Oleksii Moisieiev
2022-02-22 16:14       ` Sudeep Holla
2022-02-22 17:34         ` Oleksii Moisieiev
2022-02-24  2:51           ` Stefano Stabellini
2022-02-24  9:32             ` Cristian Marussi
2022-02-24 22:22               ` Stefano Stabellini
2022-03-01 14:55                 ` Oleksii Moisieiev
2022-03-04 11:21                 ` Sudeep Holla [this message]
2022-03-04 11:18             ` Sudeep Holla
2022-02-22 11:00 ` Cristian Marussi
2022-02-22 13:51   ` Oleksii Moisieiev
2022-02-22 16:06   ` Sudeep Holla
2022-02-22 17:15     ` Oleksii Moisieiev
2022-02-24 11:54       ` Sudeep Holla
2022-02-24 22:51         ` Stefano Stabellini
2022-02-24 23:34           ` Stefano Stabellini
2022-03-04 11:12             ` Sudeep Holla
2022-03-05  0:45               ` Stefano Stabellini
2022-04-29 21:46                 ` Rob Herring
2022-03-01 16:10           ` Oleksii Moisieiev
2022-03-01 16:05         ` Oleksii Moisieiev

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=YiH2V5pJs4vvsdn2@bogus \
    --to=sudeep.holla@arm.com \
    --cc=Oleksii_Moisieiev@epam.com \
    --cc=cristian.marussi@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sstabellini@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.