[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 9860370c2172704b6b4f0075a0c2a29fd84af96a
Status in newer kernel trees: 6.12.y | Not found 6.6.y | Not found 6.1.y | Not found
Note: The patch differs from the upstream commit: --- 1: 9860370c21727 ! 1: 849f99ff428f2 gpio: xilinx: Convert gpio_lock to raw spinlock @@ Metadata ## Commit message ## gpio: xilinx: Convert gpio_lock to raw spinlock
+ [ Upstream commit 9860370c2172704b6b4f0075a0c2a29fd84af96a ] + irq_chip functions may be called in raw spinlock context. Therefore, we must also use a raw spinlock for our own internal locking.
@@ Commit message Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250110163354.2012654-1-sean.anderson@linux.dev Signed-off-by: Bartosz Golaszewski bartosz.golaszewski@linaro.org + [ resolved conflicts ] + Signed-off-by: Sean Anderson sean.anderson@linux.dev
## drivers/gpio/gpio-xilinx.c ## @@ drivers/gpio/gpio-xilinx.c: struct xgpio_instance { @@ drivers/gpio/gpio-xilinx.c: struct xgpio_instance { - spinlock_t gpio_lock; /* For serializing operations */ + raw_spinlock_t gpio_lock; /* For serializing operations */ int irq; + struct irq_chip irqchip; DECLARE_BITMAP(enable, 64); - DECLARE_BITMAP(rising_edge, 64); @@ drivers/gpio/gpio-xilinx.c: static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val) struct xgpio_instance *chip = gpiochip_get_data(gc); int bit = xgpio_to_bit(chip, gpio); @@ drivers/gpio/gpio-xilinx.c: static void xgpio_irq_mask(struct irq_data *irq_data } - spin_unlock_irqrestore(&chip->gpio_lock, flags); + raw_spin_unlock_irqrestore(&chip->gpio_lock, flags); - - gpiochip_disable_irq(&chip->gc, irq_offset); } -@@ drivers/gpio/gpio-xilinx.c: static void xgpio_irq_unmask(struct irq_data *irq_data)
- gpiochip_enable_irq(&chip->gc, irq_offset); + /** +@@ drivers/gpio/gpio-xilinx.c: static void xgpio_irq_unmask(struct irq_data *irq_data) + u32 old_enable = xgpio_get_value32(chip->enable, bit); + u32 mask = BIT(bit / 32), val;
- spin_lock_irqsave(&chip->gpio_lock, flags); + raw_spin_lock_irqsave(&chip->gpio_lock, flags); ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success |