From fb21f0d0ec7e31cc814165e1a9d2662d9c9dd980 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Sun, 12 Mar 2006 12:34:35 +0900 Subject: [PATCH] [PATCH] libata: check Word 88 validity in ata_id_xfer_mask() Check bit 2 of Word 53 for Word 88 validity before using Word 88 to determine UDMA mask. Note that the original xfer mask implementation using ata_get_mode_mask() didn't consider bit 2 of Word 53. This patch introduces different (correct) behavior. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- drivers/scsi/libata-core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index c17df3f22fd1..439b6db13802 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -819,7 +819,10 @@ static unsigned int ata_id_xfermask(const u16 *id) } mwdma_mask = id[ATA_ID_MWDMA_MODES] & 0x07; - udma_mask = id[ATA_ID_UDMA_MODES] & 0xff; + + udma_mask = 0; + if (id[ATA_ID_FIELD_VALID] & (1 << 2)) + udma_mask = id[ATA_ID_UDMA_MODES] & 0xff; return ata_pack_xfermask(pio_mask, mwdma_mask, udma_mask); } -- 2.20.1