linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: "David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Ralf Baechle" <ralf@linux-mips.org>,
	"Paul Burton" <paulburton@kernel.org>,
	"James Hogan" <jhogan@kernel.org>,
	"Kukjin Kim" <kgene@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Jonathan Bakker" <xc-racer2@live.ca>,
	"Philipp Rossak" <embed3d@gmail.com>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	openpvrsgx-devgroup@letux.org, letux-kernel@openphoenux.org,
	kernel@pyra-handheld.com, linux-mips@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH v7 01/12] dt-bindings: add img,pvrsgx.yaml for Imagination GPUs
Date: Sun, 03 May 2020 16:18:08 +0200	[thread overview]
Message-ID: <8EER9Q.C206SXNSICP7@crapouillou.net> (raw)
In-Reply-To: <3D8B59D6-83E3-4FE6-9C99-E2E5616A8139@goldelico.com>



Le dim. 3 mai 2020 à 15:31, H. Nikolaus Schaller <hns@goldelico.com> a 
écrit :
> Hi Paul,
> 
>>  Am 03.05.2020 um 14:52 schrieb Paul Cercueil <paul@crapouillou.net>:
>> 
>>>>  It's possible to forbid the presence of the 'clocks' property on 
>>>> some implementations, and require it on others.
>>>  To be precise we have to specify the exact number of clocks 
>>> (between 0 and 4) for every architecture.
>>>  This also contradicts my dream to get rid of the architecture 
>>> specific components in the long run. My dream (because I can't tell 
>>> how it can be done) is that we can one day develop something which 
>>> just needs compatible = img,530 or imp,540 or img,544. Then we 
>>> can't make the number clocks depend on the implementation any more.
>> 
>>  As we said before, the number of clocks is a property of the GPU 
>> and *not* its integration into the SoC.
> 
> Well, it is a not very well documented property of the GPU. We have 
> no data sheet of the standalone GPU. Only several SoC data sheets 
> which give some indications.

Maybe we can nicely ask them?

I expect Paul Burton to have some contacts at ImgTec. Asking for a doc 
would be too much, but maybe they can help a bit with the DT bindings.

> It appears as if some sgx5xx versions have 3 clocks and some have 4. 
> So you are right, the number of clocks depends on the sgx5xx version 
> and that could be made dependent in the bindings (if necessary).
> 
>> 
>>  So you would *not* have a number of clocks between 0 and 4. You get 
>> either 0, or 4, depending on whether or not you have a wrapper.
> 
> I think this is contradicting your previous sentence. If the number 
> of clocks is a property of the GPU and not the integration it must 
> also not depend on whether there is a wrapper. I.e. it must be a 
> constant for any type of integration.

Well, I expected all SGX versions to have 4 clocks.

If some SGX versions have 3 clocks, and others have 4 clocks, it's 
still OK as long as the number of clocks is enforced, so that all 
implementations of a given SGX core will have to use the same number of 
clocks.

> The really correct variant would be to always make the SoC 
> integration (wrapper) a separate subsystem (because it is never part 
> of the SGX core but some interface bus) and clock provider and 
> connect it explicitly to the clock inputs.

About the wrapper... I don't really know how it's done there. But you 
could very well pass all clocks unconditionally to the SGX node, even 
if it's inside a wrapper.
The wrapper itself probably needs only one clock, the one that allows 
it to access its registers.

> To be clear: I am not at all against describing the clocks. I just 
> doubt that the time we invest into discussing on this level of detail 
> and adding conditional clock requirements is worth the result. IMHO 
> the bindings and .dts do not become better by describing them in more 
> detail than just "optional". It just takes our time from contributing 
> to other subsystems.
> 

You have a new SoC with a SGX, and you only need to enable one clock to 
get it to work. So you create a devicetree node which receives only one 
clock.

Turns out, that the bootloader was enabling the other 3 clocks, and 
since the last release, it doesn't anymore. You're left with having to 
support a broken devicetree.

That's the kind of problem that can be easily avoided by enforcing the 
number of clocks that have to be provided.
>> 
>> 
>>>>  See how it's done for instance on 
>>>> Documentation/devicetree/bindings/serial/samsung_uart.yaml.
>>>  Yes I know the design pattern, but I wonder if such a move makes 
>>> the whole thing even less maintainable.
>>>  Assume we have finished DTS for some SoC. Then these DTS have been 
>>> tested on real hardware and are working. Clocks are there where 
>>> needed and missing where not. We may now forbid or not forbid them 
>>> for some implementations in the bindings.yaml but the result of 
>>> dtbs_check won't change! Because they are tested and working and 
>>> the bindings.yaml has been adapted to the result. So we have just 
>>> duplicated something for no practical benefit.
>>>  Next, assume there is coming support for more and more new SoC. 
>>> Then, developers not only have to figure out which clocks they need 
>>> in the DTS but they also have to add a patch to the implementation 
>>> specific part of the bindings.yaml to clearly define exactly the 
>>> same what they already have written into their .dts (the clocks are 
>>> either there for the of_node or they are not). So again the rules 
>>> are for no benefit, since a new SoC is introduced exactly once. And 
>>> tested if it works. And if it is there, it will stay as it is. It 
>>> is just work for maintainers to review that patch as well.
>> 
>>  If you add support for a new SoC, you'd still need to modify the 
>> binding to add the compatible string. So the argument of "more work" 
>> is moot.
> 
> Agreed, I forgot this aspect. Nevertheless, it is easier to review a 
> new compatible string than a new clock number rule (question: how do 
> you practically review this? By looking if it does match the DTS?).
> 
> We have to add the compatible string as long as we need to have the 
> SoC name in the compatible string (which as said is my dream to get 
> rid of in far future). If we could get rid of it, there won't be a 
> change any more. By just taking "img,sgx544" into a new SoC. The 
> change would be moved into SoC specific wrappers. In such an ideal 
> world, we would explicitly describe the wrappers as separate DT 
> nodes. Even if they have no explicit driver (e.g. by some 
> simple-pm-bus).

What's wrong with having the SoC name in the compatible string?

You cannot use just a "img,sgx544" compatible string, as then you would 
assume that the same SGX version in (e.g.) an Ingenic or a Omap SoC is 
the exact same. This may actually be true. But the moment you discover 
even a tiny thing that needs to be handled differently, you wouldn't 
have the possibility to do so.

>                    PRCM,bus,
> Processor <<---->> Wrapper <<----->> SGX
> ti,...             ti,sysc           img,sgx530
> img,...            simple-bus        img,sgx540
> samsung,...        ...               img,sgx544
> other,             other,gpu-wrapper img,...
> 
> But this IMHO correct proposal was already rejected.
> 
> So at the moment we are circling around several proposals because 
> none can fulfill all requirements.
> 
> Therefore my attempt to solve the gordian knot is to make clocks 
> generally optional. This keeps the bindings simple but not generally 
> wrong. And since the DTS are not only tested against bindings.yaml 
> but on real hardware, the omission to enforce a specific number of 
> clocks doesn't harm anyone. As said it is impossible to get the SGX 
> running without defining the correct clocks (whether they are 
> enforced by bindings.yaml or not).

That's what I tried to explain above. You'd be able to get the SGX to 
work without a single clock in devicetree. That doesn't mean it should 
be allowed.

Cheers,
-Paul



  reply	other threads:[~2020-05-03 14:18 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 20:34 [PATCH v7 00/12] ARM/MIPS: DTS: add child nodes describing the PVRSGX GPU present in some OMAP SoC and JZ4780 (and many more) H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 01/12] dt-bindings: add img,pvrsgx.yaml for Imagination GPUs H. Nikolaus Schaller
2020-04-24 20:43   ` H. Nikolaus Schaller
2020-04-26 13:11   ` Paul Cercueil
2020-05-02 20:26     ` H. Nikolaus Schaller
2020-05-03 12:52       ` Paul Cercueil
2020-05-03 13:31         ` H. Nikolaus Schaller
2020-05-03 14:18           ` Paul Cercueil [this message]
2020-05-03 15:01             ` Tony Lindgren
2020-05-15  7:58               ` H. Nikolaus Schaller
2020-05-03 16:41             ` H. Nikolaus Schaller
2020-05-15  7:18               ` H. Nikolaus Schaller
2020-04-26 19:36   ` Philipp Rossak
2020-04-26 20:59     ` H. Nikolaus Schaller
2020-05-05 15:53   ` Rob Herring
2020-05-15  7:59     ` H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 02/12] ARM: DTS: am33xx: add sgx gpu child node H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 03/12] ARM: DTS: am3517: " H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 04/12] ARM: DTS: omap34xx: " H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 05/12] ARM: DTS: omap36xx: " H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 06/12] ARM: DTS: omap4: " H. Nikolaus Schaller
2020-04-26 12:50   ` Paul Cercueil
2020-04-28  7:59     ` H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 07/12] ARM: DTS: omap5: " H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 08/12] arm: dts: s5pv210: Add node for SGX 540 H. Nikolaus Schaller
2020-04-26 12:56   ` Paul Cercueil
2020-04-26 14:57     ` Jonathan Bakker
2020-04-27 15:46       ` Krzysztof Kozlowski
2020-04-28 21:39         ` Jonathan Bakker
2020-04-28 22:58           ` Jonathan Bakker
2020-04-29  8:47             ` Maxime Ripard
2020-04-29 12:26             ` Paul Cercueil
2020-04-24 20:34 ` [PATCH v7 09/12] ARM: dts: sun6i: a31: add sgx gpu child node H. Nikolaus Schaller
2020-04-26 12:53   ` Paul Cercueil
2020-04-26 19:31     ` Philipp Rossak
2020-04-24 20:34 ` [PATCH v7 10/12] ARM: dts: sun6i: a31s: " H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 11/12] ARM: dts: sun8i: a83t: " H. Nikolaus Schaller
2020-04-24 20:34 ` [PATCH v7 12/12] MIPS: DTS: jz4780: add sgx gpu node H. Nikolaus Schaller

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=8EER9Q.C206SXNSICP7@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=airlied@linux.ie \
    --cc=bcousson@baylibre.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=embed3d@gmail.com \
    --cc=hns@goldelico.com \
    --cc=jhogan@kernel.org \
    --cc=kernel@pyra-handheld.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mripard@kernel.org \
    --cc=openpvrsgx-devgroup@letux.org \
    --cc=paulburton@kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    --cc=tsbogend@alpha.franken.de \
    --cc=wens@csie.org \
    --cc=xc-racer2@live.ca \
    /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).