Skip to contentSkip to conversation

ide: don't set PIO mode on pre-EIDE drives

PATCH Applied Sergei Shtylyov 3 participants 7 messages Nov 16, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ide: don't set PIO mode on pre-EIDE drives

Fix handling of the PIO modes for the pre-EIDE drives that did not support the PIO Flow Control Transfer Mode value (00001 nnn) of the Set Transfer Mode feature by skipping the actual mode programming.

---
The patch is against the Linus' tree...

 drivers/ide/ide-iops.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)
drivers/ide/ide-iops.c +6 -1
Index: linux-2.6/drivers/ide/ide-iops.c
===================================================================
@@ -756,7 +756,7 @@ int ide_driveid_update(ide_drive_t *driv
 int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
 {
 	ide_hwif_t *hwif = drive->hwif;
-	int error;
+	int error = 0;
 	u8 stat;
 
 //	while (HWGROUP(drive)->busy)
@@ -767,6 +767,10 @@ int ide_config_drive_speed(ide_drive_t *
 		hwif->dma_host_off(drive);
 #endif
 
+	/* Skip setting PIO flow-control modes on pre-EIDE drives */
+	if ((speed & 0xf8) == XFER_PIO_0 && !(drive->id->capability & 0x08))
+		goto skip;
+
 	/*
 	 * Don't use ide_wait_cmd here - it will
 	 * attempt to set_geometry and recalibrate,
@@ -814,6 +818,7 @@ int ide_config_drive_speed(ide_drive_t *
 	drive->id->dma_mword &= ~0x0F00;
 	drive->id->dma_1word &= ~0x0F00;
 
+ skip:
 #ifdef CONFIG_BLK_DEV_IDEDMA
 	if (speed >= XFER_SW_DMA_0)
 		hwif->dma_host_on(drive);
#1 lore raw
Quoted 3 lines · On Fri, 16 Nov 2007 16:26:25 +0300 Sergei Shtylyov <[email protected]>…

Fix handling of the PIO modes for the pre-EIDE drives that did not support the PIO Flow Control Transfer Mode value (00001 nnn) of the Set Transfer Mode feature by skipping the actual mode programming.

You also need to cater for CF 1.1 compliant devices which do not have set xfer mode.

#2 lore raw
Quoted 6 lines · Alan Cox
Quoted 3 lines

Fix handling of the PIO modes for the pre-EIDE drives that did not support the PIO Flow Control Transfer Mode value (00001 nnn) of the Set Transfer Mode feature by skipping the actual mode programming.

You also need to cater for CF 1.1 compliant devices which do not have set xfer mode.

Do they have IORDY support?

WBR, Sergei

#3 lore raw
Quoted 10 lines · On Fri, 16 Nov 2007 19:45:54 +0300 Sergei Shtylyov <[email protected]>…
Quoted 6 lines · Alan Cox
Quoted 3 lines

Fix handling of the PIO modes for the pre-EIDE drives that did not support the PIO Flow Control Transfer Mode value (00001 nnn) of the Set Transfer Mode feature by skipping the actual mode programming.

You also need to cater for CF 1.1 compliant devices which do not have set xfer mode.

Do they have IORDY support?

Good question.

CF 1.4 says set features supports 01/0A/55/66/81/8A/9A/BB/CC (with 69/96/97 NOP or not recommended)

However it documents both the PIO mode and DMA word in identify. I've never seen a CF 1.x card which does DMA or PIO > 2.

CF 1.x is sort of ATA-2 ish but without some set features (eg its got idle immediate) and with some stuff that became general later (security features)

Alan

#4 lore raw
Quoted 10 lines · Alan Cox
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Fix handling of the PIO modes for the pre-EIDE drives that did not support the PIO Flow Control Transfer Mode value (00001 nnn) of the Set Transfer Mode feature by skipping the actual mode programming.

You also need to cater for CF 1.1 compliant devices which do not have set xfer mode.

Do they have IORDY support?

Good question.

I thought you know. :-)

Quoted 2 lines

CF 1.4 says set features supports 01/0A/55/66/81/8A/9A/BB/CC (with 69/96/97 NOP or not recommended)

Well, the same spec says IORDY may be supported and bit 11 of word 49 may
be set. Obviously, no PIO3/4 though.

Quoted 1 line

However it documents both the PIO mode and DMA word in identify. I've

So what? That's PIO2 at max, and *default* mode at that, not changeable.

Quoted 1 line

never seen a CF 1.x card which does DMA or PIO > 2.

That's something at least. I hope they also don't set bit 11 --
otherwise, bad luck. Or am I supposed to also check the CF signature? :-)

Quoted 3 lines

CF 1.x is sort of ATA-2 ish but without some set features (eg its got idle immediate) and with some stuff that became general later (security features)

Well, at least CF 2.1 documents every imaginable feature value, it seems,
including Set Transfer Mode of all flavors.

Quoted 1 line

Alan

MBR, Sergei

#5 lore raw
Quoted 2 lines

That's something at least. I hope they also don't set bit 11 --
otherwise, bad luck. Or am I supposed to also check the CF signature? :-)

Libata issues the command but ignores an ABRT if the device is CFA or has no iordy flag and PIO <= 2 or MWDMA0 is used and the device thinks its in MWDMA0 anyway

drivers/ide at least just used to aim, fire and ignore the result.

Alan