]> bbs.cooldavid.org Git - net-next-2.6.git/commit
sata_promise: update reset code
authorMikael Pettersson <mikpe@it.uu.se>
Tue, 15 Sep 2009 13:08:47 +0000 (15:08 +0200)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 17 Sep 2009 20:46:34 +0000 (16:46 -0400)
commitff7cddf59e3618d29e12b061651ab3f5a53f4a98
treeb45b879b6ca820b074ea69ee218f92247932ebd4
parent0ae6654da437db4ae6333d232e718b570c7a3eac
sata_promise: update reset code

sata_promise's reset code has deviated quite a bit from
the Promise reference driver's, and it has been observed
to fail to recover from errors in some cases.

This patch thus updates the reset code to more closely
match the reference driver:

- soft reset (pdc_reset_port):
  * wait for ATA engine to not be in packet command mode
    (2nd gen only)
  * write reset bit in PDC_CTLSTAT before the first read
    in the loop
  * for 2nd gen SATA follow up with FPDMA reset and clearing
    error status registers
- hard reset (pdc_sata_hardreset):
  * wait for ATA engine to not be in packet command mode
    (2nd gen only)
  * reset ATA engine via the PCI control register
  * Tejun's change to use non-waiting hardreset + follow-up SRST

I'm not changing the hotplug mask bits since they are taken care
of by sata_promise's ->freeze() and ->thaw() operations. And I'm
not writing the PMP port # because that's always zero (for now).

Tested here on various controllers. In particular, one disk
which used to timeout and fail to recover from certain hdparm
and smartmonctl commands now works nicely.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/sata_promise.c