The patch below does not apply to the 5.10-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 stable@vger.kernel.org.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b8c824a869f220c6b46df724f85794349bafbf23 Mon Sep 17 00:00:00 2001 From: Basavaraj Natikar Basavaraj.Natikar@amd.com 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 mario.limonciello@amd.com Signed-off-by: Basavaraj Natikar Basavaraj.Natikar@amd.com Fixes: 79d2c8bede2c ("pinctrl/amd: save pin registers over suspend/resume") Link: https://lore.kernel.org/r/20220613064127.220416-3-Basavaraj.Natikar@amd.com Signed-off-by: Linus Walleij linus.walleij@linaro.org
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index e497df89a4a7..9ec97c6db5e9 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c @@ -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;
[Public]
-----Original Message----- From: gregkh@linuxfoundation.org gregkh@linuxfoundation.org Sent: Monday, August 22, 2022 03:42 To: Natikar, Basavaraj Basavaraj.Natikar@amd.com; linus.walleij@linaro.org; Limonciello, Mario Mario.Limonciello@amd.com Cc: stable@vger.kernel.org Subject: FAILED: patch "[PATCH] pinctrl: amd: Don't save/restore interrupt status and wake" failed to apply to 5.10-stable tree
The patch below does not apply to the 5.10-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 stable@vger.kernel.org.
I had a look at this and the other ones that failed to apply. I tried to apply this commit ( commit b8c824a869f220c6b46df724f85794349bafbf23 ) to all of them and then built it.
5.10.y: success 5.4.y: success 4.19.y: success 4.14.y: success 4.9.y: failed
So I'm not sure why the automated stuff failed for you for 4.14.y through 5.10.y.
Considering it worked for me and built successfully can you have a try with it again at least on 4.14.y +?
Thanks,
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b8c824a869f220c6b46df724f85794349bafbf23 Mon Sep 17 00:00:00 2001 From: Basavaraj Natikar Basavaraj.Natikar@amd.com 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 mario.limonciello@amd.com Signed-off-by: Basavaraj Natikar Basavaraj.Natikar@amd.com Fixes: 79d2c8bede2c ("pinctrl/amd: save pin registers over suspend/resume") Link: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore. kernel.org%2Fr%2F20220613064127.220416-3- Basavaraj.Natikar%40amd.com&data=05%7C01%7Cmario.limonciello%4 0amd.com%7C19c619f81b23432a6eb608da841a3772%7C3dd8961fe4884e608e 11a82d994e183d%7C0%7C0%7C637967545388890457%7CUnknown%7CTWFp bGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVC I6Mn0%3D%7C3000%7C%7C%7C&sdata=Fz3iik5pd2tlwxvCBiA9BNA5gJ2s U66y0NqNrrRkpM4%3D&reserved=0 Signed-off-by: Linus Walleij linus.walleij@linaro.org
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index e497df89a4a7..9ec97c6db5e9 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c @@ -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;
On Tue, Aug 23, 2022 at 08:36:20PM +0000, Limonciello, Mario wrote:
[Public]
-----Original Message----- From: gregkh@linuxfoundation.org gregkh@linuxfoundation.org Sent: Monday, August 22, 2022 03:42 To: Natikar, Basavaraj Basavaraj.Natikar@amd.com; linus.walleij@linaro.org; Limonciello, Mario Mario.Limonciello@amd.com Cc: stable@vger.kernel.org Subject: FAILED: patch "[PATCH] pinctrl: amd: Don't save/restore interrupt status and wake" failed to apply to 5.10-stable tree
The patch below does not apply to the 5.10-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 stable@vger.kernel.org.
I had a look at this and the other ones that failed to apply. I tried to apply this commit ( commit b8c824a869f220c6b46df724f85794349bafbf23 ) to all of them and then built it.
5.10.y: success
$ patch -p1 < ../pinctrl-amd-don-t-save-restore-interrupt-status-and-wake-status-bits.patch patching file drivers/pinctrl/pinctrl-amd.c Hunk #1 succeeded at 833 (offset -85 lines). Hunk #2 FAILED at 927. Hunk #3 FAILED at 937. Hunk #4 succeeded at 842 (offset -103 lines). 2 out of 4 hunks FAILED -- saving rejects to file drivers/pinctrl/pinctrl-amd.c.rej
Doesn't work for me, how did you apply it?
thanks,
greg k-h
On 8/24/22 01:54, gregkh@linuxfoundation.org wrote:
On Tue, Aug 23, 2022 at 08:36:20PM +0000, Limonciello, Mario wrote:
[Public]
-----Original Message----- From: gregkh@linuxfoundation.org gregkh@linuxfoundation.org Sent: Monday, August 22, 2022 03:42 To: Natikar, Basavaraj Basavaraj.Natikar@amd.com; linus.walleij@linaro.org; Limonciello, Mario Mario.Limonciello@amd.com Cc: stable@vger.kernel.org Subject: FAILED: patch "[PATCH] pinctrl: amd: Don't save/restore interrupt status and wake" failed to apply to 5.10-stable tree
The patch below does not apply to the 5.10-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 stable@vger.kernel.org.
I had a look at this and the other ones that failed to apply. I tried to apply this commit ( commit b8c824a869f220c6b46df724f85794349bafbf23 ) to all of them and then built it.
5.10.y: success
$ patch -p1 < ../pinctrl-amd-don-t-save-restore-interrupt-status-and-wake-status-bits.patch patching file drivers/pinctrl/pinctrl-amd.c Hunk #1 succeeded at 833 (offset -85 lines). Hunk #2 FAILED at 927. Hunk #3 FAILED at 937. Hunk #4 succeeded at 842 (offset -103 lines). 2 out of 4 hunks FAILED -- saving rejects to file drivers/pinctrl/pinctrl-amd.c.rej
Doesn't work for me, how did you apply it?
I checked out the different branches mentioned and did "git cherry-pick -x b8c824a869f220c6b46df724f85794349bafbf23" followed by building.
thanks,
greg k-h
On Wed, Aug 24, 2022 at 07:05:25AM -0500, Mario Limonciello wrote:
On 8/24/22 01:54, gregkh@linuxfoundation.org wrote:
On Tue, Aug 23, 2022 at 08:36:20PM +0000, Limonciello, Mario wrote:
[Public]
-----Original Message----- From: gregkh@linuxfoundation.org gregkh@linuxfoundation.org Sent: Monday, August 22, 2022 03:42 To: Natikar, Basavaraj Basavaraj.Natikar@amd.com; linus.walleij@linaro.org; Limonciello, Mario Mario.Limonciello@amd.com Cc: stable@vger.kernel.org Subject: FAILED: patch "[PATCH] pinctrl: amd: Don't save/restore interrupt status and wake" failed to apply to 5.10-stable tree
The patch below does not apply to the 5.10-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 stable@vger.kernel.org.
I had a look at this and the other ones that failed to apply. I tried to apply this commit ( commit b8c824a869f220c6b46df724f85794349bafbf23 ) to all of them and then built it.
5.10.y: success
$ patch -p1 < ../pinctrl-amd-don-t-save-restore-interrupt-status-and-wake-status-bits.patch patching file drivers/pinctrl/pinctrl-amd.c Hunk #1 succeeded at 833 (offset -85 lines). Hunk #2 FAILED at 927. Hunk #3 FAILED at 937. Hunk #4 succeeded at 842 (offset -103 lines). 2 out of 4 hunks FAILED -- saving rejects to file drivers/pinctrl/pinctrl-amd.c.rej
Doesn't work for me, how did you apply it?
I checked out the different branches mentioned and did "git cherry-pick -x b8c824a869f220c6b46df724f85794349bafbf23" followed by building.
That's great, can you send me that patch? We don't use git for the stable queue as it does not work at all for our development workflow. We export the commits as patches and then apply them using quilt. git must be doing some "magic fuzzing" here that patch can not detect.
thanks,
greg k-h
On Wed, Aug 24, 2022 at 02:14:24PM +0200, gregkh@linuxfoundation.org wrote:
On Wed, Aug 24, 2022 at 07:05:25AM -0500, Mario Limonciello wrote:
On 8/24/22 01:54, gregkh@linuxfoundation.org wrote:
On Tue, Aug 23, 2022 at 08:36:20PM +0000, Limonciello, Mario wrote:
[Public]
-----Original Message----- From: gregkh@linuxfoundation.org gregkh@linuxfoundation.org Sent: Monday, August 22, 2022 03:42 To: Natikar, Basavaraj Basavaraj.Natikar@amd.com; linus.walleij@linaro.org; Limonciello, Mario Mario.Limonciello@amd.com Cc: stable@vger.kernel.org Subject: FAILED: patch "[PATCH] pinctrl: amd: Don't save/restore interrupt status and wake" failed to apply to 5.10-stable tree
The patch below does not apply to the 5.10-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 stable@vger.kernel.org.
I had a look at this and the other ones that failed to apply. I tried to apply this commit ( commit b8c824a869f220c6b46df724f85794349bafbf23 ) to all of them and then built it.
5.10.y: success
$ patch -p1 < ../pinctrl-amd-don-t-save-restore-interrupt-status-and-wake-status-bits.patch patching file drivers/pinctrl/pinctrl-amd.c Hunk #1 succeeded at 833 (offset -85 lines). Hunk #2 FAILED at 927. Hunk #3 FAILED at 937. Hunk #4 succeeded at 842 (offset -103 lines). 2 out of 4 hunks FAILED -- saving rejects to file drivers/pinctrl/pinctrl-amd.c.rej
Doesn't work for me, how did you apply it?
I checked out the different branches mentioned and did "git cherry-pick -x b8c824a869f220c6b46df724f85794349bafbf23" followed by building.
That's great, can you send me that patch? We don't use git for the stable queue as it does not work at all for our development workflow. We export the commits as patches and then apply them using quilt. git must be doing some "magic fuzzing" here that patch can not detect.
Nevermind, I did that, and it worked, odd that patch is confused, the fuzz is fine, just the line numbers are off. I'll queue this up after this round of kernels is released.
thanks,
greg k-h
linux-stable-mirror@lists.linaro.org