aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorAlbert Lee <albertcc@tw.ibm.com>2005-12-05 22:34:59 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-12-06 04:49:23 -0500
commitfe79e683ccdb29c13b3e0d18507474b4e2d9aab6 (patch)
tree855a61daec6898c089d135f54ab1fd6283edf27b /drivers/scsi/libata-core.c
parentd8fe452b3e8e9ea6d62a3d116a092999fabae407 (diff)
[PATCH] libata: err_mask misc fix
1. ata_pio_complete(): It seems unnecessary to wait for the clearing of the DRQ bit. (Waiting for BSY=0 should be enough. ata_ok() also checks the correctness of the status bits later.) 2. ata_pio_block(): - added error checking, before transfering data. - minor comments fix Signed-off-by: Albert Lee <albertcc@tw.ibm.com> ============ Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index b3aedb033465..e4c400756b23 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2865,11 +2865,11 @@ static int ata_pio_complete (struct ata_port *ap)
2865 * msecs, then chk-status again. If still busy, fall back to 2865 * msecs, then chk-status again. If still busy, fall back to
2866 * HSM_ST_POLL state. 2866 * HSM_ST_POLL state.
2867 */ 2867 */
2868 drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 10); 2868 drv_stat = ata_busy_wait(ap, ATA_BUSY, 10);
2869 if (drv_stat & (ATA_BUSY | ATA_DRQ)) { 2869 if (drv_stat & ATA_BUSY) {
2870 msleep(2); 2870 msleep(2);
2871 drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 10); 2871 drv_stat = ata_busy_wait(ap, ATA_BUSY, 10);
2872 if (drv_stat & (ATA_BUSY | ATA_DRQ)) { 2872 if (drv_stat & ATA_BUSY) {
2873 ap->hsm_task_state = HSM_ST_LAST_POLL; 2873 ap->hsm_task_state = HSM_ST_LAST_POLL;
2874 ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO; 2874 ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO;
2875 return 0; 2875 return 0;
@@ -3236,8 +3236,16 @@ static void ata_pio_block(struct ata_port *ap)
3236 qc = ata_qc_from_tag(ap, ap->active_tag); 3236 qc = ata_qc_from_tag(ap, ap->active_tag);
3237 assert(qc != NULL); 3237 assert(qc != NULL);
3238 3238
3239 /* check error */
3240 if (status & (ATA_ERR | ATA_DF)) {
3241 qc->err_mask |= AC_ERR_DEV;
3242 ap->hsm_task_state = HSM_ST_ERR;
3243 return;
3244 }
3245
3246 /* transfer data if any */
3239 if (is_atapi_taskfile(&qc->tf)) { 3247 if (is_atapi_taskfile(&qc->tf)) {
3240 /* no more data to transfer or unsupported ATAPI command */ 3248 /* DRQ=0 means no more data to transfer */
3241 if ((status & ATA_DRQ) == 0) { 3249 if ((status & ATA_DRQ) == 0) {
3242 ap->hsm_task_state = HSM_ST_LAST; 3250 ap->hsm_task_state = HSM_ST_LAST;
3243 return; 3251 return;