On Thu, Oct 28, 2021 at 11:52 AM Sander Vanheule <sander@xxxxxxxxxxxxx> wrote: > > The irqchip uses one domain for all GPIO lines, so the line offset > should be determined w.r.t. the first line of the first port, not the > first line of the triggered port. > > Fixes: 0d82fb1127fb ("gpio: Add Realtek Otto GPIO support") Not sure it fixes anything (it wasn't working from day 1), but in any case the patch is good. > Signed-off-by: Sander Vanheule <sander@xxxxxxxxxxxxx> > --- > drivers/gpio/gpio-realtek-otto.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c > index eeeb39bc171d..bd75401b549d 100644 > --- a/drivers/gpio/gpio-realtek-otto.c > +++ b/drivers/gpio/gpio-realtek-otto.c > @@ -205,7 +205,7 @@ static void realtek_gpio_irq_handler(struct irq_desc *desc) > status = realtek_gpio_read_isr(ctrl, lines_done / 8); > port_pin_count = min(gc->ngpio - lines_done, 8U); > for_each_set_bit(offset, &status, port_pin_count) > - generic_handle_domain_irq(gc->irq.domain, offset); > + generic_handle_domain_irq(gc->irq.domain, offset + lines_done); Looking into these '/ 8', '8U' sounds to me that it may be a good idea to switch to for_each_set_clump8(). But it's out of scope here. > } > > chained_irq_exit(irq_chip, desc); > -- > 2.31.1 > -- With Best Regards, Andy Shevchenko