]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Nov 2020 10:08:20 +0000 (11:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Nov 2020 10:08:20 +0000 (11:08 +0100)
added patches:
mfd-sprd-add-wakeup-capability-for-pmic-irq.patch
tick-common-touch-watchdog-in-tick_unfreeze-on-all-cpus.patch

queue-4.19/mfd-sprd-add-wakeup-capability-for-pmic-irq.patch [new file with mode: 0644]
queue-4.19/series
queue-4.19/tick-common-touch-watchdog-in-tick_unfreeze-on-all-cpus.patch [new file with mode: 0644]

diff --git a/queue-4.19/mfd-sprd-add-wakeup-capability-for-pmic-irq.patch b/queue-4.19/mfd-sprd-add-wakeup-capability-for-pmic-irq.patch
new file mode 100644 (file)
index 0000000..30a3340
--- /dev/null
@@ -0,0 +1,80 @@
+From a75bfc824a2d33f57ebdc003bfe6b7a9e11e9cb9 Mon Sep 17 00:00:00 2001
+From: Baolin Wang <baolin.wang7@gmail.com>
+Date: Tue, 18 Aug 2020 11:41:58 +0800
+Subject: mfd: sprd: Add wakeup capability for PMIC IRQ
+
+From: Baolin Wang <baolin.wang7@gmail.com>
+
+commit a75bfc824a2d33f57ebdc003bfe6b7a9e11e9cb9 upstream.
+
+When changing to use suspend-to-idle to save power, the PMIC irq can not
+wakeup the system due to lack of wakeup capability, which will cause
+the sub-irqs (such as power key) of the PMIC can not wake up the system.
+Thus we can add the wakeup capability for PMIC irq to solve this issue,
+as well as removing the IRQF_NO_SUSPEND flag to allow PMIC irq to be
+a wakeup source.
+
+Reported-by: Chunyan Zhang <zhang.lyra@gmail.com>
+Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>
+Tested-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mfd/sprd-sc27xx-spi.c |   28 +++++++++++++++++++++++++++-
+ 1 file changed, 27 insertions(+), 1 deletion(-)
+
+--- a/drivers/mfd/sprd-sc27xx-spi.c
++++ b/drivers/mfd/sprd-sc27xx-spi.c
+@@ -212,7 +212,7 @@ static int sprd_pmic_probe(struct spi_de
+       }
+       ret = devm_regmap_add_irq_chip(&spi->dev, ddata->regmap, ddata->irq,
+-                                     IRQF_ONESHOT | IRQF_NO_SUSPEND, 0,
++                                     IRQF_ONESHOT, 0,
+                                      &ddata->irq_chip, &ddata->irq_data);
+       if (ret) {
+               dev_err(&spi->dev, "Failed to add PMIC irq chip %d\n", ret);
+@@ -228,9 +228,34 @@ static int sprd_pmic_probe(struct spi_de
+               return ret;
+       }
++      device_init_wakeup(&spi->dev, true);
+       return 0;
+ }
++#ifdef CONFIG_PM_SLEEP
++static int sprd_pmic_suspend(struct device *dev)
++{
++      struct sprd_pmic *ddata = dev_get_drvdata(dev);
++
++      if (device_may_wakeup(dev))
++              enable_irq_wake(ddata->irq);
++
++      return 0;
++}
++
++static int sprd_pmic_resume(struct device *dev)
++{
++      struct sprd_pmic *ddata = dev_get_drvdata(dev);
++
++      if (device_may_wakeup(dev))
++              disable_irq_wake(ddata->irq);
++
++      return 0;
++}
++#endif
++
++static SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops, sprd_pmic_suspend, sprd_pmic_resume);
++
+ static const struct of_device_id sprd_pmic_match[] = {
+       { .compatible = "sprd,sc2731", .data = &sc2731_data },
+       {},
+@@ -242,6 +267,7 @@ static struct spi_driver sprd_pmic_drive
+               .name = "sc27xx-pmic",
+               .bus = &spi_bus_type,
+               .of_match_table = sprd_pmic_match,
++              .pm = &sprd_pmic_pm_ops,
+       },
+       .probe = sprd_pmic_probe,
+ };
index b147e8dd3c79bfa5b3c0b0ca39f8414fd68fb618..ae81bc1109ee0418e62e8493373a8377691fe000 100644 (file)
@@ -45,3 +45,5 @@ s390-smp-move-rcu_cpu_starting-earlier.patch
 vfio-platform-fix-reference-leak-in-vfio_platform_op.patch
 selftests-proc-fix-warning-_gnu_source-redefined.patch
 tpm_tis-disable-interrupts-on-thinkpad-t490s.patch
+tick-common-touch-watchdog-in-tick_unfreeze-on-all-cpus.patch
+mfd-sprd-add-wakeup-capability-for-pmic-irq.patch
diff --git a/queue-4.19/tick-common-touch-watchdog-in-tick_unfreeze-on-all-cpus.patch b/queue-4.19/tick-common-touch-watchdog-in-tick_unfreeze-on-all-cpus.patch
new file mode 100644 (file)
index 0000000..c529286
--- /dev/null
@@ -0,0 +1,49 @@
+From 5167c506d62dd9ffab73eba23c79b0a8845c9fe1 Mon Sep 17 00:00:00 2001
+From: Chunyan Zhang <zhang.lyra@gmail.com>
+Date: Fri, 10 Jan 2020 16:39:02 +0800
+Subject: tick/common: Touch watchdog in tick_unfreeze() on all CPUs
+
+From: Chunyan Zhang <zhang.lyra@gmail.com>
+
+commit 5167c506d62dd9ffab73eba23c79b0a8845c9fe1 upstream.
+
+Suspend to IDLE invokes tick_unfreeze() on resume. tick_unfreeze() on the
+first resuming CPU resumes timekeeping, which also has the side effect of
+resetting the softlockup watchdog on this CPU.
+
+But on the secondary CPUs the watchdog is not reset in the resume /
+unfreeze() path, which can result in false softlockup warnings on those
+CPUs depending on the time spent in suspend.
+
+Prevent this by clearing the softlock watchdog in the unfreeze path also
+on the secondary resuming CPUs.
+
+[ tglx: Massaged changelog ]
+
+Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Link: https://lore.kernel.org/r/20200110083902.27276-1-chunyan.zhang@unisoc.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/time/tick-common.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/kernel/time/tick-common.c
++++ b/kernel/time/tick-common.c
+@@ -15,6 +15,7 @@
+ #include <linux/err.h>
+ #include <linux/hrtimer.h>
+ #include <linux/interrupt.h>
++#include <linux/nmi.h>
+ #include <linux/percpu.h>
+ #include <linux/profile.h>
+ #include <linux/sched.h>
+@@ -520,6 +521,7 @@ void tick_unfreeze(void)
+               trace_suspend_resume(TPS("timekeeping_freeze"),
+                                    smp_processor_id(), false);
+       } else {
++              touch_softlockup_watchdog();
+               tick_resume_local();
+       }