Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8fe452b authored by Albert Lee's avatar Albert Lee Committed by Jeff Garzik
Browse files

[PATCH] libata: determine the err_mask directly in atapi_packet_task()



  - set qc->err_mask directly when we found the error
  - remove the code to determine err_mask from device status

Signed-off-by: default avatarAlbert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 1c848984
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -4083,13 +4083,17 @@ static void atapi_packet_task(void *_data)


	/* sleep-wait for BSY to clear */
	/* sleep-wait for BSY to clear */
	DPRINTK("busy wait\n");
	DPRINTK("busy wait\n");
	if (ata_busy_sleep(ap, ATA_TMOUT_CDB_QUICK, ATA_TMOUT_CDB))
	if (ata_busy_sleep(ap, ATA_TMOUT_CDB_QUICK, ATA_TMOUT_CDB)) {
		goto err_out_status;
		qc->err_mask |= AC_ERR_ATA_BUS;
		goto err_out;
	}


	/* make sure DRQ is set */
	/* make sure DRQ is set */
	status = ata_chk_status(ap);
	status = ata_chk_status(ap);
	if ((status & (ATA_BUSY | ATA_DRQ)) != ATA_DRQ)
	if ((status & (ATA_BUSY | ATA_DRQ)) != ATA_DRQ) {
		qc->err_mask |= AC_ERR_ATA_BUS;
		goto err_out;
		goto err_out;
	}


	/* send SCSI cdb */
	/* send SCSI cdb */
	DPRINTK("send cdb\n");
	DPRINTK("send cdb\n");
@@ -4121,10 +4125,7 @@ static void atapi_packet_task(void *_data)


	return;
	return;


err_out_status:
	status = ata_chk_status(ap);
err_out:
err_out:
	qc->err_mask |= __ac_err_mask(status);
	ata_poll_qc_complete(qc);
	ata_poll_qc_complete(qc);
}
}