1
0
Fork 0

gpio-mxc: drop GPIO_IMR register save/restore from runtime suspend/resume hooks

An issue is found in suspend/resume - if we touch screen with pen when
system is in Sleep state, system is not responding when it wakes up.
It's a similar issue that commit 20c3781a7fb9 ("MLK-20306 gpio: mxc:
Skip GPIO_IMR restore in noirq resume") was fixing.

The root cause is that GPIO_IMR is saved as enabled before suspend,
and IRQ arrived in suspend state, during resume, the IMR is restored
to unmask the IRQ, the IRQ keep coming and touch driver is NOT ready
to handle it. Similar to commit 20c3781a7fb9, fix the issue by removing
GPIO_IMR register save/restore from GPIO driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

[Grzegorz: align to different baseline after porting this patch from
	   kernel v4.14 to v5.4]
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
zero-colors
Shawn Guo 2019-08-22 09:55:59 +02:00 committed by Grzegorz Jaszczyk
parent 627b4c07b7
commit 3e25bb3ea4
1 changed files with 0 additions and 2 deletions

View File

@ -764,7 +764,6 @@ static void mxc_gpio_save_regs(struct mxc_gpio_port *port)
port->gpio_saved_reg.icr1 = readl(port->base + GPIO_ICR1);
port->gpio_saved_reg.icr2 = readl(port->base + GPIO_ICR2);
port->gpio_saved_reg.imr = readl(port->base + GPIO_IMR);
port->gpio_saved_reg.gdir = readl(port->base + GPIO_GDIR);
port->gpio_saved_reg.edge_sel = readl(port->base + GPIO_EDGE_SEL);
port->gpio_saved_reg.dr = readl(port->base + GPIO_DR);
@ -777,7 +776,6 @@ static void mxc_gpio_restore_regs(struct mxc_gpio_port *port)
writel(port->gpio_saved_reg.icr1, port->base + GPIO_ICR1);
writel(port->gpio_saved_reg.icr2, port->base + GPIO_ICR2);
writel(port->gpio_saved_reg.imr, port->base + GPIO_IMR);
writel(port->gpio_saved_reg.gdir, port->base + GPIO_GDIR);
writel(port->gpio_saved_reg.edge_sel, port->base + GPIO_EDGE_SEL);
writel(port->gpio_saved_reg.dr, port->base + GPIO_DR);