Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4467553pxk; Wed, 30 Sep 2020 03:55:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQTq0W5Iz0FNhkCbvMJHtbAspzxuNwtjkK26erNKgsZgX7fiVLkUcn0InBwvLIdPgjQjwd X-Received: by 2002:a17:906:a981:: with SMTP id jr1mr2030485ejb.99.1601463345424; Wed, 30 Sep 2020 03:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601463345; cv=none; d=google.com; s=arc-20160816; b=HiS6iPZqDcG+0JM7knodiAiGCxeYJnukUkCsOE9xYZWWB2Q06zGgFp1vN1JnosrcFG tdNXuyjpD/KP9R7kBU/qK85ri27P+LjyprEL/ZdPLx1h9y+SqGdC7l7/YFhwOtbm84e6 flfnIMxc4Q80XwrQJ6dlp8ZQoX/RyoV5Huo2H7a2l11+e98aFhrhlS9/RowzSekXOg/B xG7Tylxqf2ZZYgaad8ys5IRdV6R1hpAZzWlVsPFWQF/Hs4Vv5a//x00v0TAPHSeH2Hd5 iEgm8DvLYa/dFIVGIq3tZEWO7kTNDztB4wQVZn4I9Q2lQlIE9PZYJfpNWEdEIufPE8bP ytWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=buYsJ8Jgi+RxlO4kuMdQvDgQ3MtKx/+E+7A9UhmxfRk=; b=sftl8RuXyaLDCIt3MBcgaRi2JJO7BVD8wq1cVw9Fg5DQ0hG/zflTiOX4IHNkJwz58u 8epThQv6cnofm8tCZyB1LMDUgpFt19NJQ4R/ng7t6spV4cZUZWzt1Ha6jQBXpeH72qb0 KFt81Un+P9wUuA1MM4cyq3UUJ9ziHYolYahxB8AWlc4TkMSmr5Is0g6aRBS1ys2UPVKp bfCquuINcogHg2vvYPkNtdVI3YAWT+ReNEO26cuGwm/6mWf8GUJNyPQ0idveycoHJoqj +LM4imxCfUDdIvSbkfFv5oWMdRFkQMOt826SPDwsxW5iTqkyGVtE4LQDlVyaGC+QqaDJ qDlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E5z63Wog; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy15si796912edb.525.2020.09.30.03.55.23; Wed, 30 Sep 2020 03:55:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E5z63Wog; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729767AbgI3Kwf (ORCPT + 99 others); Wed, 30 Sep 2020 06:52:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:38374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbgI3Kwf (ORCPT ); Wed, 30 Sep 2020 06:52:35 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01F082074B; Wed, 30 Sep 2020 10:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601463154; bh=sAnFmfiBOn3L6yoHkOdQg3d9f4xBD+W+0g+rqfowJOU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E5z63Wog8IMSAAGKeFYQsJjw1B4JUPWZU5cVHcQxW/+K9+Msb17GQ9LcX6PIuBW9J IBRW7HXuDO6zjDSG6nRBUHn7cjy3vEJS2ZdcvaN7mM+YUYGQT+Hrfw247pEv7oYrHZ GcIIaFmh/Qd2EVH9X/FJ4ymkohrseATvWT8CIEAc= Date: Wed, 30 Sep 2020 12:52:38 +0200 From: Greg Kroah-Hartman To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Lars Poeschel , Thierry Reding , Lee Jones , "open list:PWM SUBSYSTEM" , open list Subject: Re: [PATCH] pwm: sysfs: Set class on pwm devices Message-ID: <20200930105238.GA1592367@kroah.com> References: <20200929121953.2817843-1-poeschel@lemonage.de> <20200930065726.fjcsm4pfh65medgl@pengutronix.de> <20200930092056.maz5biy2ugr6yc3p@lem-wkst-02.lemonage> <20200930094146.73s3qzvf5ekjeavc@pengutronix.de> <20200930095204.GA1585476@kroah.com> <20200930100126.rtjfnmbc54m7vrwd@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200930100126.rtjfnmbc54m7vrwd@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 12:01:26PM +0200, Uwe Kleine-K?nig wrote: > On Wed, Sep 30, 2020 at 11:52:04AM +0200, Greg Kroah-Hartman wrote: > > On Wed, Sep 30, 2020 at 11:41:46AM +0200, Uwe Kleine-K?nig wrote: > > > Hello, > > > > > > I added Greg Kroah-Hartman who I discussed this with via irc a bit to > > > Cc:. > > > > > > On Wed, Sep 30, 2020 at 11:20:56AM +0200, Lars Poeschel wrote: > > > > thank you for your review! > > > > > > > > On Wed, Sep 30, 2020 at 08:57:26AM +0200, Uwe Kleine-K?nig wrote: > > > > > On Tue, Sep 29, 2020 at 02:19:53PM +0200, poeschel@lemonage.de wrote: > > > > > > From: Lars Poeschel > > > > > > > > > > > > This adds a class to exported pwm devices. > > > > > > Exporting a pwm through sysfs did not yield udev events. The > > > > > > > > > > I wonder what is your use-case here. This for sure also has a place to > > > > > be mentioned in the commit log. I suspect there is a better way to > > > > > accomplish you way. > > > > > > > > Use-case is to be able to use a pwm from a non-root userspace process. > > > > I use udev rules to adjust permissions. > > > > > > Hmm, how do you trigger the export? Without being aware of all the > > > details in the sysfs code I would expect that the exported stuff is > > > available instantly once the write used to export the PWM is completed. > > > So changing the permissions can be done directly after triggering the > > > export in the same process. > > > > It looks like userspace wants to see when a pwmX device shows up, right? > > > > And it's not because those devices do not belong to any class or bus, so > > they are just "floating" out there (they might show up under > > /sys/bus/virtual, if you set things up right, which I don't think is > > happening here...) > > > > So yes, you need to create a class, or assign this to a bus, which is > > fine, but it looks like no one is doing that. Don't create new classes > > dynamically, but rather, just assign this to the existing pwm class. > > What's wrong with that? I saw an older patch that did that, what did > > that break? > > Are you refering to 7e5d1fd75c3dde9fc10c4472b9368089d1b81d00? Did you > read the reverting commit's log message? (i.e. > c289d6625237aa785b484b4e94c23b3b91ea7e60) > > I guess the breakage is that the resulting name then is: > > "pwm%d", pwm->id > > where pwm->id is a number unique to the pwmchip. So doing > > echo 0 > pwmchip1/export > echo 0 > pwmchip2/export > > breaks because both want to create pwm0 in the class directory. Ah, that makes more sense why that didn't work. Ok, can the "name" of the new export chip be changed? Is that hard-coded somewhere in userspace tools already? Depending on that, the solution for this will change... thanks, greg k-h