From b078b6eaebbe43e0c35f27022206d8fca00ad2a8 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 9 Jan 2006 17:14:40 +0000 Subject: [PATCH] --- yaml --- r: 18845 b: refs/heads/master c: ffa29456cd316a5394cdd489de5af3bf87d3c485 h: refs/heads/master i: 18843: a9ff8a3cb8b19a3ed6e972e32bbf456afe9d7367 v: v3 --- [refs] | 2 +- trunk/drivers/scsi/libata-core.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 139facae62cb..2ba26a915272 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5a46fe89a73dc984a2b9ef0fde9b9e58bd4ff98f +refs/heads/master: ffa29456cd316a5394cdd489de5af3bf87d3c485 diff --git a/trunk/drivers/scsi/libata-core.c b/trunk/drivers/scsi/libata-core.c index 99bae8369ab2..bc48d88fef5a 100644 --- a/trunk/drivers/scsi/libata-core.c +++ b/trunk/drivers/scsi/libata-core.c @@ -1051,18 +1051,22 @@ static unsigned int ata_pio_modes(const struct ata_device *adev) { u16 modes; - /* Usual case. Word 53 indicates word 88 is valid */ - if (adev->id[ATA_ID_FIELD_VALID] & (1 << 2)) { + /* Usual case. Word 53 indicates word 64 is valid */ + if (adev->id[ATA_ID_FIELD_VALID] & (1 << 1)) { modes = adev->id[ATA_ID_PIO_MODES] & 0x03; modes <<= 3; modes |= 0x7; return modes; } - /* If word 88 isn't valid then Word 51 holds the PIO timing number - for the maximum. Turn it into a mask and return it */ - modes = (2 << (adev->id[ATA_ID_OLD_PIO_MODES] & 0xFF)) - 1 ; + /* If word 64 isn't valid then Word 51 high byte holds the PIO timing + number for the maximum. Turn it into a mask and return it */ + modes = (2 << ((adev->id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF)) - 1 ; return modes; + /* But wait.. there's more. Design your standards by committee and + you too can get a free iordy field to process. However its the + speeds not the modes that are supported... Note drivers using the + timing API will get this right anyway */ } struct ata_exec_internal_arg {