cvs commit: src/sys/dev/usb ehci.c

Don Lewis truckman at FreeBSD.org
Sun Aug 12 11:45:25 PDT 2007


truckman    2007-08-12 18:45:25 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/usb          ehci.c 
  Log:
  Replace three copies of the host controller reset sequence that
  differ in their details with calls to a new function, ehci_hcreset(),
  that performs the reset.
  
  The original sequences either had no delay or a 1ms delay between
  telling the controller to stop and asserting the controller reset
  bit.  One instance of the original reset sequence waited for the
  controller to indicate that its reset was complete before continuing,
  but the other two immediately let the subsequent code execute.  The
  latter is a problem on some hardware, because a read of the HCCPARAMS
  register returns an incorrect value while the reset is in progress,
  which triggers an infinite loop in ehci_pci_givecontroller(), which
  hangs the system on shutdown.
  
  The reset sequence in ehci_hcreset() starts with the most complete
  instance from the original code, which contains a loop to wait for
  the controller to indicate that its reset is complete.   This appears
  to be the correct thing to do according to "Enhanced Host Controller
  Interface Specification for Universal Serial Bus" revision 1.0,
  section 2.3.1.  Add another loop to wait for the controller to
  indicate that it has stopped before setting the HCRESET bit.  This
  is required by the section 2.3.1 in the specification, which says
  that setting HCRESET before the controller has halted "will result
  in undefined behaviour".
  
  Reviewed by:    imp (previous patch version without the extra wait loop)
  Tested by:      se  (previous patch version without the extra wait loop)
  Approved by:    re (bmah)
  MFC after:      1 week
  
  Revision  Changes    Path
  1.56      +38 -18    src/sys/dev/usb/ehci.c


More information about the cvs-src mailing list