]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 May 2023 06:30:16 +0000 (15:30 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 May 2023 06:30:16 +0000 (15:30 +0900)
added patches:
debugfs-regset32-add-runtime-pm-support.patch

queue-4.19/debugfs-regset32-add-runtime-pm-support.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/debugfs-regset32-add-runtime-pm-support.patch b/queue-4.19/debugfs-regset32-add-runtime-pm-support.patch
new file mode 100644 (file)
index 0000000..b5556bf
--- /dev/null
@@ -0,0 +1,68 @@
+From 30332eeefec8f83afcea00c360f99ef64b87f220 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue, 11 Feb 2020 19:18:55 +0100
+Subject: debugfs: regset32: Add Runtime PM support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+
+commit 30332eeefec8f83afcea00c360f99ef64b87f220 upstream.
+
+Hardware registers of devices under control of power management cannot
+be accessed at all times.  If such a device is suspended, register
+accesses may lead to undefined behavior, like reading bogus values, or
+causing exceptions or system lock-ups.
+
+Extend struct debugfs_regset32 with an optional field to let device
+drivers specify the device the registers in the set belong to.  This
+allows debugfs_show_regset32() to make sure the device is resumed while
+its registers are being read.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/debugfs/file.c       |    8 ++++++++
+ include/linux/debugfs.h |    1 +
+ 2 files changed, 9 insertions(+)
+
+--- a/fs/debugfs/file.c
++++ b/fs/debugfs/file.c
+@@ -18,6 +18,7 @@
+ #include <linux/slab.h>
+ #include <linux/atomic.h>
+ #include <linux/device.h>
++#include <linux/pm_runtime.h>
+ #include <linux/poll.h>
+ #include "internal.h"
+@@ -1084,7 +1085,14 @@ static int debugfs_show_regset32(struct
+ {
+       struct debugfs_regset32 *regset = s->private;
++      if (regset->dev)
++              pm_runtime_get_sync(regset->dev);
++
+       debugfs_print_regs32(s, regset->regs, regset->nregs, regset->base, "");
++
++      if (regset->dev)
++              pm_runtime_put(regset->dev);
++
+       return 0;
+ }
+--- a/include/linux/debugfs.h
++++ b/include/linux/debugfs.h
+@@ -35,6 +35,7 @@ struct debugfs_regset32 {
+       const struct debugfs_reg32 *regs;
+       int nregs;
+       void __iomem *base;
++      struct device *dev;     /* Optional device for Runtime PM */
+ };
+ extern struct dentry *arch_debugfs_dir;
index 8df51128bc6bb7cf5c1f3bae085cff3a94769b58..49f7465a07725858b1c577bf5cbb612f2b69a8e5 100644 (file)
@@ -8,9 +8,9 @@ ima-allow-fix-uml-builds.patch
 usb-dwc3-fix-runtime-pm-imbalance-on-unbind.patch
 perf-sched-cast-pthread_stack_min-to-int-as-it-may-turn-into-sysconf-__sc_thread_stack_min_value.patch
 staging-iio-resolver-ads1210-fix-config-mode.patch
+debugfs-regset32-add-runtime-pm-support.patch
 xhci-fix-debugfs-register-accesses-while-suspended.patch
 mips-fw-allow-firmware-to-pass-a-empty-env.patch
-ipmi-fix-ssif-not-responding-under-certain-cond.patch
 pwm-meson-fix-axg-ao-mux-parents.patch
 ring-buffer-sync-irq-works-before-buffer-destruction.patch
 crypto-api-demote-bug_on-in-crypto_unregister_alg-to-a-warn_on.patch