Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp42889imm; Mon, 1 Oct 2018 06:26:20 -0700 (PDT) X-Google-Smtp-Source: ACcGV6143kk/xgZwdd2H3pnadv3IoyFV5ZpnKsLyIkVGR8+mygsesIifHIzapHCDTbQlUa2HFTlO X-Received: by 2002:a17:902:62:: with SMTP id 89-v6mr11916705pla.298.1538400380273; Mon, 01 Oct 2018 06:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538400380; cv=none; d=google.com; s=arc-20160816; b=NQYo5+zMHTgIdaeIqJjU4x3OI94HHHYdKeEYGpU4xw/aq18W6EDgvCBaZrVk9hmjwb usOMLr5yNQIGdJQ7+5a5lrgB0xbAhn+jBbH7dps8nxMoHXdy4Js+3vHFfXEOFKdCUw09 9P/ehhxK8MEyaOF9ffO1M6GYHkQOCv5OEaakUrJ97bztdIu3amdjgTX4qbW5FoxwE06L vF9Gsmi7CdBLjjDVFy5v/wiPYtbMPEttbg9YZmLMJZnH/yyIlSU+EA5Narppa4tKAtPS 6WmHEaMsMGZ8DGiR+uvqu7Fj5WnLn1IhLeyVGYLyXlugBmDzEjx+uU9XOQfcyqC6Xd6d OMfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=sRbfFHiZBsp6mWnM6tPGtTIpoMHXYhAzR355pI1iSfs=; b=AK+rW+G1S/LOJMnAvUXia33H8K4CazIbG9sLLbpEwbEYt5DfqwCjTiatbeXMeW4VqA ozyCoVDBCZJyvKur1N1SQhAiZbmfle2ROtQkNnCJrikCK5v3F84M2/vYQ49+k98N5WZR oiorPawqker0nsYNjFIre6C983krW59tcstC75XBIfbfd3l3ygktAGg9ebr/kvxlYc1m Q4741CoQU36NluTrkg3+s75cbCa2EP7ZtYZE47SXxgFXRdmlRNsFTq7cYyLsVpBuzjtv atyF0OfoQW6MRQnKyEh2p9ilPug9cBKoeAP78UljR5Mq4mC/hotf2Fnr+YQR4haHY7pn uKJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14-v6si12577012pls.477.2018.10.01.06.26.04; Mon, 01 Oct 2018 06:26:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729397AbeJAUC1 (ORCPT + 99 others); Mon, 1 Oct 2018 16:02:27 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:59885 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729289AbeJAUC1 (ORCPT ); Mon, 1 Oct 2018 16:02:27 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w91DOCIP031562; Mon, 1 Oct 2018 15:24:13 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2msxh6bevr-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 01 Oct 2018 15:24:13 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A939634; Mon, 1 Oct 2018 13:24:11 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 76F0946B0; Mon, 1 Oct 2018 13:24:11 +0000 (GMT) Received: from localhost (10.75.127.47) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 1 Oct 2018 15:24:10 +0200 From: Fabrice Gasnier To: , CC: , , , , , , , , , , , Subject: [PATCH v2 1/2] Revert "pwm: Set class for exported channels in sysfs" Date: Mon, 1 Oct 2018 15:23:56 +0200 Message-ID: <1538400237-28766-2-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538400237-28766-1-git-send-email-fabrice.gasnier@st.com> References: <1538400237-28766-1-git-send-email-fabrice.gasnier@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-01_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Tested-by: Gottfried Haider --- 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