FAILED: patch "[PATCH] pinctrl: amd: Don't save/restore interrupt status and wake" failed to apply to 4.19-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b8c824a869f220c6b46df724f85794349bafbf23 Mon Sep 17 00:00:00 2001
From: Basavaraj Natikar <[email protected]>
Date: Mon, 13 Jun 2022 12:11:26 +0530
Subject: [PATCH] pinctrl: amd: Don't save/restore interrupt status and wake
status bits
Saving/restoring interrupt and wake status bits across suspend can cause the suspend to fail if an IRQ is serviced across the suspend cycle.
Signed-off-by Mario Limonciello <[email protected]>
Signed-off-by Basavaraj Natikar <[email protected]>
Fixes 79d2c8bede2c ("pinctrl/amd: save pin registers over suspend/resume")
Signed-off-by Linus Walleij <[email protected]>
drivers/pinctrl/pinctrl-amd.c +9 -2
@@ -918,6 +918,7 @@ static int amd_gpio_suspend(struct device *dev) {struct amd_gpio *gpio_dev =dev_get_drvdata (dev);struct pinctrl_desc *desc = gpio_dev->pctrl->desc; +unsigned long flags;int i;for (i =0 ; i < desc->npins; i++) {
@@ -926,7 +927,9 @@ static int amd_gpio_suspend(struct device *dev)if (!amd_gpio_should_save (gpio_dev, pin))continue ; - gpio_dev->saved_regs[i] =readl (gpio_dev->base + pin*4 ); +raw_spin_lock_irqsave (&gpio_dev->lock, flags); + gpio_dev->saved_regs[i] =readl (gpio_dev->base + pin *4 ) & ~PIN_IRQ_PENDING ; +raw_spin_unlock_irqrestore (&gpio_dev->lock, flags); }return 0 ;
@@ -936,6 +939,7 @@ static int amd_gpio_resume(struct device *dev) {struct amd_gpio *gpio_dev =dev_get_drvdata (dev);struct pinctrl_desc *desc = gpio_dev->pctrl->desc; +unsigned long flags;int i;for (i =0 ; i < desc->npins; i++) {
@@ -944,7 +948,10 @@ static int amd_gpio_resume(struct device *dev)if (!amd_gpio_should_save (gpio_dev, pin))continue ; -writel (gpio_dev->saved_regs[i], gpio_dev->base + pin*4 ); +raw_spin_lock_irqsave (&gpio_dev->lock, flags); + gpio_dev->saved_regs[i] |=readl (gpio_dev->base + pin *4 ) &PIN_IRQ_PENDING ; +writel (gpio_dev->saved_regs[i], gpio_dev->base + pin *4 ); +raw_spin_unlock_irqrestore (&gpio_dev->lock, flags); }return 0 ;