From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>,
Srinivas Neeli <srinivas.neeli@amd.com>,
Michal Simek <michal.simek@amd.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: [PATCH v1 2/2] gpio: xilinx: Replace custom variants of bitmap_read()/bitmap_write()
Date: Wed, 5 Feb 2025 11:15:47 +0200 [thread overview]
Message-ID: <Z6MsQ7iFnhcugguR@smile.fi.intel.com> (raw)
In-Reply-To: <20250204190218.243537-3-andriy.shevchenko@linux.intel.com>
On Tue, Feb 04, 2025 at 09:00:48PM +0200, Andy Shevchenko wrote:
> Relatively recently bitmap APIs were expanded by introduction of
> bitmap_read() and bitmap_write(). These APIs are generic ones
> that may replace custom functions in this driver, i.e. xgpio_get_value32()
> and xgpio_set_value32(). Do replace them.
...
> @@ -386,13 +371,14 @@ static void xgpio_irq_mask(struct irq_data *irq_data)
> struct xgpio_instance *chip = irq_data_get_irq_chip_data(irq_data);
> int irq_offset = irqd_to_hwirq(irq_data);
> unsigned long bit = find_nth_bit(chip->map, 64, irq_offset);
> + unsigned long old_enable = bitmap_read(chip->enable, round_down(bit, 32), 32);
> u32 mask = BIT(bit / 32), temp;
>
> raw_spin_lock_irqsave(&chip->gpio_lock, flags);
>
> __clear_bit(bit, chip->enable);
>
> - if (xgpio_get_value32(chip->enable, bit) == 0) {
> + if (old_enable == 0) {
Oh, this one is incorrect.
> /* Disable per channel interrupt */
> temp = xgpio_readreg(chip->regs + XGPIO_IPIER_OFFSET);
> temp &= ~mask;
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2025-02-05 9:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 19:00 [PATCH v1 0/2] gpio: xilinx: Replace custom bitmap APIs Andy Shevchenko
2025-02-04 19:00 ` [PATCH v1 1/2] gpio: xilinx: Use better bitmap APIs where appropriate Andy Shevchenko
2025-02-04 19:00 ` [PATCH v1 2/2] gpio: xilinx: Replace custom variants of bitmap_read()/bitmap_write() Andy Shevchenko
2025-02-05 9:15 ` Andy Shevchenko [this message]
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=Z6MsQ7iFnhcugguR@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=shubhrajyoti.datta@amd.com \
--cc=srinivas.neeli@amd.com \
/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).