diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-09-29 13:26:47 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-10-05 06:55:00 -0400 |
commit | 46767aeba58ca9357a2309765201bad38d8f5e9b (patch) | |
tree | 8274aafaf9c3e2232c12493fd1a79cb9483f6f90 /drivers/ata/libata-core.c | |
parent | d223a60106891bfe46febfacf46b20cd8509aaad (diff) |
[PATCH] libata: Don't believe bogus claims in the older PIO mode register
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index dce65651d858..ad8e2c64c867 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -870,7 +870,11 @@ static unsigned int ata_id_xfermask(const u16 *id) | |||
870 | * the PIO timing number for the maximum. Turn it into | 870 | * the PIO timing number for the maximum. Turn it into |
871 | * a mask. | 871 | * a mask. |
872 | */ | 872 | */ |
873 | pio_mask = (2 << (id[ATA_ID_OLD_PIO_MODES] & 0xFF)) - 1 ; | 873 | u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF; |
874 | if (mode < 5) /* Valid PIO range */ | ||
875 | pio_mask = (2 << mode) - 1; | ||
876 | else | ||
877 | pio_mask = 1; | ||
874 | 878 | ||
875 | /* But wait.. there's more. Design your standards by | 879 | /* But wait.. there's more. Design your standards by |
876 | * committee and you too can get a free iordy field to | 880 | * committee and you too can get a free iordy field to |