All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: timer: Add QEMU compatible strings
@ 2022-09-16 13:30 Jean-Philippe Brucker
  2022-09-17 16:51 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Philippe Brucker @ 2022-09-16 13:30 UTC (permalink / raw)
  To: maz, mark.rutland
  Cc: robh+dt, krzysztof.kozlowski+dt, linux-kernel, devicetree,
	Jean-Philippe Brucker

QEMU uses both "arm,armv8-timer" and "arm,armv7-timer" as compatible
string. Although it is unlikely that any guest relies on this, we can't
be certain of that. Therefore, add these to the schema. Clean up the
compatible list a little while at it.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
 .../devicetree/bindings/timer/arm,arch_timer.yaml   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml b/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
index df8ce87fd54b..fa03fc0fe320 100644
--- a/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
+++ b/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
@@ -22,16 +22,17 @@ properties:
   compatible:
     oneOf:
       - items:
-          - enum:
-              - arm,cortex-a15-timer
-          - enum:
-              - arm,armv7-timer
+          - const: arm,cortex-a15-timer
+          - const: arm,armv7-timer
       - items:
           - enum:
               - arm,armv7-timer
-      - items:
-          - enum:
               - arm,armv8-timer
+      - description: QEMU uses both compatible strings.
+          This format is deprecated.
+        items:
+          - const: arm,armv8-timer
+          - const: arm,armv7-timer
 
   interrupts:
     minItems: 1
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: timer: Add QEMU compatible strings
  2022-09-16 13:30 [PATCH] dt-bindings: timer: Add QEMU compatible strings Jean-Philippe Brucker
@ 2022-09-17 16:51 ` Krzysztof Kozlowski
  2022-09-17 18:47   ` Marc Zyngier
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-17 16:51 UTC (permalink / raw)
  To: Jean-Philippe Brucker, maz, mark.rutland
  Cc: robh+dt, krzysztof.kozlowski+dt, linux-kernel, devicetree

On 16/09/2022 14:30, Jean-Philippe Brucker wrote:
> QEMU uses both "arm,armv8-timer" and "arm,armv7-timer" as compatible
> string. Although it is unlikely that any guest relies on this, we can't
> be certain of that. Therefore, add these to the schema. Clean up the
> compatible list a little while at it.
> 
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

I guess you wanted to say QEMU uses "arm,armv8-timer" followed by
"arm,armv7-timer", because otherwise I would understand it that either
that or that. Anyway, is it a valid (virtualized) hardware? Is ARMv8
timer really, really compatible with ARMv7 one?

I don't think we should document invalid setups out-of-tree, just
because they are there, and something like this was also expressed by Rob:
https://lore.kernel.org/all/20220518163255.GE3302100-robh@kernel.org/

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: timer: Add QEMU compatible strings
  2022-09-17 16:51 ` Krzysztof Kozlowski
@ 2022-09-17 18:47   ` Marc Zyngier
  2022-09-18  8:50     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Zyngier @ 2022-09-17 18:47 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Jean-Philippe Brucker, mark.rutland, robh+dt,
	krzysztof.kozlowski+dt, linux-kernel, devicetree

On Sat, 17 Sep 2022 17:51:20 +0100,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
> On 16/09/2022 14:30, Jean-Philippe Brucker wrote:
> > QEMU uses both "arm,armv8-timer" and "arm,armv7-timer" as compatible
> > string. Although it is unlikely that any guest relies on this, we can't
> > be certain of that. Therefore, add these to the schema. Clean up the
> > compatible list a little while at it.
> > 
> > Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> 
> I guess you wanted to say QEMU uses "arm,armv8-timer" followed by
> "arm,armv7-timer", because otherwise I would understand it that either
> that or that. Anyway, is it a valid (virtualized) hardware? Is ARMv8
> timer really, really compatible with ARMv7 one?

Yes. There isn't a shred of difference between the two in the earlier
revisions of the ARMv8 architecture, and none of the differences
introduced in later revisions are exposed to DT anyway.

> I don't think we should document invalid setups out-of-tree, just
> because they are there, and something like this was also expressed by Rob:
> https://lore.kernel.org/all/20220518163255.GE3302100-robh@kernel.org/

This is, on the contrary, something that is perfectly valid. For
example, a system running a 32bit OS on a 64bit system is perfectly
entitled to expose both (v8 because that's what the HW is, v7 because
that's what the OS is the most likely to understand).

You may find it odd, but that:

- expresses something that is actually required

- is what I, as the original author of this binding, have always
  considered valid

- has been valid for a long time (10+ years) before you decided it
  suddenly wasn't

I understand that the "DT police" has high standards, but this has
been around for much longer, and it isn't because the conversion to
schema is imperfect that you can rewrite history.

As for the patch, I'd remove the QEMU reference and the deprecation.
This format is perfectly allowed, and is in use in most VMMs out
there. Yes, DT is an ABI.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: timer: Add QEMU compatible strings
  2022-09-17 18:47   ` Marc Zyngier
@ 2022-09-18  8:50     ` Krzysztof Kozlowski
  2022-09-18  9:09       ` Marc Zyngier
  2022-09-22 15:43       ` Jean-Philippe Brucker
  0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-18  8:50 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Jean-Philippe Brucker, mark.rutland, robh+dt,
	krzysztof.kozlowski+dt, linux-kernel, devicetree

On 17/09/2022 19:47, Marc Zyngier wrote:
> On Sat, 17 Sep 2022 17:51:20 +0100,
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 16/09/2022 14:30, Jean-Philippe Brucker wrote:
>>> QEMU uses both "arm,armv8-timer" and "arm,armv7-timer" as compatible
>>> string. Although it is unlikely that any guest relies on this, we can't
>>> be certain of that. Therefore, add these to the schema. Clean up the
>>> compatible list a little while at it.
>>>
>>> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
>>
>> I guess you wanted to say QEMU uses "arm,armv8-timer" followed by
>> "arm,armv7-timer", because otherwise I would understand it that either
>> that or that. Anyway, is it a valid (virtualized) hardware? Is ARMv8
>> timer really, really compatible with ARMv7 one?
> 
> Yes. There isn't a shred of difference between the two in the earlier
> revisions of the ARMv8 architecture, and none of the differences
> introduced in later revisions are exposed to DT anyway.
> 
>> I don't think we should document invalid setups out-of-tree, just
>> because they are there, and something like this was also expressed by Rob:
>> https://lore.kernel.org/all/20220518163255.GE3302100-robh@kernel.org/
> 
> This is, on the contrary, something that is perfectly valid. For
> example, a system running a 32bit OS on a 64bit system is perfectly
> entitled to expose both (v8 because that's what the HW is, v7 because
> that's what the OS is the most likely to understand).
> 
> You may find it odd, but that:
> 
> - expresses something that is actually required
> 
> - is what I, as the original author of this binding, have always
>   considered valid
> 
> - has been valid for a long time (10+ years) before you decided it
>   suddenly wasn't
> 
> I understand that the "DT police" has high standards, but this has
> been around for much longer, and it isn't because the conversion to
> schema is imperfect that you can rewrite history.
> 
> As for the patch, I'd remove the QEMU reference and the deprecation.
> This format is perfectly allowed, and is in use in most VMMs out
> there. Yes, DT is an ABI.

Thanks for the explanation, actually enough was to say that it is
perfectly valid combination describing hardware. :)


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: timer: Add QEMU compatible strings
  2022-09-18  8:50     ` Krzysztof Kozlowski
@ 2022-09-18  9:09       ` Marc Zyngier
  2022-09-22 15:43       ` Jean-Philippe Brucker
  1 sibling, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2022-09-18  9:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Jean-Philippe Brucker, mark.rutland, robh+dt,
	krzysztof.kozlowski+dt, linux-kernel, devicetree

On Sun, 18 Sep 2022 09:50:58 +0100,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
> On 17/09/2022 19:47, Marc Zyngier wrote:
> > On Sat, 17 Sep 2022 17:51:20 +0100,
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> On 16/09/2022 14:30, Jean-Philippe Brucker wrote:
> >>> QEMU uses both "arm,armv8-timer" and "arm,armv7-timer" as compatible
> >>> string. Although it is unlikely that any guest relies on this, we can't
> >>> be certain of that. Therefore, add these to the schema. Clean up the
> >>> compatible list a little while at it.
> >>>
> >>> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> >>
> >> I guess you wanted to say QEMU uses "arm,armv8-timer" followed by
> >> "arm,armv7-timer", because otherwise I would understand it that either
> >> that or that. Anyway, is it a valid (virtualized) hardware? Is ARMv8
> >> timer really, really compatible with ARMv7 one?
> > 
> > Yes. There isn't a shred of difference between the two in the earlier
> > revisions of the ARMv8 architecture, and none of the differences
> > introduced in later revisions are exposed to DT anyway.
> > 
> >> I don't think we should document invalid setups out-of-tree, just
> >> because they are there, and something like this was also expressed by Rob:
> >> https://lore.kernel.org/all/20220518163255.GE3302100-robh@kernel.org/
> > 
> > This is, on the contrary, something that is perfectly valid. For
> > example, a system running a 32bit OS on a 64bit system is perfectly
> > entitled to expose both (v8 because that's what the HW is, v7 because
> > that's what the OS is the most likely to understand).
> > 
> > You may find it odd, but that:
> > 
> > - expresses something that is actually required
> > 
> > - is what I, as the original author of this binding, have always
> >   considered valid
> > 
> > - has been valid for a long time (10+ years) before you decided it
> >   suddenly wasn't
> > 
> > I understand that the "DT police" has high standards, but this has
> > been around for much longer, and it isn't because the conversion to
> > schema is imperfect that you can rewrite history.
> > 
> > As for the patch, I'd remove the QEMU reference and the deprecation.
> > This format is perfectly allowed, and is in use in most VMMs out
> > there. Yes, DT is an ABI.
> 
> Thanks for the explanation, actually enough was to say that it is
> perfectly valid combination describing hardware. :)

Assuming that the original posting was wrong without understanding the
context is what triggered it. It is absolutely fine not to know these
things, but in this case *do ask questions* rather than dismiss the
patch off the bat based of third hand conclusions.

Now at least you have the full picture.

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: timer: Add QEMU compatible strings
  2022-09-18  8:50     ` Krzysztof Kozlowski
  2022-09-18  9:09       ` Marc Zyngier
@ 2022-09-22 15:43       ` Jean-Philippe Brucker
  1 sibling, 0 replies; 6+ messages in thread
From: Jean-Philippe Brucker @ 2022-09-22 15:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Marc Zyngier, mark.rutland, robh+dt, krzysztof.kozlowski+dt,
	linux-kernel, devicetree

On Sun, Sep 18, 2022 at 09:50:58AM +0100, Krzysztof Kozlowski wrote:
> > As for the patch, I'd remove the QEMU reference and the deprecation.
> > This format is perfectly allowed, and is in use in most VMMs out
> > there. Yes, DT is an ABI.
> 
> Thanks for the explanation, actually enough was to say that it is
> perfectly valid combination describing hardware. :)
> 
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Thanks Krzysztof, I'll rework the commit message and resend

Thanks,
Jean

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-22 15:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 13:30 [PATCH] dt-bindings: timer: Add QEMU compatible strings Jean-Philippe Brucker
2022-09-17 16:51 ` Krzysztof Kozlowski
2022-09-17 18:47   ` Marc Zyngier
2022-09-18  8:50     ` Krzysztof Kozlowski
2022-09-18  9:09       ` Marc Zyngier
2022-09-22 15:43       ` Jean-Philippe Brucker

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.