[PATCH v4] gpio: amdptpci: add support for AMD PT PCI controller

From: Szuying Chen

Date: Thu Dec 03 2026 - 21:16:06 EST


Hi Linus,

Thanks for the review.


>(...)

>> +#include <linux/bits.h>
>> +#include <linux/gpio/driver.h>
>> +#include <linux/gpio/generic.h>

>> +static void pt27_irq_ack(struct irq_data *d) {
>> + struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
>> + struct pt27_gpio *chip = gpiochip_get_data(gc);
>> +
>> + iowrite32(BIT(irqd_to_hwirq(d)), chip->base +
>> +PT27_REG_INT_STAT); }

> No need to use the lock here? I think this should probably take a lock
> and use read-modify-write, think about what happens if two interrupts
> arrive at the same time.

INT_STAT is write-1-to-clear, so writing BIT(hwirq) only affects that
line and needs no lock. If two interrupts arrive at the same time, both
bits are set in INT_STAT; the ISR dispatches them one by one and each ack
clears only its own bit, so the other line stays pending until it is
handled.

> Other than that it looks good, but look into Sashiko's comments too.

I went through the Sashiko review and addressed the points in v5.

> Yours,
> Linus Walleij

Best regards,
Szuying