lkml.org 
[lkml]   [2008]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] firewire: reread config ROM when device reset the bus
On Mon, Mar 03, 2008 at 07:35:07PM +0100, Stefan Richter wrote:
> I wrote:
>>> On Mon, Mar 3, 2008 at 11:51 AM, Stefan Richter
>>> <stefanr@s5r6.in-berlin.de> wrote:
> [...rewriting data of a device with children devices whose driver probe
> accesses these data...]
>>>> Maybe I should rather use fw-device.c::idr_rwsem instead of device.sem,
>>>> to have better control over who takes the mutex when. Could also be a
>>>> new dedicated mutex but we don't want to end up with too many of
>>>> them...
> [...]
>> Ah, wait, there is a 3rd reader: sbp2_probe's sbp2_scan_unit_dir. So,
>> using dev->sem is actually the nicest way for now.
>
> Or not. The necessary protection for this and other driver->probe()s would
> be the device->parent.sem, not the device->sem itself. There seem to be
> several ways how a driver probe may be entered (adding a device when the
> driver is already there; attaching a driver when the device is already
> there...) and I am not sure whether all these paths take the
> device->parent.sem around the probe. It doesn't seem to be always the
> case.
>
> Greg, can you comment on this?

Hm, comment on what? Ah, semaphore fun in the device. If at all
possible, use your own, not the driver core as the locking there is a
bit "odd" as you have seen. I think Alan Stern has some patches pending
to mess with it all to try to make it sane during the suspend/resume
path.

thanks,

greg k-h


\
 
 \ /
  Last update: 2008-03-04 06:57    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site