From 82383b2bb2b6f00eae1a356e4b3d22cc05d26179 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Thu, 22 Aug 2019 09:55:59 +0200 Subject: [PATCH] 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 --- drivers/gpio/gpio-mxc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 10d189072dd3..dc30f41cd59d 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -724,7 +724,6 @@ static void mxc_gpio_save_regs(struct mxc_gpio_port *port) spin_lock_irqsave(&port->gc.bgpio_lock, flags); port->saved_reg[0] = readl(port->base + GPIO_ICR1); port->saved_reg[1] = readl(port->base + GPIO_ICR2); - port->saved_reg[2] = readl(port->base + GPIO_IMR); port->saved_reg[3] = readl(port->base + GPIO_GDIR); port->saved_reg[4] = readl(port->base + GPIO_EDGE_SEL); port->saved_reg[5] = readl(port->base + GPIO_DR); @@ -741,7 +740,6 @@ static void mxc_gpio_restore_regs(struct mxc_gpio_port *port) spin_lock_irqsave(&port->gc.bgpio_lock, flags); writel(port->saved_reg[0], port->base + GPIO_ICR1); writel(port->saved_reg[1], port->base + GPIO_ICR2); - writel(port->saved_reg[2], port->base + GPIO_IMR); writel(port->saved_reg[3], port->base + GPIO_GDIR); writel(port->saved_reg[4], port->base + GPIO_EDGE_SEL); writel(port->saved_reg[5], port->base + GPIO_DR);