Re: [PATCH v3 1/3] checks: Add interrupt provider test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Tue, Jun 2, 2020 at 5:05 AM Andre Przywara <andre.przywara@xxxxxxx> wrote:
>
> An interrupt provider (an actual interrupt-controller node or an
> interrupt nexus) should have both #address-cells and #interrupt-cells
> properties explicitly defined.
>
> Add an extra test for this. We check for the #interrupt-cells property
> already, but this does not cover every controller so far, only those that
> get referenced by an interrupts property in some node. Also we miss
> interrupt nexus nodes.
>
> A missing #address-cells property is less critical, but creates
> ambiguities when used in interrupt-map properties, so warn about this as
> well now.
> This removes the now redundant warning in the existing interrupts test.
>
> Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>
> ---
>  checks.c                           | 32 ++++++++++++++++++++++++++------
>  tests/bad-interrupt-controller.dts |  7 +++++++
>  tests/run_tests.sh                 |  1 +
>  3 files changed, 34 insertions(+), 6 deletions(-)
>  create mode 100644 tests/bad-interrupt-controller.dts
>
> diff --git a/checks.c b/checks.c
> index 4b3c486..23faca5 100644
> --- a/checks.c
> +++ b/checks.c
> @@ -1547,6 +1547,28 @@ static bool node_is_interrupt_provider(struct node *node)
>
>         return false;
>  }
> +
> +static void check_interrupt_provider(struct check *c,
> +                                    struct dt_info *dti,
> +                                    struct node *node)
> +{
> +       struct property *prop;
> +
> +       if (!node_is_interrupt_provider(node))
> +               return;
> +
> +       prop = get_property(node, "#interrupt-cells");
> +       if (!prop)
> +               FAIL(c, dti, node,
> +                    "Missing #interrupt-cells in interrupt provider");
> +
> +       prop = get_property(node, "#address-cells");
> +       if (!prop)
> +               FAIL(c, dti, node,
> +                    "Missing #address-cells in interrupt provider");

This is still not a separate test. We should be able to continue
checking for '#interrupt-cells' while turning the '#address-cells'
check on or off. IOW, we can't test for what the Linux kernel cares
about. Though if there's only a handful of warnings to fix, then it's
fine for me as-is.

Rob



[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux