Jeff Garzik wrote:
Tejun Heo wrote:
07_NCQ_ahci-stop-dma-before-reset.patch
AHCI 1.1 mandates stopping dma before issueing COMMRESET. The
original code didn't and it resulted in occasional lockup of
the controller during EH recovery. This patch fixes the
problem.
Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
ahci.c | 2 ++
1 files changed, 2 insertions(+)
Index: work/drivers/scsi/ahci.c
===================================================================
--- work.orig/drivers/scsi/ahci.c 2005-06-27 00:20:31.000000000 +0900
+++ work/drivers/scsi/ahci.c 2005-06-27 00:20:31.000000000 +0900
@@ -474,7 +474,9 @@ static void ahci_phy_reset(struct ata_po
struct ata_device *dev = &ap->device[0];
u32 tmp;
+ ahci_stop_dma(ap);
__sata_phy_reset(ap);
+ ahci_start_dma(ap);
This is a bit worrisome, because we really shouldn't be calling
ahci_phy_reset() when DMA is -not- stopped. That's a violation of the
state machine.
Jeff
Hello, Jeff.
The case occurs when qc's time out. When qc's time out, we need to
forcefully terminate those and reset the state machine, so the violation
of the state machine is necessary there, I think.
When EH kicks in, ATA_FLAG_RECOVERY gets set, and all non-preempt qc
completions/errors are ignored until recovery completes. Then, the
device gets reset and recovery commands are issued. IOW, the state
machine violation occurs while all completion/error notifications from
the device are being ignored, and, after reset is complete, the state
machine is restarted from a determined state.
If I missed something, please point out.
Thanks.
--
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html