[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0703121216210.2489-100000@iolanthe.rowland.org>
Date: Mon, 12 Mar 2007 12:21:49 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Oliver Neukum <oneukum@...e.de>
cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Maneesh Soni <maneesh@...ibm.com>, <gregkh@...e.de>,
<linux-kernel@...r.kernel.org>
Subject: Re: refcounting drivers' data structures used in sysfs buffers
On Mon, 12 Mar 2007, Oliver Neukum wrote:
> > > Yes, I was missing the point. In consequence, drivers must not use
> > > dev_get_drvdata() to get their references to their private data. It's
You do realize how foolish that sounds? Why do you think
dev_get_drvdata() was written in the first place?
> > > probably necessary to store it in struct sysfs_buffer and include that
> > > in the store/show callbacks.
> > > (The same does apply to interfaces of course)
> > >
> >
> > Or drivers coudl verify that they still bound to the device they are
> > about to operate on (psmouse does this by taking a lock on device and
> > then checking if driver bound is the same address as psmouse). But I'd
> > rather get rid of all this clutter if we could sever sysfs access
> > after removing corresponding attributes.
>
> No, the call has to fail if the driver is rebound to the device.
I'm with Dmitry; the whole thing becomes much, much simpler if we put back
your patch and prevent sysfs access after unregistering an attribute
file. No API changes are needed, no driver changes are needed, no radical
core changes are needed,... All we would have to do is fix the one SCSI
method to make it use a workqueue.
Alan Stern
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists