ahci - Improve port-multiplier detection
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 21 Dec 2016 19:14:17 +0000 (11:14 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 21 Dec 2016 19:23:21 +0000 (11:23 -0800)
commit46d04d11e6cf87e3615b3bf97f11d489b53b7ed1
tree4b66bc87cf09fdb0309ce53e16b90071ee4f93c0
parent76a9ffcad156592e905b992edaa9339d2941cf43
ahci - Improve port-multiplier detection

* Improve port-multiplier detaction by adding workarounds for
  poorly-implemented AHCI and PM chipsets.  Now detects the popular
  Rosewill 4-bay enclosure, which uses chipid 0x575f197b.

  Increase device detect timeout from 3/10 second to 2 seconds.  This
  enclosure stupidly takes extra time on the first COMRESET after a cold
  power-on to detect, I'm guessing because it is testing both its USB and
  its eSATA port.

  This port multiplier sometimes returns ready before its software has
  completely initialized, causing PM register READs to succeed, but
  return data values of 0.  If we get a data value of 0 for the REV register
  we sleep a little and try once more.

* Marvell AHCI chip does not immediately latch the signature on the
  second FIS during a software reset.  Give it 500ms to do so.

  Ignore a BSY condition between the first and second FIS during a software
  reset probe of the PM.
sys/dev/disk/ahci/ahci.c
sys/dev/disk/ahci/ahci_pm.c
sys/dev/disk/ahci/pmreg.h