Commit 7a0f1c8a authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Jeff Garzik

ata_if_xfermask() word 51 fix

If word 53 bit 1 isn't set, the maximum PIO mode is indicated by
the upper 8 bits of word 51, not the lower 8 bits.  Fixes PIO mode
detection on old Compact Flash cards.
Signed-off-by: default avatarLennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 5dcade90
...@@ -1037,7 +1037,7 @@ static unsigned int ata_id_xfermask(const u16 *id) ...@@ -1037,7 +1037,7 @@ static unsigned int ata_id_xfermask(const u16 *id)
* the PIO timing number for the maximum. Turn it into * the PIO timing number for the maximum. Turn it into
* a mask. * a mask.
*/ */
u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF; u8 mode = (id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF;
if (mode < 5) /* Valid PIO range */ if (mode < 5) /* Valid PIO range */
pio_mask = (2 << mode) - 1; pio_mask = (2 << mode) - 1;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment