Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1481207 > unrolled thread
| Started by | Sebastian Frias <sf84@laposte.net> |
|---|---|
| First post | 2016-09-12 14:30 +0200 |
| Last post | 2016-09-14 10:30 +0200 |
| Articles | 20 on this page of 25 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: ARM,SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-12 14:30 +0200
Re: ARM,SoC: About the use DT-defined properties by 3rd-party drivers Mark Rutland <mark.rutland@arm.com> - 2016-09-12 14:40 +0200
Re: ARM,SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-12 15:20 +0200
Re: ARM,SoC: About the use DT-defined properties by 3rd-party drivers Timur Tabi <timur@tabi.org> - 2016-09-12 15:30 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Mark Rutland <mark.rutland@arm.com> - 2016-09-12 16:10 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Warner Losh <imp@bsdimp.com> - 2016-09-12 16:30 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-12 18:30 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Warner Losh <imp@bsdimp.com> - 2016-09-12 18:50 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Timur Tabi <timur@tabi.org> - 2016-09-12 18:50 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Mark Rutland <mark.rutland@arm.com> - 2016-09-12 19:10 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Mark Rutland <mark.rutland@arm.com> - 2016-09-12 19:50 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-12 18:10 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-12 18:30 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Timur Tabi <timur@tabi.org> - 2016-09-12 18:30 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Mark Rutland <mark.rutland@arm.com> - 2016-09-12 19:00 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-13 12:10 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Timur Tabi <timur@tabi.org> - 2016-09-13 13:40 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Mark Rutland <mark.rutland@arm.com> - 2016-09-13 15:30 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Mark Rutland <mark.rutland@arm.com> - 2016-09-13 15:20 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-13 16:30 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Mark Rutland <mark.rutland@arm.com> - 2016-09-13 17:00 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-14 10:40 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-13 17:00 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Mark Rutland <mark.rutland@arm.com> - 2016-09-13 17:50 +0200
Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers Sebastian Frias <sf84@laposte.net> - 2016-09-14 10:30 +0200
Page 1 of 2 [1] 2 Next page →
| From | Sebastian Frias <sf84@laposte.net> |
|---|---|
| Date | 2016-09-12 14:30 +0200 |
| Subject | Re: ARM,SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgyx3-3fQ-1@gated-at.bofh.it> |
Hi Timur, On 08/28/2016 10:36 PM, Timur Tabi wrote: > On Wed, Aug 24, 2016 at 9:29 AM, Sebastian Frias <sf84@laposte.net> wrote: >> >> If this is really not possible, it forces the SoC manufacturer to expose >> those properties in a different way, thus wasting a (seemingly) perfectly >> fine way of doing so: the DT and its documentation. > > When you submit a new driver upstream, that patch also includes the > new device tree nodes and documentation for those nodes. Everything > is peer-reviewed together. I don't understand what you think the > problem is. > Thanks for your comment and sorry for the late reply. My question is about submitting DT properties/nodes (describing some HW) for which there is no Linux driver. Like register addresses for HW blocks, including HW capabilities of said HW blocks, which may or may not be setup by Linux directly. The idea being that since DT describes the HW and is usually shared with the bootloader (yet stored in the Linux kernel tree), all layers of the stack could use the same DT and each layer would use relevant properties. So the DT would describe the whole SoC even if not all HW blocks have a Linux driver. 3rd party users of said SoC could then write kernel modules for such HW blocks using the DT description. The DT would thus become the authoritative source of information regarding register programming for the SoC. Currently, HW blocks for which there is no public driver (that it is accessed through user-mode libraries or firmware) require a separate HW description (be it Documentation, headers, etc.) Since the DT describes the HW, it would make sense to expose the HW through DT, that would centralise the HW description. However, after discussing over IRC, it looks like there was no guidance on this. Some people think submitting DT properties/nodes without a corresponding Linux driver is frowned upon, while others thought it was an odd limitation and suggested asking here. Does that clarifies the scope of the question? Best regards, Sebastian
[toc] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-09-12 14:40 +0200 |
| Message-ID | <sgyGK-3jx-29@gated-at.bofh.it> |
| In reply to | #1481207 |
On Mon, Sep 12, 2016 at 02:29:37PM +0200, Sebastian Frias wrote: > My question is about submitting DT properties/nodes (describing some HW) for > which there is no Linux driver. Like register addresses for HW blocks, > including HW capabilities of said HW blocks, which may or may not be setup > by Linux directly. > > The idea being that since DT describes the HW and is usually shared with the > bootloader (yet stored in the Linux kernel tree), all layers of the stack > could use the same DT and each layer would use relevant properties. So the > DT would describe the whole SoC even if not all HW blocks have a Linux > driver. > > 3rd party users of said SoC could then write kernel modules for such HW > blocks using the DT description. The DT would thus become the authoritative > source of information regarding register programming for the SoC. I don't follow this part entirely. Why are you expecting thrid parties to write a driver for those blocks rather than upstreaming a driver for them? > Currently, HW blocks for which there is no public driver (that it is > accessed through user-mode libraries or firmware) require a separate > HW description (be it Documentation, headers, etc.) > > Since the DT describes the HW, it would make sense to expose the HW through > DT, that would centralise the HW description. I would generally agree that the hardware should be described in DT. The difficulty is that without a 'real' user it's not always possible to tell if we're describing the thing correctly. Putting smoething together that's only sufficient to support some out-of-tree driver with implicit assumptions that we are not aware of is far from fantastic. > However, after discussing over IRC, it looks like there was no guidance on > this. Some people think submitting DT properties/nodes without a corresponding > Linux driver is frowned upon, while others thought it was an odd limitation > and suggested asking here. Unfortunately, I think that the area is sufficiently vague that there simply is no clear and general answer. For the sake of discussion, an example of a particular block, along with what you expect/need to describe would be helpful. Thanks, Mark.
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Frias <sf84@laposte.net> |
|---|---|
| Date | 2016-09-12 15:20 +0200 |
| Message-ID | <sgzjr-3N9-5@gated-at.bofh.it> |
| In reply to | #1481217 |
Hi Mark, On 09/12/2016 02:38 PM, Mark Rutland wrote: >> >> 3rd party users of said SoC could then write kernel modules for such HW >> blocks using the DT description. The DT would thus become the authoritative >> source of information regarding register programming for the SoC. > > I don't follow this part entirely. Why are you expecting thrid parties > to write a driver for those blocks rather than upstreaming a driver for > them? 3rd parties could choose to write a driver (as opposed to use say, a user-mode library) if it fits their programming model better, if they think they would have better performance, or other reasons. The main idea is to make DT the authoritative source of HW description. > >> Currently, HW blocks for which there is no public driver (that it is >> accessed through user-mode libraries or firmware) require a separate >> HW description (be it Documentation, headers, etc.) >> >> Since the DT describes the HW, it would make sense to expose the HW through >> DT, that would centralise the HW description. > > I would generally agree that the hardware should be described in DT. > The difficulty is that without a 'real' user it's not always possible to > tell if we're describing the thing correctly. > That may be true, but so far we are not discussing changing DT's API so it should not have big ramifications. Besides, what "makes sense now" may "not make sense tomorrow" depending on how the HW is modified. We have somehow learned the hard-way that "le mieux est l'ennemi du bien" (the better is the enemy of the good) and we are trying to take a more practical (and flexible) approach. > Putting smoething together that's only sufficient to support some > out-of-tree driver with implicit assumptions that we are not aware of is > far from fantastic. That does not seem very positive and it is not the case anyway, otherwise we would not be consulting here :-) Agreed, right now this whole thing seems like a really hypothetical question, but the intention is good. Actually, I think it would encourage more SoC manufacturers to use DT as a way to document their HW, which is a good thing. > >> However, after discussing over IRC, it looks like there was no guidance on >> this. Some people think submitting DT properties/nodes without a corresponding >> Linux driver is frowned upon, while others thought it was an odd limitation >> and suggested asking here. > > Unfortunately, I think that the area is sufficiently vague that there > simply is no clear and general answer. > > For the sake of discussion, an example of a particular block, along with > what you expect/need to describe would be helpful. I don't have a more concrete example now. As I stated, right now HW description is not centralised, and thus different bits of information are cherry-picked by hand from HW description into DT for bootloader, DT for Linux, Documentation/headers for 3rd-parties, etc. But if I understood correctly your comment, you are basically saying that without an example is hard to say. Since the question seems understood, do you have an example of other SoC's doing something similar? I've seen some big DT descriptions, but it is difficult to know if we are the first ones trying to use the DT in this way. Best regards, Sebastian
[toc] | [prev] | [next] | [standalone]
| From | Timur Tabi <timur@tabi.org> |
|---|---|
| Date | 2016-09-12 15:30 +0200 |
| Message-ID | <sgzt8-3QU-19@gated-at.bofh.it> |
| In reply to | #1481272 |
Sebastian Frias wrote: > 3rd parties could choose to write a driver (as opposed to use say, a user-mode > library) if it fits their programming model better, if they think they would > have better performance, or other reasons. > > The main idea is to make DT the authoritative source of HW description. Do you really expect the open-source community to make a serious effort to support out-of-tree drivers written by developers who have no intention of upstreaming? There's a process for writing a Linux kernel driver with a DT binding. That process is not broken. >> >Putting smoething together that's only sufficient to support some >> >out-of-tree driver with implicit assumptions that we are not aware of is >> >far from fantastic. > That does not seem very positive and it is not the case anyway, otherwise we > would not be consulting here:-) Mark is correct. Trying to create a device tree binding, and getting it correct 100% the first time, without an actual drivers is just impossible. To even attempt that is folly. > Agreed, right now this whole thing seems like a really hypothetical question, Yes, it is. > but the intention is good. I'm not sure I agree with that. > Actually, I think it would encourage more SoC manufacturers to use DT as a way > to document their HW, which is a good thing. No it isn't. SOC manufacturers should just release the documentation they have. > But if I understood correctly your comment, you are basically saying that > without an example is hard to say. > Since the question seems understood, do you have an example of other SoC's > doing something similar? Similar to what? Every upstream driver today is written the way we're talking about -- submit the driver with the binding, and both are reviewed together. > I've seen some big DT descriptions, but it is difficult to know if we are the > first ones trying to use the DT in this way. Hopefully, you'll be the last.
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-09-12 16:10 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgA5Q-4ka-21@gated-at.bofh.it> |
| In reply to | #1481272 |
Hi, On Mon, Sep 12, 2016 at 03:15:00PM +0200, Sebastian Frias wrote: > On 09/12/2016 02:38 PM, Mark Rutland wrote: > >> > >> 3rd party users of said SoC could then write kernel modules for such HW > >> blocks using the DT description. The DT would thus become the authoritative > >> source of information regarding register programming for the SoC. > > > > I don't follow this part entirely. Why are you expecting thrid parties > > to write a driver for those blocks rather than upstreaming a driver for > > them? > > 3rd parties could choose to write a driver (as opposed to use say, a user-mode > library) if it fits their programming model better, if they think they would > have better performance, or other reasons. A vendor can always choose to "add value" in this manner. The general expectation of *some* driver being upstreamed remains. > > I would generally agree that the hardware should be described in DT. > > The difficulty is that without a 'real' user it's not always possible to > > tell if we're describing the thing correctly. > > That may be true, but so far we are not discussing changing DT's API so it > should not have big ramifications. You're not changing the code, but you are creating a binding. Bindings are intended to be stable (i.e. a working DTB from today should continue to work in future), and thus there are ramifications. Few devices these says are entirely independent, and most devices can be instantiated multiple times (even if there happens to only be a single instance in practice). For the example of a userspace driver there are very real ABI concerns, such as how the device(s) are discovered, how any related components like regulators and clocks are controlled, etc. There are ramifications here, and it's a dangerous over simplification to say that this doesn't matter because we're not changing kernel code. > Besides, what "makes sense now" may "not make sense tomorrow" depending on > how the HW is modified. That's always the case when a new generation of hardware comes out, so I don't think that's relevant to the topic at hand. > We have somehow learned the hard-way that "le mieux est l'ennemi du bien" > (the better is the enemy of the good) and we are trying to take a more > practical (and flexible) approach. > > > Putting smoething together that's only sufficient to support some > > out-of-tree driver with implicit assumptions that we are not aware of is > > far from fantastic. > > That does not seem very positive and it is not the case anyway, otherwise we > would not be consulting here :-) > Agreed, right now this whole thing seems like a really hypothetical question, > but the intention is good. > > Actually, I think it would encourage more SoC manufacturers to use DT as a way > to document their HW, which is a good thing. Writing and reviewing bindings is a very tricky topic, as it can require fairly intimate knowledge of a piece of hardware. I've repeatedly found that binding descriptions did not match the realities of the hardware, and I've only managed to do so by looking at accompanying driver code. Given that manuals and other information on devices are often not freely available (if they exist at all), the proposal effectively limits myself and others to spot common (anti)patterns, which is far less than ideal, and will result in more mistakes. As it stands, the proposal asks for effort for the community (in terms of review and maintenance of bindings), with no benefit to the kernel community, and a number of pitfalls that we would rather avoid. In an ideal world, writing and reviewing bindings would be a simple affair, and this could happen separately from work on any particular OS. In practice, things are sufficiently complicated that you need *some* demonstration that a binding is suitable, which is what I'm personally after when I ask for a Linux driver. > >> However, after discussing over IRC, it looks like there was no guidance on > >> this. Some people think submitting DT properties/nodes without a corresponding > >> Linux driver is frowned upon, while others thought it was an odd limitation > >> and suggested asking here. > > > > Unfortunately, I think that the area is sufficiently vague that there > > simply is no clear and general answer. > > > > For the sake of discussion, an example of a particular block, along with > > what you expect/need to describe would be helpful. > > I don't have a more concrete example now. For this discussion to go somewhere, we need an example. Otherwise we're all coming at this with differing implicit assumptions and no clear evidence for any assertions. > As I stated, right now HW description is not centralised, and thus different > bits of information are cherry-picked by hand from HW description into DT for > bootloader, DT for Linux, Documentation/headers for 3rd-parties, etc. > > But if I understood correctly your comment, you are basically saying that > without an example is hard to say. > Since the question seems understood, do you have an example of other SoC's > doing something similar? I do not have an example. I know that others are using DT for data beyond what Linux or another OS requires, but it's my understanding that that is typically in a separate DTB. Thanks, Mark.
[toc] | [prev] | [next] | [standalone]
| From | Warner Losh <imp@bsdimp.com> |
|---|---|
| Date | 2016-09-12 16:30 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgApc-4s1-21@gated-at.bofh.it> |
| In reply to | #1481317 |
On Mon, Sep 12, 2016 at 8:01 AM, Mark Rutland <mark.rutland@arm.com> wrote: >> Since the question seems understood, do you have an example of other SoC's >> doing something similar? > > I do not have an example. I know that others are using DT for data > beyond what Linux or another OS requires, but it's my understanding that > that is typically in a separate DTB. Just to clarify: FreeBSD uses, for the most part, the DTB's that the 'vendor' ships, which is quite often the same ones included in Linux. There's some exceptions where the bindings weren't really hardware independent, or where the abstraction model was really Linux specific (for things like the HDMI stack). However, with the advent of overlays, one would think that a vendor could easily include an overlay with the DTB data for the devices they don't wish to, or cannot for other reasons release. It seems like the perfect mechanism to comply with the rules about inclusion of nodes in the DTS. Vendors are free to document these nodes and don't require the Linux kernel include them in the Documents directory to do so. There have been recent efforts to move this documentation to a third party to maintain. Warner
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Frias <sf84@laposte.net> |
|---|---|
| Date | 2016-09-12 18:30 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgChk-5GQ-27@gated-at.bofh.it> |
| In reply to | #1481354 |
Hi Warner, On 09/12/2016 04:26 PM, Warner Losh wrote: > On Mon, Sep 12, 2016 at 8:01 AM, Mark Rutland <mark.rutland@arm.com> wrote: >>> Since the question seems understood, do you have an example of other SoC's >>> doing something similar? >> >> I do not have an example. I know that others are using DT for data >> beyond what Linux or another OS requires, but it's my understanding that >> that is typically in a separate DTB. > > Just to clarify: FreeBSD uses, for the most part, the DTB's that the > 'vendor' ships, which is quite often the same ones included in Linux. > There's some exceptions where the bindings weren't really hardware > independent, or where the abstraction model was really Linux specific > (for things like the HDMI stack). > > However, with the advent of overlays, one would think that a vendor > could easily include an overlay with the DTB data for the devices they > don't wish to, or cannot for other reasons release. It seems like the > perfect mechanism to comply with the rules about inclusion of nodes in > the DTS. Vendors are free to document these nodes and don't require > the Linux kernel include them in the Documents directory to do so. > There have been recent efforts to move this documentation to a third > party to maintain. This is very interesting, do you have a more concrete example of such usage? The overlay technique could be a solution, but so is forking and distributing a non-documented DT. That's why I'd put this solution a little bit lower than just exposing the entire HW description through the DT. Best regards, Sebastian
[toc] | [prev] | [next] | [standalone]
| From | Warner Losh <imp@bsdimp.com> |
|---|---|
| Date | 2016-09-12 18:50 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgCAF-5NW-19@gated-at.bofh.it> |
| In reply to | #1481530 |
On Mon, Sep 12, 2016 at 10:29 AM, Sebastian Frias <sf84@laposte.net> wrote: > Hi Warner, > > On 09/12/2016 04:26 PM, Warner Losh wrote: >> On Mon, Sep 12, 2016 at 8:01 AM, Mark Rutland <mark.rutland@arm.com> wrote: >>>> Since the question seems understood, do you have an example of other SoC's >>>> doing something similar? >>> >>> I do not have an example. I know that others are using DT for data >>> beyond what Linux or another OS requires, but it's my understanding that >>> that is typically in a separate DTB. >> >> Just to clarify: FreeBSD uses, for the most part, the DTB's that the >> 'vendor' ships, which is quite often the same ones included in Linux. >> There's some exceptions where the bindings weren't really hardware >> independent, or where the abstraction model was really Linux specific >> (for things like the HDMI stack). >> >> However, with the advent of overlays, one would think that a vendor >> could easily include an overlay with the DTB data for the devices they >> don't wish to, or cannot for other reasons release. It seems like the >> perfect mechanism to comply with the rules about inclusion of nodes in >> the DTS. Vendors are free to document these nodes and don't require >> the Linux kernel include them in the Documents directory to do so. >> There have been recent efforts to move this documentation to a third >> party to maintain. > > This is very interesting, do you have a more concrete example of such > usage? Using overlays to layer in a proprietary device blob for a proprietary driver? No. I don't. It just seems like a natural solution. Do I have more examples where FreeBSD has to deviate because the DT is actually Linux specific and does a poor job of modeling the hardware and instead reflects the Linux driver model? I have plenty of those... Warner
[toc] | [prev] | [next] | [standalone]
| From | Timur Tabi <timur@tabi.org> |
|---|---|
| Date | 2016-09-12 18:50 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgCAF-5NW-17@gated-at.bofh.it> |
| In reply to | #1481541 |
Warner Losh wrote: > Do I have more examples > where FreeBSD has to deviate because the DT is actually Linux > specific and does a poor job of modeling the hardware and instead > reflects the Linux driver model? I have plenty of those... I think it would be a great idea if the FreeBSD and Linux DT maintainers collaborated on cleaning up the DT bindings so that this problem no longer occurs (or at least, not normally). I would love to see some of those examples.
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-09-12 19:10 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgCU1-6aZ-5@gated-at.bofh.it> |
| In reply to | #1481542 |
On Mon, Sep 12, 2016 at 11:49:07AM -0500, Timur Tabi wrote: > Warner Losh wrote: > >Do I have more examples > >where FreeBSD has to deviate because the DT is actually Linux > >specific and does a poor job of modeling the hardware and instead > >reflects the Linux driver model? I have plenty of those... > > I think it would be a great idea if the FreeBSD and Linux DT > maintainers collaborated on cleaning up the DT bindings so that this > problem no longer occurs (or at least, not normally). Indeed. Theoretically/hopefully, the devicetree.org stuff creates a more inclusive forum for this. Thanks, Mark.
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-09-12 19:50 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgDwJ-6qC-3@gated-at.bofh.it> |
| In reply to | #1481541 |
Hi, On Mon, Sep 12, 2016 at 10:45:37AM -0600, Warner Losh wrote: > Do I have more examples where FreeBSD has to deviate because the DT is > actually Linux specific and does a poor job of modeling the hardware > and instead reflects the Linux driver model? I have plenty of those... I guess you don't actually have those written down, but on the off-chance, would you be able to share any major pain points? We do try (admittedly far from perfectly) to avoid implementation details in bindings, but driver mdoel details are fairly difficult to pin down either way. It would be nice to be more aware. Thanks, Mark.
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Frias <sf84@laposte.net> |
|---|---|
| Date | 2016-09-12 18:10 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgBXX-5zs-7@gated-at.bofh.it> |
| In reply to | #1481317 |
Hi Mark, On 09/12/2016 04:01 PM, Mark Rutland wrote: >> 3rd parties could choose to write a driver (as opposed to use say, a user-mode >> library) if it fits their programming model better, if they think they would >> have better performance, or other reasons. > > A vendor can always choose to "add value" in this manner. The general > expectation of *some* driver being upstreamed remains. Yes, that's the idea. >> >> That may be true, but so far we are not discussing changing DT's API so it >> should not have big ramifications. > > You're not changing the code, but you are creating a binding. Bindings > are intended to be stable (i.e. a working DTB from today should continue > to work in future), and thus there are ramifications. Ok, but who is responsible for such guarantee? How is it enforced and verified? > > Few devices these says are entirely independent, and most devices can be > instantiated multiple times (even if there happens to only be a single > instance in practice). For the example of a userspace driver there are > very real ABI concerns, such as how the device(s) are discovered, how > any related components like regulators and clocks are controlled, etc. > > There are ramifications here, and it's a dangerous over simplification > to say that this doesn't matter because we're not changing kernel code. > >> Besides, what "makes sense now" may "not make sense tomorrow" depending on >> how the HW is modified. > > That's always the case when a new generation of hardware comes out, so I > don't think that's relevant to the topic at hand. Exactly, that's why to I'm having trouble to understand why there is so much insistence on "getting the DT 100% right", since a HW change could imply that what made 100% sense yesterday, does not today. Since that is a possibility we have to live with, then the "100% right" goal is most likely unachievable. That's different from "backwards compatibility" for which some technique, like alternate descriptions, can be put in place. Maybe I will get a better understanding of this once my previous question about who and how guarantees the stability of a given DT blob. >> >> Actually, I think it would encourage more SoC manufacturers to use DT as a way >> to document their HW, which is a good thing. > > Writing and reviewing bindings is a very tricky topic, as it can require > fairly intimate knowledge of a piece of hardware. I've repeatedly found > that binding descriptions did not match the realities of the hardware, > and I've only managed to do so by looking at accompanying driver code. > > Given that manuals and other information on devices are often not freely > available (if they exist at all), the proposal effectively limits myself > and others to spot common (anti)patterns, which is far less than ideal, > and will result in more mistakes. > > As it stands, the proposal asks for effort for the community (in terms > of review and maintenance of bindings), with no benefit to the kernel > community, and a number of pitfalls that we would rather avoid. Could you be more precise on those two issues? Namely: "the effort" and the "lack of benefit for the community"? I can understand the effort it takes to review a binding and some driver, but if there's no driver, why would it matter if the DT binding is 100% right? Hence, why would it take more effort? Furthermore, if there's no driver, there's no backward compatibility to guarantee. Shouldn't it require less effort? Also, what sort of "benefits" does the community expects or requires? Because the idea behind the proposal is to put the HW description in DT, so basically the HW would be documented. Maybe there wouldn't be a driver right away, but the HW description would allow for drivers to exist. > > In an ideal world, writing and reviewing bindings would be a simple > affair, and this could happen separately from work on any particular OS. > In practice, things are sufficiently complicated that you need *some* > demonstration that a binding is suitable, which is what I'm personally > after when I ask for a Linux driver. > >>>> However, after discussing over IRC, it looks like there was no guidance on >>>> this. Some people think submitting DT properties/nodes without a corresponding >>>> Linux driver is frowned upon, while others thought it was an odd limitation >>>> and suggested asking here. >>> >>> Unfortunately, I think that the area is sufficiently vague that there >>> simply is no clear and general answer. >>> >>> For the sake of discussion, an example of a particular block, along with >>> what you expect/need to describe would be helpful. >> >> I don't have a more concrete example now. > > For this discussion to go somewhere, we need an example. Otherwise we're > all coming at this with differing implicit assumptions and no clear > evidence for any assertions. Ok, I'll try to come up with some example. >> But if I understood correctly your comment, you are basically saying that >> without an example is hard to say. >> Since the question seems understood, do you have an example of other SoC's >> doing something similar? > > I do not have an example. I know that others are using DT for data > beyond what Linux or another OS requires, but it's my understanding that > that is typically in a separate DTB. > I see, although I don't understand how accepting such solution (i.e.: having the information in a different DT) benefits the open-source community, since it basically means that the open-source community settles for less information. Best regards, Sebastian
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Frias <sf84@laposte.net> |
|---|---|
| Date | 2016-09-12 18:30 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgChj-5GQ-19@gated-at.bofh.it> |
| In reply to | #1481517 |
On 09/12/2016 06:07 PM, Sebastian Frias wrote: > Hi Mark, > > On 09/12/2016 04:01 PM, Mark Rutland wrote: >>> 3rd parties could choose to write a driver (as opposed to use say, a user-mode >>> library) if it fits their programming model better, if they think they would >>> have better performance, or other reasons. >> >> A vendor can always choose to "add value" in this manner. The general >> expectation of *some* driver being upstreamed remains. > > Yes, that's the idea. Just to clarify, what I meant is that, using the DT as the authoritative source of HW description is a way to "add value" to everybody, because both, 3rd-parties and the open-source community get the same information. This creates the conditions for drivers to exist, with the expectation that eventually said drivers would be upstreamed.
[toc] | [prev] | [next] | [standalone]
| From | Timur Tabi <timur@tabi.org> |
|---|---|
| Date | 2016-09-12 18:30 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgChk-5GQ-23@gated-at.bofh.it> |
| In reply to | #1481517 |
Sebastian Frias wrote: >> You're not changing the code, but you are creating a binding. >> Bindings >>> are intended to be stable (i.e. a working DTB from today should >>> continue to work in future), and thus there are ramifications. > Ok, but who is responsible for such guarantee? The developers who create the driver and modify it. Only upstream contributions count. > How is it enforced and verified? The upstream reviewers verify it, and if they see a problem, they reject the patch. > Exactly, that's why to I'm having trouble to understand why there is > so much insistence on "getting the DT 100% right", since a HW change > could imply that what made 100% sense yesterday, does not today. I'm not sure what you're getting at. Everything is best-effort. The binding for a given device is supposed to accurately, but minimally, describe the hardware so that the driver can program the device properly. Specific properties are added to the binding to handle specific cases. If a binding includes a description of properties that are not used by the driver, the developer is typically asked to remove those. So I don't understand the "100% right" comment. > Could you be more precise on those two issues? Namely: "the effort" > and the "lack of benefit for the community"? 1) The effort = the effort by upstream developers to review the binding. 2) lack of benefit = proprietary and out-of-tree drivers do not benefit the community. > I can understand the effort it takes to review a binding and some > driver, but if there's no driver, why would it matter if the DT > binding is 100% right? Why bother creating a binding if there's no driver to use it? > Hence, why would it take more effort? > Furthermore, if there's no driver, there's no backward compatibility > to guarantee. Shouldn't it require less effort? If a developer creates a binding without a driver, then it's very hard to know if that binding is correct. That's like creating a recipe without attempting to make the food. How do you know it actually tastes good? No one would ever ask a chef to create a "technically correct" recipe without cooking it first and tasting it. > Also, what sort of "benefits" does the community expects or > requires? Because the idea behind the proposal is to put the HW > description in DT, so basically the HW would be documented. Maybe > there wouldn't be a driver right away, but the HW description would > allow for drivers to exist. I'm not sure how many times we need to repeat this, but the idea that the DT binding documentation can be used as official documentation for the hardware is absurd. What's wrong with the ACTUAL hardware documentation provided by the manufacturer in PDF format? The DT binding has no value without an actual driver.
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-09-12 19:00 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgCKl-5RJ-7@gated-at.bofh.it> |
| In reply to | #1481517 |
On Mon, Sep 12, 2016 at 06:07:05PM +0200, Sebastian Frias wrote: > On 09/12/2016 04:01 PM, Mark Rutland wrote: > > Few devices these says are entirely independent, and most devices can be > > instantiated multiple times (even if there happens to only be a single > > instance in practice). For the example of a userspace driver there are > > very real ABI concerns, such as how the device(s) are discovered, how > > any related components like regulators and clocks are controlled, etc. > > > > There are ramifications here, and it's a dangerous over simplification > > to say that this doesn't matter because we're not changing kernel code. > > > >> Besides, what "makes sense now" may "not make sense tomorrow" depending on > >> how the HW is modified. > > > > That's always the case when a new generation of hardware comes out, so I > > don't think that's relevant to the topic at hand. > > Exactly, that's why to I'm having trouble to understand why there is so much > insistence on "getting the DT 100% right", since a HW change could imply > that what made 100% sense yesterday, does not today. > Since that is a possibility we have to live with, then the "100% right" goal > is most likely unachievable. > That's different from "backwards compatibility" for which some technique, > like alternate descriptions, can be put in place. I'm not on about "100% right", but more "a reasonable chance of being good enough". The latter is extremely difficult to judge when you just get a binding document with little or no additional context. Backwards compatibility is with regards to new software supporting old bindings. If new HW comes out, we can create new bindings. Old bindings should remain supported regardless. > >> Actually, I think it would encourage more SoC manufacturers to use DT as a way > >> to document their HW, which is a good thing. > > > > Writing and reviewing bindings is a very tricky topic, as it can require > > fairly intimate knowledge of a piece of hardware. I've repeatedly found > > that binding descriptions did not match the realities of the hardware, > > and I've only managed to do so by looking at accompanying driver code. > > > > Given that manuals and other information on devices are often not freely > > available (if they exist at all), the proposal effectively limits myself > > and others to spot common (anti)patterns, which is far less than ideal, > > and will result in more mistakes. > > > > As it stands, the proposal asks for effort for the community (in terms > > of review and maintenance of bindings), with no benefit to the kernel > > community, and a number of pitfalls that we would rather avoid. > > Could you be more precise on those two issues? Namely: > "the effort" and the "lack of benefit for the community"? As above, reviewing is tricky. One has to spend the time gaining an understanding of a particular piece of hardware, the class of hardware it falls in, and also the bigger picture that it fits in. Once you have that, you have to review the binding in that context, and that takes time and effort. As things evolve, perhaps mistakes or inconsistencies are found, or new ways to generalise things. As that occurs, there is a maintenance burden for existing bindings. All of that takes time and effort. If, at the end of that, a proprietary vendor driver is using a different version of the binding anyway, because "there's no backward compatibility to guarantee", then there is no benefit to the document. Even if that proprietary driver does remain stable, the Linux community will have done work that only benefits the authors of that driver. We would prefer that the results of our efforts are open, and benefit all. > I can understand the effort it takes to review a binding and some > driver, but if there's no driver, why would it matter if the DT binding is > 100% right? Hence, why would it take more effort? > Furthermore, if there's no driver, there's no backward compatibility to > guarantee. Shouldn't it require less effort? I don't follow. If there's no compatibility to guarantee, why do you want a binding? A binding is a form of contract -- if you describe the HW this way, then some software will understand it. You can extend a binding over time, certainly, but if the baseline of that binding is a moving target, that benefits nobody. [...] > >> But if I understood correctly your comment, you are basically saying that > >> without an example is hard to say. > >> Since the question seems understood, do you have an example of other SoC's > >> doing something similar? > > > > I do not have an example. I know that others are using DT for data > > beyond what Linux or another OS requires, but it's my understanding that > > that is typically in a separate DTB. > > I see, although I don't understand how accepting such solution (i.e.: having the > information in a different DT) benefits the open-source community, since it > basically means that the open-source community settles for less information. As with all things, it depends on context. If someone's using a DT to describe details of the secure world of a platform with trustzone to a secure OS, then not all of that information is relevant to Linux. Likewise if configuration details specific to FW are embedded. If there's information relevant to a general purpose OS, then I would expect it to be described. By the same token, I would expect a general purpose OS to actually be making use of the information. In practice, we've used Linux as the benchmark for that. That needn't necessarily be the case if another OS can demonstrate that the binding is worthwhile -- ideally we'd have multiple OSs using bindings so as to "keep us honest" and free from implementation details. As I mentioned before, an example would help. The theoretical envelope is very large and likely far beyond what you envisage. We need something to focus on, or we're arguing about what we conceive differently. Thanks, Mark.
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Frias <sf84@laposte.net> |
|---|---|
| Date | 2016-09-13 12:10 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgSP7-pv-15@gated-at.bofh.it> |
| In reply to | #1481551 |
Hi Mark, On 09/12/2016 06:56 PM, Mark Rutland wrote: >> Exactly, that's why to I'm having trouble to understand why there is so much >> insistence on "getting the DT 100% right", since a HW change could imply >> that what made 100% sense yesterday, does not today. >> Since that is a possibility we have to live with, then the "100% right" goal >> is most likely unachievable. >> That's different from "backwards compatibility" for which some technique, >> like alternate descriptions, can be put in place. > > I'm not on about "100% right", but more "a reasonable chance of being > good enough". Ok. > The latter is extremely difficult to judge when you just > get a binding document with little or no additional context. Exactly, that is why I was thinking it would take less "review" time. Indeed, if there is no driver, why would it matter what those bindings are? > Backwards compatibility is with regards to new software supporting old > bindings. If new HW comes out, we can create new bindings. Old bindings > should remain supported regardless. Indeed. So you agree that without a driver, there is no backward compatibility to maintain (because nothing could break). Could we then say that in that case, it should not matter that much (if at all) if the bindings have "a reasonable chance of being good enough"? Because I'm trying to understand why/how would the "open-source community" be affected by some DT properties/nodes that are not used by upstream Linux drivers. Warner proposed 'overlays' to deal with the "open-source community" reticence to accept such bindings. Whereas it may be simpler to just find a way to accommodate the integration of such bindings in a way that everybody wins. That could take the form of a "staging" DT area, so that the 'overlay' is public. Just for the sake and benefit of everybody, 3rd parties and open-source community. >> Could you be more precise on those two issues? Namely: >> "the effort" and the "lack of benefit for the community"? > > As above, reviewing is tricky. One has to spend the time gaining an > understanding of a particular piece of hardware, the class of hardware > it falls in, and also the bigger picture that it fits in. Once you have > that, you have to review the binding in that context, and that takes > time and effort. Yes, but this is based on a binding for which there's a driver. If there's no driver it should not take that much time, right? > As things evolve, perhaps mistakes or inconsistencies are found, or new > ways to generalise things. As that occurs, there is a maintenance burden > for existing bindings. > > All of that takes time and effort. Only for bindings for which there is a driver. Think about this: - a binding with no driver is submitted and ends up in the tree (it could be on a staging area if necessary) - if at a later point somebody attempts to upstream a driver using those 'staging' bindings, the reviewers could say "you are using 'staging' bindings, please add compatibility with 'staging' and 'standard' bindings", even if that includes the discussion and review of newly created 'standard' bindings corresponding to the 'staging' bindings. - the submitter may even say "there's no need for compatibility for 'staging' bindings, because they were never used (or other valid reasons)". What would you think of something like that? > If, at the end of that, a proprietary vendor driver is using a different > version of the binding anyway, because "there's no backward > compatibility to guarantee", then there is no benefit to the document. No, it would not use a "different version of the binding", because the binding would be public, i.e.: everything would be on the public DT. > Even if that proprietary driver does remain stable, the Linux community > will have done work that only benefits the authors of that driver. We > would prefer that the results of our efforts are open, and benefit all. Do you have an example of a binding *not used by Linux* that created enormous amount of work for the Linux community? >> I can understand the effort it takes to review a binding and some >> driver, but if there's no driver, why would it matter if the DT binding is >> 100% right? Hence, why would it take more effort? >> Furthermore, if there's no driver, there's no backward compatibility to >> guarantee. Shouldn't it require less effort? > > I don't follow. If there's no compatibility to guarantee, why do you > want a binding? Let's make an abstraction of the word 'binding', 'create a binding', etc. and just focus on this: - Somebody submits a DT file that contains properties and nodes that are *not used* by any Linux driver. - Said properties and nodes serve as HW description for HW blocks for which *there is no* Linux driver. The goal of the above is to use the DT as the authoritative (and single) source of HW definition. An alternate solution, as proposed by Warner, is to use 'binary overlays' for the DT. > A binding is a form of contract -- if you describe the HW this way, then > some software will understand it. You can extend a binding over time, > certainly, but if the baseline of that binding is a moving target, that > benefits nobody. > The benefit is that in one case (the case where the whole SoC is described in the DT, regardless of the existence of a Linux driver or not) there is more information available publicly. >> I see, although I don't understand how accepting such solution (i.e.: having the >> information in a different DT) benefits the open-source community, since it >> basically means that the open-source community settles for less information. > > As with all things, it depends on context. If someone's using a DT to > describe details of the secure world of a platform with trustzone to a > secure OS, then not all of that information is relevant to Linux. > Likewise if configuration details specific to FW are embedded. Ok, so if the information is not relevant to Linux do you agree that it should not affect it, and then we could imagine such details being present on the DT anyway? > If there's information relevant to a general purpose OS, then I would > expect it to be described. By the same token, I would expect a general > purpose OS to actually be making use of the information. In practice, > we've used Linux as the benchmark for that. That needn't necessarily be > the case if another OS can demonstrate that the binding is worthwhile -- > ideally we'd have multiple OSs using bindings so as to "keep us honest" > and free from implementation details. You mention the case of another OS. What is the definition of OS in this case? Because one could say that "FW" or "secure world" could fit that definition, right? Or when you talk about "another OS" you think only about other open-source mainstream OSs, like FreeBSD? > As I mentioned before, an example would help. The theoretical envelope > is very large and likely far beyond what you envisage. We need something > to focus on, or we're arguing about what we conceive differently. > I think we've made progress :-) Indeed, to me it is clear that what we conceive "differently", is that "the effort", "lack of benefit for the community", "Old bindings should remain supported regardless" and "backward compatibility" are considered with respect to DT *plus* driver, yet the idea is to have DT describe HW for which there's no upstream driver yet. Hence most of those considerations should not apply, right? Best regards, Sebastian
[toc] | [prev] | [next] | [standalone]
| From | Timur Tabi <timur@tabi.org> |
|---|---|
| Date | 2016-09-13 13:40 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgUed-1cs-17@gated-at.bofh.it> |
| In reply to | #1482335 |
Sebastian Frias wrote: > Let's make an abstraction of the word 'binding', 'create a binding', etc. and > just focus on this: > - Somebody submits a DT file that contains properties and nodes that are > *not used* by any Linux driver. > - Said properties and nodes serve as HW description for HW blocks for which > *there is no* Linux driver. > > The goal of the above is to use the DT as the authoritative (and single) > source of HW definition. No. I've grown weary of this discussion. We have explained multiple times why this is impractical. Using the DT to document hardware makes no sense. No one is going to do that, and anyone who attempts to submit a DT binding without an actual driver will get rejected.
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-09-13 15:30 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgVWF-2uA-7@gated-at.bofh.it> |
| In reply to | #1482387 |
Hi Timur, On Tue, Sep 13, 2016 at 06:37:16AM -0500, Timur Tabi wrote: > Sebastian Frias wrote: > >Let's make an abstraction of the word 'binding', 'create a binding', etc. and > >just focus on this: > >- Somebody submits a DT file that contains properties and nodes that are > >*not used* by any Linux driver. > >- Said properties and nodes serve as HW description for HW blocks for which > >*there is no* Linux driver. > > > >The goal of the above is to use the DT as the authoritative (and single) > >source of HW definition. > > No. > > I've grown weary of this discussion. We have explained multiple > times why this is impractical. Using the DT to document hardware > makes no sense. No one is going to do that, and anyone who attempts > to submit a DT binding without an actual driver will get rejected. Please don't make the same mistake of trivialising this in either direction. While we appear to be going in circles, in general there are potentially valid cases to consider -- there may be system properties/devices that don't happen to matter to Linux, but are generic, well-defined, and matter to others. Bindings for those should be considered. In the absence of any example, as with this thread, there is nothing to consider, however. Thanks, Mark.
[toc] | [prev] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-09-13 15:20 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgVMZ-2qI-21@gated-at.bofh.it> |
| In reply to | #1482335 |
On Tue, Sep 13, 2016 at 12:04:07PM +0200, Sebastian Frias wrote: > Hi Mark, > > On 09/12/2016 06:56 PM, Mark Rutland wrote: > > The latter is extremely difficult to judge when you just > > get a binding document with little or no additional context. > > Exactly, that is why I was thinking it would take less "review" time. > Indeed, if there is no driver, why would it matter what those bindings > are? If you believe that the bindings don't matter, then there is absolutely no reason for them to exist in the first place. If those binding matter to *anyone*, then those collating the bindings have some responsibility of stewardship, and that includes review/maintenance/etc. Hence, the Linux community cares as stewards of those bindings, and don't accept bindings they don't understand, for which there is no obvious user, nor for which the authors claim stability does not matter. Those go against the aims of DT, and against out responsiblities as stewards. I cannot put that any clearer. > >> Could you be more precise on those two issues? Namely: > >> "the effort" and the "lack of benefit for the community"? > > > > As above, reviewing is tricky. One has to spend the time gaining an > > understanding of a particular piece of hardware, the class of hardware > > it falls in, and also the bigger picture that it fits in. Once you have > > that, you have to review the binding in that context, and that takes > > time and effort. > > Yes, but this is based on a binding for which there's a driver. > If there's no driver it should not take that much time, right? > > > As things evolve, perhaps mistakes or inconsistencies are found, or new > > ways to generalise things. As that occurs, there is a maintenance burden > > for existing bindings. > > > > All of that takes time and effort. > > Only for bindings for which there is a driver. This is not true for all but the most trivial of hardware, as I stated previously. Go and take a look at all the effort that went into sorting out generic IOMMU bindings, when driver support was written after a large amount of review to sort out fundamental concepts. We had to sort out fundamentals before prototype driver code could be written, and while we knew drivers were coming, an awful lot of review effort came first. > Think about this: > - a binding with no driver is submitted and ends up in the tree > (it could be on a staging area if necessary) > > - if at a later point somebody attempts to upstream a driver using those > 'staging' bindings, the reviewers could say "you are using 'staging' bindings, > please add compatibility with 'staging' and 'standard' bindings", even if that > includes the discussion and review of newly created 'standard' bindings > corresponding to the 'staging' bindings. > > - the submitter may even say "there's no need for compatibility for 'staging' > bindings, because they were never used (or other valid reasons)". > > What would you think of something like that? As above, if they were never used, and potentially wrong, why did they exist? Trying to upstream a binding with no user comees with no immediate benefit, and potentially creates longer-term pain, whereas you can defer upstreaming a binding until the driver is ready. Note that I've repeatedly pointed out that the user of the binding doesn't necessarily have to be linux. However, there does need to be some demonstration, and commitment to maintaining the principles DT aims towards (e.g. stability). > Let's make an abstraction of the word 'binding', 'create a binding', etc. and > just focus on this: > - Somebody submits a DT file that contains properties and nodes that are > *not used* by any Linux driver. > - Said properties and nodes serve as HW description for HW blocks for which > *there is no* Linux driver. > > The goal of the above is to use the DT as the authoritative (and single) > source of HW definition. I understand that goal, and I've asked for a specific example, as this is not clear-cut. e.g. there has been work on describing secure devices for QEMU, but this isn't necessarily something we want to expose Linux to in general. > > As with all things, it depends on context. If someone's using a DT to > > describe details of the secure world of a platform with trustzone to a > > secure OS, then not all of that information is relevant to Linux. > > Likewise if configuration details specific to FW are embedded. > > Ok, so if the information is not relevant to Linux do you agree that it > should not affect it, and then we could imagine such details being present on > the DT anyway? Perhaps, or perhaps not. It depends on a number of details, and as I've said previously I cannot give you a general answer, because there is none. You must provide a specific case. > You mention the case of another OS. > What is the definition of OS in this case? Generally, I am considering a general purpose OS (e.g. Linux, FreeBSD), and not a secure-world trusted OS nor firmware (as typically these are very strongly tied to the platform, and have very different strtuctures and requirements when compared to a general purpose OS). That's the conext in which bindings are developed. > Because one could say that "FW" or "secure world" could fit that definition, > right? There's been work on describing things about the secure world in DT for QEMU. Firmware is typically so device-specific that an upstream/common DT doesn't really make sense. Perhaps you have an example of the specific use-case you care about? > Indeed, to me it is clear that what we conceive "differently", is that > "the effort", "lack of benefit for the community", "Old bindings should > remain supported regardless" and "backward compatibility" are considered > with respect to DT *plus* driver, yet the idea is to have DT describe > HW for which there's no upstream driver yet. > Hence most of those considerations should not apply, right? No. Bindings themselves should remain stable over time in that they must be evolved so as to allow software to handle them in a stable fashion, supporting old and new DTBs. While a lot of that effort is taken by code, care must also be taken wit the bindings themselves, and those considerations apply. Thanks, Mark.
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Frias <sf84@laposte.net> |
|---|---|
| Date | 2016-09-13 16:30 +0200 |
| Subject | Re: ARM, SoC: About the use DT-defined properties by 3rd-party drivers |
| Message-ID | <sgWSJ-35y-25@gated-at.bofh.it> |
| In reply to | #1482457 |
Hi Mark,
On 09/13/2016 03:12 PM, Mark Rutland wrote:
>> Exactly, that is why I was thinking it would take less "review" time.
>> Indeed, if there is no driver, why would it matter what those bindings
>> are?
>
> If you believe that the bindings don't matter, then there is absolutely
> no reason for them to exist in the first place.
Again, they would be there serving as HW description. Like documentation.
3rd parties and the open-source community could then use them to write
drivers.
Also, it would avoid having multiple DTs (bootloader, Linux, etc.) or
using 'binary DT overlays'.
In one case the nodes/properties would be made public, most likely with
documentation (even if there's no driver for them), in the other case
undocumented 'binary DT overlays' are used.
>
> If those binding matter to *anyone*, then those collating the bindings
> have some responsibility of stewardship, and that includes
> review/maintenance/etc.
>
> Hence, the Linux community cares as stewards of those bindings, and
> don't accept bindings they don't understand, for which there is no
> obvious user, nor for which the authors claim stability does not matter.
> Those go against the aims of DT, and against out responsiblities as
> stewards.
>
> I cannot put that any clearer.
I understand that.
However, it does not looks crazy to add some sort of 'staging', actually,
I found this:
$ find . -name 'stag*'
./Documentation/devicetree/bindings/staging
./drivers/staging
...
$ ls -1R ./Documentation/devicetree/bindings/staging
./Documentation/devicetree/bindings/staging:
iio
ion
./Documentation/devicetree/bindings/staging/iio:
adc
./Documentation/devicetree/bindings/staging/iio/adc:
lpc32xx-adc.txt
spear-adc.txt
./Documentation/devicetree/bindings/staging/ion:
hi6220-ion.txt
$ ls -1R ./drivers/staging | wc -l
2134
Isn't that a similar use to the one discussed in this thread?
>> Only for bindings for which there is a driver.
>
> This is not true for all but the most trivial of hardware, as I stated
> previously.
>
> Go and take a look at all the effort that went into sorting out generic
> IOMMU bindings, when driver support was written after a large amount of
> review to sort out fundamental concepts. We had to sort out fundamentals
> before prototype driver code could be written, and while we knew drivers
> were coming, an awful lot of review effort came first.
Again, you are talking about drivers, but it is not the case at hand.
DT seems essentially free-form, like XML.
One could imagine that some tool could then be used to guarantee that
some parts of DT conform to a given XML schema, including backwards
compatibility, while at the same time ignoring 'staging' stuff.
>> Think about this:
>> - a binding with no driver is submitted and ends up in the tree
>> (it could be on a staging area if necessary)
>>
>> - if at a later point somebody attempts to upstream a driver using those
>> 'staging' bindings, the reviewers could say "you are using 'staging' bindings,
>> please add compatibility with 'staging' and 'standard' bindings", even if that
>> includes the discussion and review of newly created 'standard' bindings
>> corresponding to the 'staging' bindings.
>>
>> - the submitter may even say "there's no need for compatibility for 'staging'
>> bindings, because they were never used (or other valid reasons)".
>>
>> What would you think of something like that?
>
> As above, if they were never used, and potentially wrong, why did they
> exist?
The last step of my description, where the 'staging' bindings may not have
been used, was listed only for the sake of completeness since it is just a
possibility.
The hope is that they would be eventually used (most likely as is, but
there is also the possibility of having to rethink the bindings when
moving them from 'staging' to 'stable').
> Trying to upstream a binding with no user comees with no immediate
> benefit, and potentially creates longer-term pain, whereas you can defer
> upstreaming a binding until the driver is ready.
The immediate benefit is complete HW description, which, if generalised and
done properly would amount to HW documentation, isn't that good?
> Note that I've repeatedly pointed out that the user of the binding
> doesn't necessarily have to be linux. However, there does need to be
> some demonstration, and commitment to maintaining the principles DT aims
> towards (e.g. stability).
The commitment to stability can be enforced later, since changes would be
reviewed.
If the "user of the binding" is not Linux, under what circumstances
could "Linux" have the legitimacy of guaranteeing or enforcing any Linux-
specific commitment?
>> Let's make an abstraction of the word 'binding', 'create a binding', etc. and
>> just focus on this:
>> - Somebody submits a DT file that contains properties and nodes that are
>> *not used* by any Linux driver.
>> - Said properties and nodes serve as HW description for HW blocks for which
>> *there is no* Linux driver.
>>
>> The goal of the above is to use the DT as the authoritative (and single)
>> source of HW definition.
>
> I understand that goal, and I've asked for a specific example, as this
> is not clear-cut. e.g. there has been work on describing secure devices
> for QEMU, but this isn't necessarily something we want to expose Linux
> to in general.
Interesting, do you know where in QEMU's code should I look for that?
Because the example I had in mind is something like (totally out of my
imagination):
/sigma/ {
audio_decoder_0: {
version = <2>;
revision = <1>;
program-memory = <0x20100000 0x1000>;
data-memory = <0x20101000 0x1000>;
hwbug-list = <33, 57, 11>;
arch = <DSP32>;
mutex-id = <12>;
irq-line = <9>;
mbus-read-channels = <2, 3>;
mbus-write-channels = <12, 13>;
has-AAC-support = <1>;
has-DTS-support = <1>;
has-SPDIF-output = <1>;
...
};
audio_decoder_1: {
version = <1>;
revision = <0>;
program-memory = <0x20200000 0x1000>;
data-memory = <0x20201000 0x1000>;
hwbug-list = <33, 57>;
arch = <DSP16>;
mutex-id = <11>;
irq-line = <8>;
mbus-read-channels = <4>;
mbus-write-channels = <14>;
has-AAC-support = <1>;
has-DTS-support = <0>;
has-SPDIF-output = <0>;
...
};
ethernet: {
mac-address = [ 00 11 22 33 44 55 ];
hwbug-list = <23>;
};
video_decoder: {
version = <4>;
revision = <0>;
memory = <0x20300000 0x10000>;
arch = <MIPS4K>;
mutex-id = <12>;
irq-line = <7>;
has-H264-support = <1>;
...
};
...
};
We could even imagine a section like:
boot: {
verify-images = <1>;
boot-order = <NAND, SD, SATA>;
enable-uart = <0>;
debug-level = <1>;
};
>> Ok, so if the information is not relevant to Linux do you agree that it
>> should not affect it, and then we could imagine such details being present on
>> the DT anyway?
>
> Perhaps, or perhaps not. It depends on a number of details, and as I've
> said previously I cannot give you a general answer, because there is
> none. You must provide a specific case.
I gave one above, but I still don't understand why would it matter.
I mean, it should be easy:
- is the node/property used by a Linux driver?
- YES => you must submit both DT+driver
- NO => we don't care
>> You mention the case of another OS.
>> What is the definition of OS in this case?
>
> Generally, I am considering a general purpose OS (e.g. Linux, FreeBSD),
> and not a secure-world trusted OS nor firmware (as typically these are
> very strongly tied to the platform, and have very different strtuctures
> and requirements when compared to a general purpose OS).
>
> That's the conext in which bindings are developed.
>
I see, thanks.
>> Because one could say that "FW" or "secure world" could fit that definition,
>> right?
>
> There's been work on describing things about the secure world in DT for
> QEMU. Firmware is typically so device-specific that an upstream/common
> DT doesn't really make sense.
>
> Perhaps you have an example of the specific use-case you care about?
Like I said, this started like an hypothetical question as a way to centralise
all HW description in a single place.
Currently it is spread over multiple places and it is very error prone, not
to mention that not everybody gets all the information at once.
Also, DT is meant to be shared by at least Bootloader and Linux, so it would
be better if it was unique.
Anyway, I tried to make a more concrete example further above.
Hopefully it serves to illustrate more the idea.
>> Indeed, to me it is clear that what we conceive "differently", is that
>> "the effort", "lack of benefit for the community", "Old bindings should
>> remain supported regardless" and "backward compatibility" are considered
>> with respect to DT *plus* driver, yet the idea is to have DT describe
>> HW for which there's no upstream driver yet.
>> Hence most of those considerations should not apply, right?
>
> No.
>
> Bindings themselves should remain stable over time in that they must be
> evolved so as to allow software to handle them in a stable fashion,
> supporting old and new DTBs.
Yes, but "must be evolved so as to allow software to handle them in a stable
fashion, supporting old and new DTBs." makes sense for Linux drivers, or
from Linux's perspective.
Project independence rules should allow for projects to cooperate without
interfering with each other.
>
> While a lot of that effort is taken by code, care must also be taken wit
> the bindings themselves, and those considerations apply.
IMHO, they apply only when there's a Linux driver, or any other public
user of such bindings. But if there's no user, it seems like an unnecessary
constraint.
Best regards,
Sebastian
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | linux.kernel
csiph-web