Skip to content

Commit

Permalink
[PATCH] libata: check Word 88 validity in ata_id_xfer_mask()
Browse files Browse the repository at this point in the history
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 <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Mar 12, 2006
1 parent 2044470 commit fb21f0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit fb21f0d

Please sign in to comment.