gpio: xilinx: Do not use gpiochip_get_data() in xgpio_save_regs()
Subsystems (3)
PATCH 1/1 gpio: xilinx: Do not use gpiochip_get_data() in xgpio_save_regs()
Commit 097d88e94c44 ("gpio: xilinx: use gpiochip data pointer") replaces the use of container_of() with gpiochip_get_data(). Unfortunately, the data pointer is not yet set by the time xgpio_save_regs() is called, causing a system hang.
---
It might make sense to merge this patch with the patch introducing the problem.
drivers/gpio/gpio-xilinx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpio-xilinx.c +2 -1
@@ -207,7 +207,8 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)*/ static void xgpio_save_regs (struct of_mm_gpio_chip *mm_gc) { -struct xgpio_instance *chip =gpiochip_get_data (&mm_gc->gc); +struct xgpio_instance *chip = + container_of(mm_gc, struct xgpio_instance, mmchip);xgpio_writereg (mm_gc->regs +XGPIO_DATA_OFFSET , chip->gpio_state[0 ]);xgpio_writereg (mm_gc->regs +XGPIO_TRI_OFFSET , chip->gpio_dir[0 ]);
Signature · 1 line
2.1.4
Quoted 9 lines · Guenter Roeck
Commit
097d88e94c44("gpio: xilinx: use gpiochip data pointer") replaces the use ofcontainer_of()withgpiochip_get_data(). Unfortunately, the data pointer is not yet set by the timexgpio_save_regs()is called, causing a system hang.Fixes 097d88e94c44 ("gpio: xilinx: use gpiochip data pointer")Signed-off-by Guenter Roeck <[email protected]>---
It might make sense to merge this patch with the patch introducing the problem.
Patch applied, thanks for finding and fixing this so quick!
(I hope I haven't created too many of these regressions...)
Yours,
Linus Walleij
Quoted 7 lines · Linus Walleij
Quoted 5 lines · Guenter Roeck
Commit
097d88e94c44("gpio: xilinx: use gpiochip data pointer") replaces the use ofcontainer_of()withgpiochip_get_data(). Unfortunately, the data pointer is not yet set by the timexgpio_save_regs()is called, causing a system hang.
Quoted 7 lines
Quoted 4 lines
Fixes 097d88e94c44 ("gpio: xilinx: use gpiochip data pointer")Signed-off-by Guenter Roeck <[email protected]>---
It might make sense to merge this patch with the patch introducing the problem.Patch applied, thanks for finding and fixing this so quick!
Code inspection shows that there are two more - I'll send patches today.
Guenter