From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Nicolas Saenz Julienne" <nsaenz@kernel.org>,
"Jim Quinlan" <jim2101024@gmail.com>,
"maintainer:BROADCOM STB PCIE DRIVER"
<bcm-kernel-feedback-list@broadcom.com>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-rpi-kernel@lists.infradead.org>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
"open list:BROADCOM STB PCIE DRIVER" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: brcmstb: Do not use __GENMASK
Date: Mon, 22 Nov 2021 21:26:04 +0200 [thread overview]
Message-ID: <CAHp75VeFZH9364CK8Z5_uMk2WoqkJB-SWdmKodqAML59i7ckfw@mail.gmail.com> (raw)
In-Reply-To: <20211122190459.3189616-1-f.fainelli@gmail.com>
On Mon, Nov 22, 2021 at 9:07 PM Florian Fainelli <f.fainelli@gmail.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@gmail.com>
> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.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
next prev parent reply other threads:[~2021-11-22 19:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 19:04 [PATCH] PCI: brcmstb: Do not use __GENMASK Florian Fainelli
2021-11-22 19:26 ` Andy Shevchenko [this message]
2021-12-01 16:37 ` Lorenzo Pieralisi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHp75VeFZH9364CK8Z5_uMk2WoqkJB-SWdmKodqAML59i7ckfw@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=f.fainelli@gmail.com \
--cc=jim2101024@gmail.com \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=nsaenz@kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).