From: Fabrice Gasnier <fabrice.gasnier@st.com>
To: <thierry.reding@gmail.com>, <gottfried.haider@gmail.com>
Cc: <stefan.wahren@i2se.com>, <hsweeten@visionengravers.com>,
<loic.pallardy@st.com>, <broonie@kernel.org>,
<fabrice.gasnier@st.com>, <gohai@sukzessiv.net>,
<michal.vokac@ysoft.com>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-rpi-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linux-pwm@vger.kernel.org>
Subject: [PATCH v2 1/2] Revert "pwm: Set class for exported channels in sysfs"
Date: Mon, 1 Oct 2018 15:23:56 +0200 [thread overview]
Message-ID: <1538400237-28766-2-git-send-email-fabrice.gasnier@st.com> (raw)
In-Reply-To: <1538400237-28766-1-git-send-email-fabrice.gasnier@st.com>
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>
---
drivers/pwm/sysfs.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index 7c71cdb..4726d43 100644
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -263,7 +263,6 @@ static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
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);
--
1.9.1
next prev parent reply other threads:[~2018-10-01 13:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-01 13:23 [PATCH v2 0/2] pwm: sysfs: fix exporting PWM channel Fabrice Gasnier
2018-10-01 13:23 ` Fabrice Gasnier [this message]
2018-10-01 16:27 ` [PATCH v2 1/2] Revert "pwm: Set class for exported channels in sysfs" Michal Vokáč
2018-10-01 13:23 ` [PATCH v2 2/2] pwm: send a uevent on the pwmchip device upon channel sysfs (un)export Fabrice Gasnier
2018-10-01 16:29 ` Michal Vokáč
2018-10-01 16:24 ` [PATCH v2 0/2] pwm: sysfs: fix exporting PWM channel Michal Vokáč
2018-10-12 11:55 ` Thierry Reding
2018-10-12 12:15 ` Stefan Wahren
2018-10-12 12:36 ` Fabrice Gasnier
2018-10-12 12:44 ` Vokáč Michal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1538400237-28766-2-git-send-email-fabrice.gasnier@st.com \
--to=fabrice.gasnier@st.com \
--cc=broonie@kernel.org \
--cc=gohai@sukzessiv.net \
--cc=gottfried.haider@gmail.com \
--cc=hsweeten@visionengravers.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=loic.pallardy@st.com \
--cc=michal.vokac@ysoft.com \
--cc=stefan.wahren@i2se.com \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).