Commit 7c398335 authored by Albert Lee's avatar Albert Lee Committed by Jeff Garzik

[PATCH] libata: if condition fix for ata_dev_identify()

  - if condition fix for ata_dev_identify()
  - ata_pio_poll() minor cleanup.

Changes:
   - Use (dev->class == ATA_DEV_ATA) for ata_dev_identify()
     since "qc->tf.command" has been overwritten by the device status
   - Use HSM_ST_TMOUT directly in ata_pio_poll()
Signed-off-by: default avatarAlbert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 8e8b77dd
...@@ -1144,7 +1144,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device) ...@@ -1144,7 +1144,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
* ATA software reset (SRST, the default) does not appear * ATA software reset (SRST, the default) does not appear
* to have this problem. * to have this problem.
*/ */
if ((using_edd) && (qc->tf.command == ATA_CMD_ID_ATA)) { if ((using_edd) && (dev->class == ATA_DEV_ATA)) {
u8 err = qc->tf.feature; u8 err = qc->tf.feature;
if (err & ATA_ABORTED) { if (err & ATA_ABORTED) {
dev->class = ATA_DEV_ATAPI; dev->class = ATA_DEV_ATAPI;
...@@ -2747,7 +2747,6 @@ static unsigned long ata_pio_poll(struct ata_port *ap) ...@@ -2747,7 +2747,6 @@ static unsigned long ata_pio_poll(struct ata_port *ap)
u8 status; u8 status;
unsigned int poll_state = HSM_ST_UNKNOWN; unsigned int poll_state = HSM_ST_UNKNOWN;
unsigned int reg_state = HSM_ST_UNKNOWN; unsigned int reg_state = HSM_ST_UNKNOWN;
const unsigned int tmout_state = HSM_ST_TMOUT;
switch (ap->hsm_task_state) { switch (ap->hsm_task_state) {
case HSM_ST: case HSM_ST:
...@@ -2768,7 +2767,7 @@ static unsigned long ata_pio_poll(struct ata_port *ap) ...@@ -2768,7 +2767,7 @@ static unsigned long ata_pio_poll(struct ata_port *ap)
status = ata_chk_status(ap); status = ata_chk_status(ap);
if (status & ATA_BUSY) { if (status & ATA_BUSY) {
if (time_after(jiffies, ap->pio_task_timeout)) { if (time_after(jiffies, ap->pio_task_timeout)) {
ap->hsm_task_state = tmout_state; ap->hsm_task_state = HSM_ST_TMOUT;
return 0; return 0;
} }
ap->hsm_task_state = poll_state; ap->hsm_task_state = poll_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment