]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 17:30:49 +0000 (19:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 17:30:49 +0000 (19:30 +0200)
added patches:
revert-pwm-set-class-for-exported-channels-in-sysfs.patch

queue-4.19/revert-pwm-set-class-for-exported-channels-in-sysfs.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/revert-pwm-set-class-for-exported-channels-in-sysfs.patch b/queue-4.19/revert-pwm-set-class-for-exported-channels-in-sysfs.patch
new file mode 100644 (file)
index 0000000..8c5b0d1
--- /dev/null
@@ -0,0 +1,67 @@
+From c289d6625237aa785b484b4e94c23b3b91ea7e60 Mon Sep 17 00:00:00 2001
+From: Fabrice Gasnier <fabrice.gasnier@st.com>
+Date: Mon, 1 Oct 2018 15:23:56 +0200
+Subject: Revert "pwm: Set class for exported channels in sysfs"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Fabrice Gasnier <fabrice.gasnier@st.com>
+
+commit c289d6625237aa785b484b4e94c23b3b91ea7e60 upstream.
+
+This reverts commit 7e5d1fd75c3dde9fc10c4472b9368089d1b81d00 ("pwm: Set
+class for exported channels in sysfs") as it causes regression with
+multiple pwm chip[1], when exporting a pwm channel (echo X > export):
+
+- ABI (Documentation/ABI/testing/sysfs-class-pwm) states pwmX should be
+  created in /sys/class/pwm/pwmchipN/pwmX
+- Reverted patch causes new entry to be also created directly in
+  /sys/class/pwm/pwmX
+- 1st time, exporting pwmX will create an entry in /sys/class/pwm/pwmX
+- class attributes are added under pwmX folder, such as export, unexport
+  npwm, symlinks. This is wrong as it belongs to pwmchipN. It may cause
+  bad behavior and report wrong values.
+- when another export happens on another pwmchip, it can't be created
+  (e.g. -EEXIST). This is causing the issue with multiple pwmchip.
+
+Example on stm32 (stm32429i-eval) platform:
+$ ls /sys/class/pwm
+pwmchip0 pwmchip4
+
+$ cd /sys/class/pwm/pwmchip0/
+$ echo 0 > export
+$ ls /sys/class/pwm
+pwm0 pwmchip0 pwmchip4
+
+$ cd /sys/class/pwm/pwmchip4/
+$ echo 0 > export
+sysfs: cannot create duplicate filename '/class/pwm/pwm0'
+...Exception stack follows...
+
+This is also seen on other platform [2]
+
+[1] https://lkml.org/lkml/2018/9/25/713
+[2] https://lkml.org/lkml/2018/9/25/447
+
+Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
+Tested-by: Gottfried Haider <gottfried.haider@gmail.com>
+Tested-by: Michal Vokáč <michal.vokac@ysoft.com>
+Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
+Cc: John Keeping <john@metanate.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pwm/sysfs.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/pwm/sysfs.c
++++ b/drivers/pwm/sysfs.c
+@@ -263,7 +263,6 @@ static int pwm_export_child(struct devic
+       export->pwm = pwm;
+       mutex_init(&export->lock);
+-      export->child.class = parent->class;
+       export->child.release = pwm_export_release;
+       export->child.parent = parent;
+       export->child.devt = MKDEV(0, 0);
index fc08c5ce74d8d3101d5389f1982cd88e5619d2fc..cd0f40eeb815be1903b6b39d829b6c9850cbda9f 100644 (file)
@@ -5,3 +5,4 @@ mm-mempolicy-make-the-behavior-consistent-when-mpol_mf_move-and-mpol_mf_strict-w
 mm-mempolicy-handle-vma-with-unmovable-pages-mapped-correctly-in-mbind.patch
 mm-memcontrol.c-fix-use-after-free-in-mem_cgroup_iter.patch
 mm-usercopy-use-memory-range-to-be-accessed-for-wraparound-check.patch
+revert-pwm-set-class-for-exported-channels-in-sysfs.patch