libata: handle SEMB signature better
WDC WD1600JS-62MHB5 successfully hits the window between ATA/ATAPI-7 and Serial ATA II standards and reports 3c/c3 signature which now is assigned to SEMB. Make ata_dev_classify() report ATA_DEV_SEMB on the sig and let ata_dev_read_id() work around it by trying IDENTIFY once. This fixes bko#11579. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: David Haun <drhaun88@gmail.com> Reported-by: Lars Wirzenius <liw@liw.fi> Reported-by: Juan Manuel <jmcarranza@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
Родитель
35c80d5f40
Коммит
79b42babba
|
@ -1231,6 +1231,9 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
|
||||||
*
|
*
|
||||||
* We follow the current spec and consider that 0x69/0x96
|
* We follow the current spec and consider that 0x69/0x96
|
||||||
* identifies a port multiplier and 0x3c/0xc3 a SEMB device.
|
* identifies a port multiplier and 0x3c/0xc3 a SEMB device.
|
||||||
|
* Unfortunately, WDC WD1600JS-62MHB5 (a hard drive) reports
|
||||||
|
* SEMB signature. This is worked around in
|
||||||
|
* ata_dev_read_id().
|
||||||
*/
|
*/
|
||||||
if ((tf->lbam == 0) && (tf->lbah == 0)) {
|
if ((tf->lbam == 0) && (tf->lbah == 0)) {
|
||||||
DPRINTK("found ATA device by sig\n");
|
DPRINTK("found ATA device by sig\n");
|
||||||
|
@ -1248,8 +1251,8 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tf->lbam == 0x3c) && (tf->lbah == 0xc3)) {
|
if ((tf->lbam == 0x3c) && (tf->lbah == 0xc3)) {
|
||||||
printk(KERN_INFO "ata: SEMB device ignored\n");
|
DPRINTK("found SEMB device by sig (could be ATA device)\n");
|
||||||
return ATA_DEV_SEMB_UNSUP; /* not yet */
|
return ATA_DEV_SEMB;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTK("unknown device\n");
|
DPRINTK("unknown device\n");
|
||||||
|
@ -2080,6 +2083,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
|
||||||
struct ata_taskfile tf;
|
struct ata_taskfile tf;
|
||||||
unsigned int err_mask = 0;
|
unsigned int err_mask = 0;
|
||||||
const char *reason;
|
const char *reason;
|
||||||
|
bool is_semb = class == ATA_DEV_SEMB;
|
||||||
int may_fallback = 1, tried_spinup = 0;
|
int may_fallback = 1, tried_spinup = 0;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -2090,6 +2094,8 @@ retry:
|
||||||
ata_tf_init(dev, &tf);
|
ata_tf_init(dev, &tf);
|
||||||
|
|
||||||
switch (class) {
|
switch (class) {
|
||||||
|
case ATA_DEV_SEMB:
|
||||||
|
class = ATA_DEV_ATA; /* some hard drives report SEMB sig */
|
||||||
case ATA_DEV_ATA:
|
case ATA_DEV_ATA:
|
||||||
tf.command = ATA_CMD_ID_ATA;
|
tf.command = ATA_CMD_ID_ATA;
|
||||||
break;
|
break;
|
||||||
|
@ -2126,6 +2132,14 @@ retry:
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_semb) {
|
||||||
|
ata_dev_printk(dev, KERN_INFO, "IDENTIFY failed on "
|
||||||
|
"device w/ SEMB sig, disabled\n");
|
||||||
|
/* SEMB is not supported yet */
|
||||||
|
*p_class = ATA_DEV_SEMB_UNSUP;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) {
|
if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) {
|
||||||
/* Device or controller might have reported
|
/* Device or controller might have reported
|
||||||
* the wrong device class. Give a shot at the
|
* the wrong device class. Give a shot at the
|
||||||
|
|
Загрузка…
Ссылка в новой задаче