From 34c16f1a20733de8aff7657cdf29a04266993ccd Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 22 Apr 2022 10:23:41 +0200 Subject: [PATCH] Revert "gpio: Restrict usage of GPIO chip irq members before initialization" This reverts commit 0912cf021fb5749372b3782611d8b1de4986c13a. It breaks the kernel abi so revert it for now. We will add it back later at the next kabi update. Bug: 161946584 Signed-off-by: Greg Kroah-Hartman Change-Id: Ic05524e1d76a349bf55d12d3b571114483ed7d1b --- drivers/gpio/gpiolib.c | 19 ------------------- include/linux/gpio/driver.h | 9 --------- 2 files changed, 28 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 91628edad2c6..358f0ad9d0f8 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1368,16 +1368,6 @@ static int gpiochip_to_irq(struct gpio_chip *gc, unsigned int offset) { struct irq_domain *domain = gc->irq.domain; -#ifdef CONFIG_GPIOLIB_IRQCHIP - /* - * Avoid race condition with other code, which tries to lookup - * an IRQ before the irqchip has been properly registered, - * i.e. while gpiochip is still being brought up. - */ - if (!gc->irq.initialized) - return -EPROBE_DEFER; -#endif - if (!gpiochip_irqchip_irq_valid(gc, offset)) return -ENXIO; @@ -1562,15 +1552,6 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, acpi_gpiochip_request_interrupts(gc); - /* - * Using barrier() here to prevent compiler from reordering - * gc->irq.initialized before initialization of above - * GPIO chip irq members. - */ - barrier(); - - gc->irq.initialized = true; - return 0; } diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index e3c29d2e6826..a0f9901dcae6 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -224,15 +224,6 @@ struct gpio_irq_chip { unsigned long *valid_mask, unsigned int ngpios); - /** - * @initialized: - * - * Flag to track GPIO chip irq member's initialization. - * This flag will make sure GPIO chip irq members are not used - * before they are initialized. - */ - bool initialized; - /** * @valid_mask: *