• Alan Stern's avatar
    [PATCH] USB: Updated USB device locking · 11c763cc
    Alan Stern authored
    This patch reintroduces the USB device locking code we tried out
    earlier.  As before, it solves the problem of effectively locking all
    the devices while drivers are registered and unregistered by introducing
    an rwsem.  Unlike the earlier attempt, this version does not ever try to
    acquire a lock re-entrantly.  I trust that will eliminate the races and
    hang-ups you observed with the earlier version.  There are also copious
    comments explaining exactly how things should work.
    
    The patch interacts slightly with the locktree() code introduced by
    David for suspend/resume support.  It doesn't change the functionality
    at all; it just updates the routine to follow the new locking rules.
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    11c763cc
devices.c 18.4 KB