Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56259
b: refs/heads/master
c: 54936f8
h: refs/heads/master
i:
  56257: 24eb89d
  56255: 9d99402
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed May 11, 2007
1 parent db477cb commit b58eccb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4d6d00466ef4879e4289f18c2f59210a06a7ada
refs/heads/master: 54936f8b099325992f0f212a5e366fd5257c6c9c
22 changes: 21 additions & 1 deletion trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
struct ata_taskfile tf;
unsigned int err_mask = 0;
const char *reason;
int tried_spinup = 0;
int may_fallback = 1, tried_spinup = 0;
int rc;

if (ata_msg_ctl(ap))
Expand Down Expand Up @@ -1704,11 +1704,31 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
return -ENOENT;
}

/* Device or controller might have reported the wrong
* device class. Give a shot at the other IDENTIFY if
* the current one is aborted by the device.
*/
if (may_fallback &&
(err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) {
may_fallback = 0;

if (class == ATA_DEV_ATA)
class = ATA_DEV_ATAPI;
else
class = ATA_DEV_ATA;
goto retry;
}

rc = -EIO;
reason = "I/O error";
goto err_out;
}

/* Falling back doesn't make sense if ID data was read
* successfully at least once.
*/
may_fallback = 0;

swap_buf_le16(id, ATA_ID_WORDS);

/* sanity check */
Expand Down

0 comments on commit b58eccb

Please sign in to comment.