diff mbox series

[02/10] hw/arm/boot: Fix devicetree warning about the PSCI node

Message ID 20220824155113.286730-3-jean-philippe@linaro.org
State New
Headers show
Series hw/arm/virt: Fix dt-schema warnings | expand

Commit Message

Jean-Philippe Brucker Aug. 24, 2022, 3:51 p.m. UTC
dt-validate warns that an implementation compatible with arm,psci-1.0
shouldn't have arm,psci in their compatible string.

  psci: compatible: 'oneOf' conditional failed, one must be fixed:
	['arm,psci-1.0', 'arm,psci-0.2', 'arm,psci'] is too long
  From schema: linux/Documentation/devicetree/bindings/arm/psci.yaml

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
 hw/arm/boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell Aug. 24, 2022, 7:33 p.m. UTC | #1
On Wed, 24 Aug 2022 at 16:51, Jean-Philippe Brucker
<jean-philippe@linaro.org> wrote:
>
> dt-validate warns that an implementation compatible with arm,psci-1.0
> shouldn't have arm,psci in their compatible string.
>
>   psci: compatible: 'oneOf' conditional failed, one must be fixed:
>         ['arm,psci-1.0', 'arm,psci-0.2', 'arm,psci'] is too long
>   From schema: linux/Documentation/devicetree/bindings/arm/psci.yaml
>
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> ---
>  hw/arm/boot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/arm/boot.c b/hw/arm/boot.c
> index ada2717f76..527918227e 100644
> --- a/hw/arm/boot.c
> +++ b/hw/arm/boot.c
> @@ -493,7 +493,7 @@ static void fdt_add_psci_node(void *fdt)
>              const char comp[] = "arm,psci-0.2\0arm,psci";
>              qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));
>          } else {
> -            const char comp[] = "arm,psci-1.0\0arm,psci-0.2\0arm,psci";
> +            const char comp[] = "arm,psci-1.0\0arm,psci-0.2";
>              qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));
>          }

This doesn't look right.
Documentation/devicetree/bindings/arm/psci.yaml says
"arm,psci-1.0" means "complies to PSCI 1.0",
"arm,psci-0.2" means "complies to PSCI 0.2",
and "arm,psci" means "complies to pre-0.2 PSCI"

If you want to drop "arm,psci" then you should be arguing why
we're not compliant with pre-0.2 PSCI. Maybe we aren't and we
shouldn't be advertising it, but you need more rationale than
"dt-validate complained".

thanks
-- PMM
Jean-Philippe Brucker Sept. 1, 2022, 2:53 p.m. UTC | #2
On Wed, Aug 24, 2022 at 08:33:54PM +0100, Peter Maydell wrote:
> On Wed, 24 Aug 2022 at 16:51, Jean-Philippe Brucker
> <jean-philippe@linaro.org> wrote:
> >
> > dt-validate warns that an implementation compatible with arm,psci-1.0
> > shouldn't have arm,psci in their compatible string.
> >
> >   psci: compatible: 'oneOf' conditional failed, one must be fixed:
> >         ['arm,psci-1.0', 'arm,psci-0.2', 'arm,psci'] is too long
> >   From schema: linux/Documentation/devicetree/bindings/arm/psci.yaml
> >
> > Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> > ---
> >  hw/arm/boot.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/hw/arm/boot.c b/hw/arm/boot.c
> > index ada2717f76..527918227e 100644
> > --- a/hw/arm/boot.c
> > +++ b/hw/arm/boot.c
> > @@ -493,7 +493,7 @@ static void fdt_add_psci_node(void *fdt)
> >              const char comp[] = "arm,psci-0.2\0arm,psci";
> >              qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));
> >          } else {
> > -            const char comp[] = "arm,psci-1.0\0arm,psci-0.2\0arm,psci";
> > +            const char comp[] = "arm,psci-1.0\0arm,psci-0.2";
> >              qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));
> >          }
> 
> This doesn't look right.
> Documentation/devicetree/bindings/arm/psci.yaml says
> "arm,psci-1.0" means "complies to PSCI 1.0",
> "arm,psci-0.2" means "complies to PSCI 0.2",
> and "arm,psci" means "complies to pre-0.2 PSCI"
> 
> If you want to drop "arm,psci" then you should be arguing why
> we're not compliant with pre-0.2 PSCI. Maybe we aren't and we
> shouldn't be advertising it, but you need more rationale than
> "dt-validate complained".

Yes I agree, and that's my mistake. Rob already relaxed the bindings
https://lore.kernel.org/all/20220803201639.2552581-1-robh@kernel.org/
but that's queued for v6.1 and I was validating against mainline.
I'll drop the patch

Thanks,
Jean
diff mbox series

Patch

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index ada2717f76..527918227e 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -493,7 +493,7 @@  static void fdt_add_psci_node(void *fdt)
             const char comp[] = "arm,psci-0.2\0arm,psci";
             qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));
         } else {
-            const char comp[] = "arm,psci-1.0\0arm,psci-0.2\0arm,psci";
+            const char comp[] = "arm,psci-1.0\0arm,psci-0.2";
             qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));
         }