lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Jun 2022 09:55:02 -0600
From:   Rob Herring <robh@...nel.org>
To:     Jean-Philippe Brucker <jean-philippe@...aro.org>
Cc:     Thomas Lendacky <thomas.lendacky@....com>,
        David Miller <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "Lad, Prabhakar" <prabhakar.mahadev-lad.rj@...renesas.com>,
        Marc Zyngier <maz@...nel.org>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] amd-xgbe: Use platform_irq_count()

On Thu, Jun 9, 2022 at 10:20 AM Jean-Philippe Brucker
<jean-philippe@...aro.org> wrote:
>
> The AMD XGbE driver currently counts the number of interrupts assigned
> to the device by inspecting the pdev->resource array. Since commit
> a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT
> core") removed IRQs from this array, the driver now attempts to get all
> interrupts from 1 to -1U and gives up probing once it reaches an invalid
> interrupt index.
>
> Obtain the number of IRQs with platform_irq_count() instead.
>
> Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core")
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@...aro.org>
> ---
>  drivers/net/ethernet/amd/xgbe/xgbe-platform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-platform.c b/drivers/net/ethernet/amd/xgbe/xgbe-platform.c
> index 4ebd2410185a..4d790a89fe77 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-platform.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-platform.c
> @@ -338,7 +338,7 @@ static int xgbe_platform_probe(struct platform_device *pdev)
>                  *   the PHY resources listed last
>                  */
>                 phy_memnum = xgbe_resource_count(pdev, IORESOURCE_MEM) - 3;
> -               phy_irqnum = xgbe_resource_count(pdev, IORESOURCE_IRQ) - 1;
> +               phy_irqnum = platform_irq_count(pdev) - 1;
>                 dma_irqnum = 1;
>                 dma_irqend = phy_irqnum;
>         } else {
> @@ -348,7 +348,7 @@ static int xgbe_platform_probe(struct platform_device *pdev)
>                 phy_memnum = 0;
>                 phy_irqnum = 0;
>                 dma_irqnum = 1;
> -               dma_irqend = xgbe_resource_count(pdev, IORESOURCE_IRQ);
> +               dma_irqend = platform_irq_count(pdev);

This is some ugly code... This clause is for 'old style' DT (which
actually looks more correct to me then 'new style' which seems
influenced by ACPI). Is there a need to continue carrying support for
old DTs? How many users of Seattle with DT are there?

In any case, that's all a separate change on top of this I think.

Acked-by: Rob Herring <robh@...nel.org>

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ