From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: Re: [RFC] Some thoughts on device drivers and sysfs Date: Tue, 29 Mar 2005 01:33:58 -0500 Message-ID: <200503290133.59002.dtor_core@ameritech.net> References: <1111951499.3503.87.camel@localhost.localdomain> <20050329050345.GB7937@kroah.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============054201649557331422==" Return-path: In-Reply-To: <20050329050345.GB7937-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces-qjLDD68F18O7TbgM5vRIOg@public.gmane.org Errors-To: linux-pm-bounces-qjLDD68F18O7TbgM5vRIOg@public.gmane.org To: linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org Cc: Adam Belay , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-pm@vger.kernel.org --===============054201649557331422== Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by smtp.osdl.org id j2T6Y3s4018935 On Tuesday 29 March 2005 00:03, Greg KH wrote: > On Sun, Mar 27, 2005 at 02:24:59PM -0500, Adam Belay wrote: > > One of the original design goals of sysfs was to provide a standardiz= ed > > location to keep driver configuration attributes. =C2=A0Although sysf= s > > handles this very well for bus devices and class devices, there isn't > > currently a method to export attributes for device drivers and their > > specific bound device instances to userspace. >=20 > Hm, what's device_create_file(), device_remove_file(), and DEVICE_ATTR(= ) > for? =C2=A0A number of drivers use these functions today to add their o= wn > driver specific attributes to a device they control. >=20 > Then, userspace can just do a simple: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ls /sys/bus/pci/drivers= /my_foo_driver/ > to see all devices on the PCI bus that are controlled by that driver. > Then it can go into those directories and cat out the specific > information if needed. It probably would be nice if all driver-specific device attributes would = be grouped under /sys/devices/...//drvattr/* so their names wou= ld not clash with names of driver core attributes. Unfortunately that would mean we are breaking userspace again... --=20 Dmitry --===============054201649557331422== Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable --===============054201649557331422==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262455AbVC2Gfg (ORCPT ); Tue, 29 Mar 2005 01:35:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262280AbVC2Gf3 (ORCPT ); Tue, 29 Mar 2005 01:35:29 -0500 Received: from smtp800.mail.sc5.yahoo.com ([66.163.168.179]:61796 "HELO smtp800.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S262278AbVC2GeB convert rfc822-to-8bit (ORCPT ); Tue, 29 Mar 2005 01:34:01 -0500 From: Dmitry Torokhov To: linux-pm@lists.osdl.org Subject: Re: [linux-pm] Re: [RFC] Some thoughts on device drivers and sysfs Date: Tue, 29 Mar 2005 01:33:58 -0500 User-Agent: KMail/1.7.2 Cc: Greg KH , Adam Belay , linux-kernel@vger.kernel.org References: <1111951499.3503.87.camel@localhost.localdomain> <20050329050345.GB7937@kroah.com> In-Reply-To: <20050329050345.GB7937@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Message-Id: <200503290133.59002.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 29 March 2005 00:03, Greg KH wrote: > On Sun, Mar 27, 2005 at 02:24:59PM -0500, Adam Belay wrote: > > One of the original design goals of sysfs was to provide a standardized > > location to keep driver configuration attributes.  Although sysfs > > handles this very well for bus devices and class devices, there isn't > > currently a method to export attributes for device drivers and their > > specific bound device instances to userspace. > > Hm, what's device_create_file(), device_remove_file(), and DEVICE_ATTR() > for?  A number of drivers use these functions today to add their own > driver specific attributes to a device they control. > > Then, userspace can just do a simple: >         ls /sys/bus/pci/drivers/my_foo_driver/ > to see all devices on the PCI bus that are controlled by that driver. > Then it can go into those directories and cat out the specific > information if needed. It probably would be nice if all driver-specific device attributes would be grouped under /sys/devices/...//drvattr/* so their names would not clash with names of driver core attributes. Unfortunately that would mean we are breaking userspace again... -- Dmitry