aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libata-core.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 99bae8369ab2..bc48d88fef5a 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1051,18 +1051,22 @@ static unsigned int ata_pio_modes(const struct ata_device *adev)
1051{ 1051{
1052 u16 modes; 1052 u16 modes;
1053 1053
1054 /* Usual case. Word 53 indicates word 88 is valid */ 1054 /* Usual case. Word 53 indicates word 64 is valid */
1055 if (adev->id[ATA_ID_FIELD_VALID] & (1 << 2)) { 1055 if (adev->id[ATA_ID_FIELD_VALID] & (1 << 1)) {
1056 modes = adev->id[ATA_ID_PIO_MODES] & 0x03; 1056 modes = adev->id[ATA_ID_PIO_MODES] & 0x03;
1057 modes <<= 3; 1057 modes <<= 3;
1058 modes |= 0x7; 1058 modes |= 0x7;
1059 return modes; 1059 return modes;
1060 } 1060 }
1061 1061
1062 /* If word 88 isn't valid then Word 51 holds the PIO timing number 1062 /* If word 64 isn't valid then Word 51 high byte holds the PIO timing
1063 for the maximum. Turn it into a mask and return it */ 1063 number for the maximum. Turn it into a mask and return it */
1064 modes = (2 << (adev->id[ATA_ID_OLD_PIO_MODES] & 0xFF)) - 1 ; 1064 modes = (2 << ((adev->id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF)) - 1 ;
1065 return modes; 1065 return modes;
1066 /* But wait.. there's more. Design your standards by committee and
1067 you too can get a free iordy field to process. However its the
1068 speeds not the modes that are supported... Note drivers using the
1069 timing API will get this right anyway */
1066} 1070}
1067 1071
1068struct ata_exec_internal_arg { 1072struct ata_exec_internal_arg {