Skip to contentSkip to conversation

contrary ide_register() lock description 2.5.69

DISCUSSION Douglas Gilbert 1 participant 1 message May 5, 2003

lore
Share & tools
lore
#0 lore raw

The comments above ide_unregister() function definition in lk 2.5.69 include this:

 *      Take care with the callbacks. These have been split to avoid
 *      deadlocking the IDE layer. The shutdown callback is called
 *      before we take the lock and free resources. It is up to the
 *      caller to be sure there is no pending I/O here, and that
 *      the interfce will not be reopened (present/vanishing locking
 *      isnt yet done btw). After we commit to the final kill we
 *      call the cleanup callback with the ide locks held.

The code that follows in ide.c shows the ide_lock being taken prior to the shutdown callback and then let go prior to cleanup callback. That's not what those comments suggest.

However I do like the remaining comments in ide_unregister():

* Unregister restores the hwif structures to the default state.
* This is raving bonkers.

Doug Gilbert