libata: relocate and fix post-command processing
authorTejun Heo <htejun@gmail.com>
Thu, 25 Oct 2007 09:22:44 +0000 (18:22 +0900)
committerJeff Garzik <jeff@garzik.org>
Mon, 29 Oct 2007 10:15:25 +0000 (06:15 -0400)
commit4dbfa39b6c95eb9d0aedb5bd00bb552b91c31e3d
treeb3b92aa44fe651af464373d8a21a3da8897fa479
parent2a397e82c7db18019e408f953dd58dc1963a328c
libata: relocate and fix post-command processing

Some commands need post-processing after successful completion.  This
was done in ata_scsi_qc_complete() till now but this has the following
problems.

* Post-command processing gets executed when qc is completed from EH.
  Some qc's are retried from EH with zero err_mask and thus triggers
  unnecessary/incorrect post-command processing.

* Command post processing doesn't belong to SAT layer.

* Link-wide revalidation was scheduled where device revalidation
  suffices.

This patch moves post-command processing to success completion path of
ata_qc_complete() which is travelled iff the command is going to be
completed without passing through EH and updates post-command
processing such that device-specific action is used.  While at it,
restructure code a bit for readability.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c