ahci: redo stopping DMA engines on empty ports
authorTejun Heo <tj@kernel.org>
Mon, 7 Jun 2010 13:15:08 +0000 (15:15 +0200)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 7 Jun 2010 20:03:15 +0000 (16:03 -0400)
commit0ee719527229fa86ace8e3abccae3c2a8bbfd6db
tree7c9e76554f55af8101f38b8e3338529b66b4d275
parent7a4f876b876afb13856a79a0402f71b9dfbe86a8
ahci: redo stopping DMA engines on empty ports

Commit 96d60303fd (ahci: Turn off DMA engines when there's no device)
implemented stopping DMA engines on empty ports but it used single
sampling of status registers to determine device presence which led to
disabling of DMA engines on occupied ports.  Do it after all EH
actions are complete using device presence state determined by EH.
This avoids spurious disabling of DMA engines and simplifies the code.

Signed-off-by: Tejun Heo <tj@kernel.org>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Robert Hancock <hancockrwd@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libahci.c