Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp262281imm; Mon, 1 Oct 2018 09:31:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV63SVF+rfiCulcnKuNH2jcAIug28aWLNAt41dYvXv/19tdrNCG7WkpnsuFPh/meRhlEkU633 X-Received: by 2002:a63:5d03:: with SMTP id r3-v6mr11073715pgb.445.1538411512864; Mon, 01 Oct 2018 09:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538411512; cv=none; d=google.com; s=arc-20160816; b=qqVcwqxn1Lkxof5ZlftS+C7l8tH19LF238wm7s6B/leKkUICwT7smRbgZA97WSA/ho DarvYapu1uxA+qnCWebo4ukHVR0+E5vk23R7X1r0o+frQG3jngbJKJWiLdbBV8ZJkY77 G1LXptArp2j595AfFeK+VtZp26ylioOGVO6O8v7+VZ5ZqGmpRZIjs/wpg7StoWimb30b SsLWqZJ3wKdqwhiZz8HHvKMEYRKHVJkRq66uipncL8m4cNdLskr+Vtq15JMhXKY6btxv tW2lVwMeAKf3OFAiEUJieA8HZyiwAOZulkDeLsOMX6xC3dpsOJewN+JZ7pRWukTpjpAo 367A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=1tf4RII8q/fxw7JYSn9wwqywzw+b8ywUlnNx19S3w+M=; b=TbVTqJfDHQJk2GYT3ko6SYTQuKX5NVt8ahtPL4Um8jPemIglLCMiWIjzpmdZhEZ7yf OYyquhQcbpzi08ncmsfdQcVisVx/tp3pVUlS1jtxx/4oRAbfUMYBAa7frw+R4xmg1aiy ulEslmM0StxyRUY1Gem5YYvJ9/m5lH2UqmxHBK0xM61H00uslabzzDU4UQds/HHQRUQ0 F/vTSGrhZ8f6Gv8ETHKaTPtYSc7sZUnDCYVnWxkHT2BYO1m5YvL4c2CCeGMkgjAHaecV Pgq+FEwTFjdCjjBUWCb0KOrh/S8dqFwzsNhs5j7QNEhziM0/1vv7sywtUFxQcDn01ClO Q2PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ysoft.com header.s=selector1 header.b=PAntcAXd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ysoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d36-v6si13446400pla.446.2018.10.01.09.31.37; Mon, 01 Oct 2018 09:31:52 -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; dkim=pass header.i=@ysoft.com header.s=selector1 header.b=PAntcAXd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ysoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726341AbeJAXKF (ORCPT + 99 others); Mon, 1 Oct 2018 19:10:05 -0400 Received: from mail-eopbgr20072.outbound.protection.outlook.com ([40.107.2.72]:18624 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725910AbeJAXKF (ORCPT ); Mon, 1 Oct 2018 19:10:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ysoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1tf4RII8q/fxw7JYSn9wwqywzw+b8ywUlnNx19S3w+M=; b=PAntcAXdeBQelqgsw1F3J1OPpAw3ZqtuJZyDpkRLO8tpw0tM82kbPT8nkwnCoTVRvcXenwI5wWdYxwP0aRuLDX5FKd3MB/H0+L5rTdegMrjhMqkWY4NsGtKuA5HmuJr/vV6QWzIquMm/8CCEuvKXQ8bD3p9PG16cA+K3BwZiCjg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Michal.Vokac@ysoft.com; Received: from [10.1.8.111] (89.24.100.190) by AM0PR04MB4658.eurprd04.prod.outlook.com (2603:10a6:208:75::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.24; Mon, 1 Oct 2018 16:29:28 +0000 Subject: Re: [PATCH v2 2/2] pwm: send a uevent on the pwmchip device upon channel sysfs (un)export To: Fabrice Gasnier , thierry.reding@gmail.com, gottfried.haider@gmail.com Cc: stefan.wahren@i2se.com, hsweeten@visionengravers.com, loic.pallardy@st.com, broonie@kernel.org, gohai@sukzessiv.net, 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 References: <1538400237-28766-1-git-send-email-fabrice.gasnier@st.com> <1538400237-28766-3-git-send-email-fabrice.gasnier@st.com> From: =?UTF-8?B?TWljaGFsIFZva8OhxI0=?= Message-ID: Date: Mon, 1 Oct 2018 18:29:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1538400237-28766-3-git-send-email-fabrice.gasnier@st.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [89.24.100.190] X-ClientProxiedBy: VI1PR09CA0072.eurprd09.prod.outlook.com (2603:10a6:802:29::16) To AM0PR04MB4658.eurprd04.prod.outlook.com (2603:10a6:208:75::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7e655835-5a74-4769-7247-08d627bb0f5c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM0PR04MB4658; X-Microsoft-Exchange-Diagnostics: 1;AM0PR04MB4658;3:RDWQ2Vub55Laxm8gwaozwM6KIo+vTFENG4gQKb8MkfsQBwCfBSlMMCZuptPXjHU/Z0BmR8ELCiCjYXpT6p1iAlIueFCXFSy7Oc+LLaZIy/aM4cOYWY7wfIh2VBvuN5XiQXXW0q4SGFKFSP5IIO+IzUU+uMblNzijlpJJ8VOyRn4a3m14SQ9vgpeN5iupye/xoUZeA+iZrAljapceo/NKmcVzTlzkBC8IhQyayKab8x3gCk+6I+9bm4g0CEsNiNAt;25:kQgk13/7CnQ4bit9Y+P6Y16ySr9s9+ReiNVJcRgPNZwIAUWbd7uPSqfwflb/R7Ly8hUcwQdKtz8qnxiWQqvsHkF56eF/ZHdsHOv0OS1Jy7SEncxLqaWuK4eWdYTTA662TONm+VyzJ7800CJ/yvWiPbPpzyl371GTJz8nrOZNcaBiOGMjVwqUvceJjWw0gk3+l3NZ9bf0Gwi/uu79QwSvXgPaeWzWYRuMkOZLS+s5h1wysD476pN8F85x+xnb02hFog9F3IizpzmUXWdPeDL2mkYMRcdZbFVoUDZsqmnrRZ4ZvPLb5dFYZN380uYRo4yOhu1UOWckI/Pgdp3ngYZuIg==;31:PxHI5zBJKr/T7DjNhPTI4z2/Slydlq30v/JhuOJ2Mz3bggjvJLZ22jsCYEzcoSBS7m1+oMRzHJlhZvad0njAkrqS5wA52WrjPDP5yCpB8wjs21f/1/4SfyjTAFiz5i/FzPRU39ZLaX2tsQ/6nXjEfe2ButVTD2Ic12vPdKE8mNtCq9maJbf7DLGsK33ADnF+gek2YvdrixNtKR4PGUPelyg5m3c+VW7P5Hu6ZE9lXEU= X-MS-TrafficTypeDiagnostic: AM0PR04MB4658: X-Microsoft-Exchange-Diagnostics: 1;AM0PR04MB4658;20:otiDdeq2UGZGCJUV0ffO/FfxWSMxNfECOR0i7hixm3J2DwcShPoEaf/6dcMP41Toa/8tucZJuuqfFfjTmWlLc/cVR/V2Cq2zqPIQ1Ut3Alfd1/zgcZdiJvnJic0pYZBAX9xJ4Jd1BQSqphzf/UKCO4doOH/OfmOXaRnGFdMTwHZuRCgqEu9G9xMCR/KkbuxUObEVjSKQU1ETWjuWHIOiKyFQuEZ6rG2YNTKDHtbZ0sthXMMzGSMVndUOz0rpb20U;4:0WBwOAt60XrLFuInlEG4uyrA+riNNmFu3tu0Jd6c9bJjVwOmLM8QXaxWVhYC2yvxyuQoK3Xo7zbBp3ee1DGZ8FGgg6VElNqDUi5h9z09Yfj7/xOEG23aTWfqvIZNK0twPNepqWoVVCRRtzwe5Ty0fl5DFHpAHNGL5GPessRu15JgbJ6BkiCGjM2NJn+1Rhtsv6t/m9ezoFEEMm3WHpC4ES023tbDdbtu3CNMDdYk3xpvXrSzRFtN9XI4LsEcok5xETBpNxF6x65RxPMfhPa++hazOYp0kW1t9nHSNABmLbQAbE1qcXtPg0AI0F/7TqBx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(201708071742011)(7699051);SRVR:AM0PR04MB4658;BCL:0;PCL:0;RULEID:;SRVR:AM0PR04MB4658; X-Forefront-PRVS: 0812095267 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(346002)(136003)(366004)(39850400004)(376002)(396003)(189003)(199004)(7736002)(86362001)(26005)(16526019)(186003)(31696002)(72206003)(65956001)(65806001)(47776003)(66066001)(34290500001)(966005)(6246003)(77096007)(478600001)(65826007)(8676002)(67846002)(5660300001)(105586002)(52146003)(25786009)(81166006)(81156014)(2870700001)(31686004)(58126008)(6666003)(2486003)(36756003)(53546011)(386003)(106356001)(52116002)(39060400002)(23676004)(8936002)(97736004)(76176011)(4326008)(2906002)(64126003)(6486002)(2616005)(956004)(3846002)(6116002)(11346002)(7416002)(229853002)(446003)(50466002)(53936002)(486006)(85182001)(316002)(476003)(68736007)(16576012)(6306002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4658;H:[10.1.8.111];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: ysoft.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTBQUjA0TUI0NjU4OzIzOlVwL0g1RkNZL3RJM2dTUGVIRUN0RWJTK1RV?= =?utf-8?B?UEl1MkZ2TDlSSk1pRys0OXgxZ25ITHdyQ25GSTFkMEtpVWNuQlQrc1hJWDky?= =?utf-8?B?ZUxpOWl0TGtrc3JWTEE0OVM3R0lJaFRaM2tObW9QcVgrbTNXQ0xvMFFncWRn?= =?utf-8?B?Z202QVdvanB3cmpPUnpybUhRQ0dhamVHMkpML0o0MHBZWTc2MDFCcXlmQnZm?= =?utf-8?B?VUNlRVBMK1dqNS9meHRaTDF3bkdNTFd5ZHI2K2p1VEhKTnVFVzcwNVhFNWk5?= =?utf-8?B?S3NQWjlGeHRSVjlQckNpalBKcGNTTjkvL2FKOEJEcWpxUTJpaThLUjdkZis0?= =?utf-8?B?RE5JRmwvWmh1VlMxbGRpYzA5UUlIVWNPd3NoaEFVY01YdFl3ZzhDeE0yMnA0?= =?utf-8?B?NDFwNEV3LzVsOXArTFBPM1krOW5WQXVWNVpZeHBBS1JMU0g4M2pLUzAvcjJn?= =?utf-8?B?YTFiRlhUYlhUR0lsUU1INlRnZEp0ZVk4VzV4cnFDQnh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0SZctle6riZrbOcYwDox3RzotSS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ysoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2018 16:29:28.3650 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e655835-5a74-4769-7247-08d627bb0f5c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b5839965-430f-4be2-b282-d7a3149f2b37 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4658 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1.10.2018 15:23, Fabrice Gasnier wrote: > This patch sends a uevent (KOBJ_CHANGE) on the pwmchipN device, everytime > a pwmX channel has been exported/unexported via sysfs. > This allows udev to implement rules on such events, like: > > SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\ > chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\ > chown -R root:gpio > /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 > /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\ > '" > > This is a replacement patch for commit 7e5d1fd75c3d ("pwm: Set class for > exported channels in sysfs"), see [1]. > > basic testing: > $ udevadm monitor --environment & > $ echo 0 > /sys/class/pwm/pwmchip0/export > KERNEL[197.321736] change /devices/.../pwm/pwmchip0 (pwm) > ACTION=change > DEVPATH=/devices/.../pwm/pwmchip0 > EXPORT=pwm0 > SEQNUM=2045 > SUBSYSTEM=pwm > > [1] https://lkml.org/lkml/2018/9/25/713 > > Signed-off-by: Fabrice Gasnier > Tested-by: Gottfried Haider Tested-by: Michal Vokáč