AHCI - Implement better timeout semantics, fix bug in error handling, softreset
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 14 Jun 2009 03:27:59 +0000 (20:27 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 14 Jun 2009 03:27:59 +0000 (20:27 -0700)
commit4c339a5f388e695f1464ef583b1d0f20b03c5233
tree3670f8ae5638084ec71348025dc90a7a9be561f4
parentbaef7501db74ac1066fe62829e589fc7c605fd8d
AHCI - Implement better timeout semantics, fix bug in error handling, softreset

* Stopping a port with ahci_port_stop() is problematic if the port has not
  already been stopped by the command processor (CR is inactive), because
  command completions can race our saved CI register, leading to
  double-issues.  This creates issues with both NCQ and FBSS support.

  Change the timeout code to idle the port by allowing commands to
  complete normally until the only commands remaining are expired.
  Then the port can be safely stopped.

  The timeout code also no longer performs a softreset.  It used to under
  certain conditions.

* With the changes to the timeout code softreset is no longer being called
  from the timeout code, remove hacks from the softreset code that attempted
  to restore the command processing state on failure.

* The CAM code was not properly generating dummy SENSE data for command
  timeouts, leading the kernel to believe that the command succeeded
  when it in fact failed.
sys/dev/disk/ahci/ahci.c
sys/dev/disk/ahci/ahci.h
sys/dev/disk/ahci/ahci_cam.c
sys/dev/disk/ahci/ahci_pm.c