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]
Message-ID: <CAHp75VeFZH9364CK8Z5_uMk2WoqkJB-SWdmKodqAML59i7ckfw@mail.gmail.com>
Date:   Mon, 22 Nov 2021 21:26:04 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Nicolas Saenz Julienne <nsaenz@...nel.org>,
        Jim Quinlan <jim2101024@...il.com>,
        "maintainer:BROADCOM STB PCIE DRIVER" 
        <bcm-kernel-feedback-list@...adcom.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Rob Herring <robh@...nel.org>,
        Krzysztof WilczyƄski <kw@...ux.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" 
        <linux-rpi-kernel@...ts.infradead.org>,
        "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        "open list:BROADCOM STB PCIE DRIVER" <linux-pci@...r.kernel.org>
Subject: Re: [PATCH] PCI: brcmstb: Do not use __GENMASK

On Mon, Nov 22, 2021 at 9:07 PM Florian Fainelli <f.fainelli@...il.com> wrote:
>
> Define the legacy MSI intterupt bitmask as well as the non-legacy

interrupt

> interrupt bitmask using GENMASK and then use them in brcm_msi_set_regs()
> in place of __GENMASK().

LGTM, thanks!
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>

> Reported-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
>  drivers/pci/controller/pcie-brcmstb.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> index 1fc7bd49a7ad..3391b4135b65 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -144,6 +144,9 @@
>  #define BRCM_INT_PCI_MSI_NR            32
>  #define BRCM_INT_PCI_MSI_LEGACY_NR     8
>  #define BRCM_INT_PCI_MSI_SHIFT         0
> +#define BRCM_INT_PCI_MSI_MASK          GENMASK(BRCM_INT_PCI_MSI_NR - 1, 0)
> +#define BRCM_INT_PCI_MSI_LEGACY_MASK   GENMASK(31, \
> +                                               32 - BRCM_INT_PCI_MSI_LEGACY_NR)
>
>  /* MSI target addresses */
>  #define BRCM_MSI_TARGET_ADDR_LT_4GB    0x0fffffffcULL
> @@ -619,7 +622,8 @@ static void brcm_msi_remove(struct brcm_pcie *pcie)
>
>  static void brcm_msi_set_regs(struct brcm_msi *msi)
>  {
> -       u32 val = __GENMASK(31, msi->legacy_shift);
> +       u32 val = msi->legacy ? BRCM_INT_PCI_MSI_LEGACY_MASK :
> +                               BRCM_INT_PCI_MSI_MASK;
>
>         writel(val, msi->intr_base + MSI_INT_MASK_CLR);
>         writel(val, msi->intr_base + MSI_INT_CLR);
> --
> 2.25.1
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ