linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide: don't set PIO mode on pre-EIDE drives
@ 2007-11-16 13:26 Sergei Shtylyov
  2007-11-16 16:42 ` Alan Cox
  2007-11-16 21:35 ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2007-11-16 13:26 UTC (permalink / raw)
  To: bzolnier; +Cc: linux-ide

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.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

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

 drivers/ide/ide-iops.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/ide/ide-iops.c
===================================================================
--- linux-2.6.orig/drivers/ide/ide-iops.c
+++ 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);


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ide: don't set PIO mode on pre-EIDE drives
  2007-11-16 13:26 [PATCH] ide: don't set PIO mode on pre-EIDE drives Sergei Shtylyov
@ 2007-11-16 16:42 ` Alan Cox
  2007-11-16 16:45   ` Sergei Shtylyov
  2007-11-16 21:35 ` Bartlomiej Zolnierkiewicz
  1 sibling, 1 reply; 7+ messages in thread
From: Alan Cox @ 2007-11-16 16:42 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: bzolnier, linux-ide

On Fri, 16 Nov 2007 16:26:25 +0300
Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:

> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ide: don't set PIO mode on pre-EIDE drives
  2007-11-16 16:42 ` Alan Cox
@ 2007-11-16 16:45   ` Sergei Shtylyov
  2007-11-16 16:56     ` Alan Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2007-11-16 16:45 UTC (permalink / raw)
  To: Alan Cox; +Cc: bzolnier, linux-ide

Alan Cox wrote:

>>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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ide: don't set PIO mode on pre-EIDE drives
  2007-11-16 16:45   ` Sergei Shtylyov
@ 2007-11-16 16:56     ` Alan Cox
  2007-11-16 17:19       ` Sergei Shtylyov
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Cox @ 2007-11-16 16:56 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: bzolnier, linux-ide

On Fri, 16 Nov 2007 19:45:54 +0300
Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:

> Alan Cox wrote:
> 
> >>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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ide: don't set PIO mode on pre-EIDE drives
  2007-11-16 16:56     ` Alan Cox
@ 2007-11-16 17:19       ` Sergei Shtylyov
  2007-11-16 18:14         ` Alan Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2007-11-16 17:19 UTC (permalink / raw)
  To: Alan Cox; +Cc: bzolnier, linux-ide

Alan Cox wrote:

>>>>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. :-)

> 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.

> 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.

> 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? :-)

> 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.

> Alan

MBR, Sergei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ide: don't set PIO mode on pre-EIDE drives
  2007-11-16 17:19       ` Sergei Shtylyov
@ 2007-11-16 18:14         ` Alan Cox
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Cox @ 2007-11-16 18:14 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: bzolnier, linux-ide

>     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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ide: don't set PIO mode on pre-EIDE drives
  2007-11-16 13:26 [PATCH] ide: don't set PIO mode on pre-EIDE drives Sergei Shtylyov
  2007-11-16 16:42 ` Alan Cox
@ 2007-11-16 21:35 ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 7+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-11-16 21:35 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-ide

On Friday 16 November 2007, Sergei Shtylyov wrote:
> 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.
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

applied

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-16 21:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-16 13:26 [PATCH] ide: don't set PIO mode on pre-EIDE drives Sergei Shtylyov
2007-11-16 16:42 ` Alan Cox
2007-11-16 16:45   ` Sergei Shtylyov
2007-11-16 16:56     ` Alan Cox
2007-11-16 17:19       ` Sergei Shtylyov
2007-11-16 18:14         ` Alan Cox
2007-11-16 21:35 ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).