[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z6MsQ7iFnhcugguR@smile.fi.intel.com>
Date: Wed, 5 Feb 2025 11:15:47 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
linux-gpio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: Shubhrajyoti Datta <shubhrajyoti.datta@....com>,
Srinivas Neeli <srinivas.neeli@....com>,
Michal Simek <michal.simek@....com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>
Subject: Re: [PATCH v1 2/2] gpio: xilinx: Replace custom variants of
bitmap_read()/bitmap_write()
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
Powered by blists - more mailing lists