On Thu, Oct 24, 2002 at 12:46:12AM +0200, Oliver Neukum wrote:
> >
> > Seriously, this is a userspace issue.  The driver can set some initial
> > values that it things is good, but in the end, root can change them to
> > whatever it wants to, nothing new there.
> 
> Most definitely not true.
> 1. You make it impossible for drivers to implement exclusive open.
>     This assumption is built into all V4L drivers.

Wait, we aren't streaming video data out a driverfs file.  We are just
exporting or writing a single value for a single device.  What needs to
be "exclusive" for something like that?

> 2. You now have changes of permissions and ownership
>     which are not atomic.

Who's changing anything?  Userspace?  I don't see the kernel doing any
changes.  Or am I just confused here...

> > Even so, open is not needed to be passed to the driver.  Yes, of course
> > you need to do a open() call from userspace, and driverfs will get that
> > and handle the reference counting properly for the device that is
> > attached to that file.
> 
> You can do that for the module usage count. For reference counting
> of a driver's internal data structures you cannot depend on driverfs.

Um, driverfs knows the device that every attribute file that has been
created, so it knows the needed information.

> The alternative is for the driver to treat any read/write through driverfs
> as a combination of open+read/write+close.
> There seems to be some misunderstanding. Do you want to prevent
> disconnect() while read/write is running ?

No, we can't prevent that.  We should have the following:
        open(/sys/root/..../usb.../foo_value) returns file_handle
-- disconnect happens
-- device gets cleaned up
        read(file_handle) returns -ENODEV, or some other error value.
        close(file_handle)

Look ok?

Yes, it's not that way today, but we are getting there...

> > The goal is to not have drivers get driverfs (soon to be sysfs)
> > implementation wrong.  The current driver interface to it is quite
> > simple, and we want it to stay that way.
> 
> The usage recently seen on usb-devel was totally screwed, so I am
> judging by recent experience.

The current device values that the usb core exports through driverfs are
screwed?  How so?

thanks,

greg k-h


-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to