Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4434127pxk; Wed, 30 Sep 2020 02:53:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/22mVOXsn7i4wMpc54UIEv2E17KWZowKQ3pbDUZVed9zcedfZ3m5WSUIqKGkNLZZpJgty X-Received: by 2002:a17:906:9389:: with SMTP id l9mr1981600ejx.537.1601459609817; Wed, 30 Sep 2020 02:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601459609; cv=none; d=google.com; s=arc-20160816; b=O/ZAmTVPjXMfGqoh8ibpKXAHPqd9un1Cv2kPodZp/jQxYpdfRxMHg1DZ82/hKWxH99 RkhS4a3+DDUx+DXRTo0Avp8+502QQjT5AmYfoIzFqzHegmf4183camSQyh8WjmpGMYYB HrpFARnQYSH//cpgyg+KSxuYDMGgHjN7//tzXhHEjCypaZNqn2XStps3pDq2tZ7J6L0r 2Uih8Tvwp7b3kuILASppRnMji3LxoDkvIS9IzzbUY6rjj1rpHKbwyjlpmdukKdZHxDNn 6Ji6uCH6N/mJbhZndbQwnP2nIgKlQRKkjmKLjgpeM+7Qul61Vbo96c+gbwA/LK1zz5ju h8pw== 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=5VUYgz6qSxvrEmPfy2heRlu28S3pY8uFE5mIg6a8aSk=; b=FSHFCRZXOUvaedQraaJzBx489+fDtlueTQSxETcdIB9SF2JMaYmDvrXy6ch1XxT6qp /AlAiVK9FCWiV7Y7Q2GfOT9k0xxmUUovSx2NS/hWdrxjTj9cONdhWZmCEw85pjesKdGA rH0u5o2OQbSozwJNDPUEGTrLw4lgUZHs2uQvskIjPcalrrLzF8cDcGO78qCiw2Gg9c+6 ykh18NpfURlXHnqdd5wqFnGWqputl4u03ENNN+XZabxMex7DnPXdAbWQQir+0cgSDwj0 quM42iv7H+NXRyijoAvBE9UGW0YiZN5arn2m+Pp7jezN/yGKf8i1AaBD6iUkVQZUWbPF LgeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nHevHf2Z; 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 q4si820911eji.683.2020.09.30.02.53.06; Wed, 30 Sep 2020 02:53:29 -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=nHevHf2Z; 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 S1728660AbgI3JwC (ORCPT + 99 others); Wed, 30 Sep 2020 05:52:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:47914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbgI3JwB (ORCPT ); Wed, 30 Sep 2020 05:52:01 -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 9B0732074A; Wed, 30 Sep 2020 09:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601459521; bh=sc+AQYG1RYfRu1GfD0zZ2JdLkx36ONLoOSKxzRGYl+U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nHevHf2ZIyWvAhviCcNO55bnfgd3PWWLS4IM5QDsNQptwb5yVfs3UBqH94RksgG/M ejK2dCh9w93TmYYKlpIiZuoHr4ZkAI19oHVti/kLS+zEV0lzmvEQnjtQqWKqJARHtE Y0zqD9CWTpDxGNJKY/mtjFih/iK/31Std6MpAGjE= Date: Wed, 30 Sep 2020 11:52:04 +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: <20200930095204.GA1585476@kroah.com> References: <20200929121953.2817843-1-poeschel@lemonage.de> <20200930065726.fjcsm4pfh65medgl@pengutronix.de> <20200930092056.maz5biy2ugr6yc3p@lem-wkst-02.lemonage> <20200930094146.73s3qzvf5ekjeavc@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200930094146.73s3qzvf5ekjeavc@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? thanks, greg k-h