summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-09-13 07:35:49 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-13 18:32:14 +0400
commita4f5749ba6e3f23ae4a137cee10324830db4d081 (patch)
tree5f3908d5bf29f97b65c01a140bb62a9ef9e3003a
parent95064a75ebf8744e1ff595e8cd7ff9b6c851523e (diff)
downloadlinux-a4f5749ba6e3f23ae4a137cee10324830db4d081.tar.xz
[PATCH] libata: ignore CFA signature while sanity-checking an ATAPI device
0x848a in ID word 0 indicates CFA device iff the ID data is obtained from IDENTIFY DEVICE. For ATAPI devices, 0x848a in ID work 0 indicates valid ATAPI device. Fix sanity check in ata_dev_read_id() such that ATAPI devices reporting 0x848a in ID word 0 is not handled as error. The problem is identified by J.A. Magallon with HL-DT-ST DVDRAM GSA-4120B. Signed-off-by: Tejun Helo <htejun@gmail.com> Cc: J.A. Magallon <jamagallon@ono.com> Acked-by: Jeff Garzik <jeff@garzik.org> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/scsi/libata-core.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 73dd6c8deede..427b73a3886a 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1256,10 +1256,15 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
swap_buf_le16(id, ATA_ID_WORDS);
/* sanity check */
- if ((class == ATA_DEV_ATA) != (ata_id_is_ata(id) | ata_id_is_cfa(id))) {
- rc = -EINVAL;
- reason = "device reports illegal type";
- goto err_out;
+ rc = -EINVAL;
+ reason = "device reports illegal type";
+
+ if (class == ATA_DEV_ATA) {
+ if (!ata_id_is_ata(id) && !ata_id_is_cfa(id))
+ goto err_out;
+ } else {
+ if (ata_id_is_ata(id))
+ goto err_out;
}
if (post_reset && class == ATA_DEV_ATA) {