cvs commit: src/sys/dev/usb if_aue.c if_auereg.h

Alfred Perlstein alfred at FreeBSD.org
Sat Dec 23 09:18:32 PST 2006


alfred      2006-12-23 17:18:18 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/usb          if_aue.c if_auereg.h 
  Log:
  Fix a deadlock in detach/shutdown.
  
  The problem was that I was acquiring the driver sx lock and then waiting
  for a taskqueue to drain, however the taskqueue itself would try to
  acquire the lock as well leading to a deadlock.
  
  To fix the problem roll my own exclusive lock that allows for lock
  cancellation.  This is a normal exclusive lock, however if someone
  marks it as "dead" then all waiters who request an error return will
  get back an error instead of continuing to wait for the lock.
  
  In this particular case, the shutdown and detach functions kill the
  lock while the async task thread tries to acquire the lock but will
  abort if the lock returns an error.
  
  The other option was to drop the driver lock mid-detach and mid-shutdown,
  mid-detach was a ok, however mid-shutdown was not.
  
  While I'm here, fix a bug in what appears to be the mii link status
  word in the softc going out to lunch.  Explicitly set the status
  word to 1 after initializing the mii.  This would result in an interface
  that would never respond to "if_start" requests as the mii interface
  would always look down.
  
  Revision  Changes    Path
  1.104     +155 -15   src/sys/dev/usb/if_aue.c
  1.26      +9 -5      src/sys/dev/usb/if_auereg.h


More information about the cvs-all mailing list