]> git.hungrycats.org Git - linux/commit
[PATCH] USB: OHCI resume/reset stops deadlocking in PM code
authorDavid Brownell <david-b@pacbell.net>
Tue, 11 May 2004 08:56:50 +0000 (01:56 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 11 May 2004 08:56:50 +0000 (01:56 -0700)
commit2a3396705416ae35c9f2516cf72db645b7b60b16
treece77c58d196cd14e7689d3eb336c5ceba893d4c2
parentec0e35582cdb938b4086a8f3643932fab885df35
[PATCH] USB: OHCI resume/reset stops deadlocking in PM code

System-wide PM resume now happily deadlocks if one of the
resuming devices tries to remove devices which vanished
during the suspend(*).  IMO that's unreasonable both
because devices can/do vanish, and because 2.4 didn't
deadlock in those cases; but no patch to fix that has been
merged.  The result is that ever since merging the "new" PM
code, some OHCI-based systems deadlock on resume.

So this patch handles the "lost power during resume" case
differently:  it doesn't disconnect the root hub (or its
children) directly.  Instead, it does part of that work
immediately, and defers the rest to khubd:

  - add a "pending" list for live urbs, and use it after reset
    to abort pending URBs (and reclaim "live" EDs/TDs)
  - immediately mark all devices NOTATTACHED, so any operations
    on the devices before khubd handles the disconnects, including
    resume() callbacks, will fail
  - kick root hub so it can do the cleanup

It also handles "fminterval" init/reinit a bit better, mostly
to work better in some remote wakeup scenarios addressed in
later patches:

   - save any initial value the boot firmware provided
   - use it during initialization (and eventually, remote wakeup)

Other changes:

  - use better jiffies calculation for scheduled delays
  - the allocator does more of the one-time initialization
  - initialize hcd.can_wakeup according to boot firmware
  - move some inlines to the header
  - minor cleanups

(*) http://marc.theaimsgroup.com/?l=linux-kernel&m=106606272103414&w=2
     reported against 2.6.0-test7.
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-mem.c
drivers/usb/host/ohci-q.c
drivers/usb/host/ohci.h