All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] (2.6.20) pata_mpiix: fix PIO setup issues
@ 2007-02-05 17:24 Sergei Shtylyov
  2007-02-05 19:00 ` Alan
  2007-02-07  0:53 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2007-02-05 17:24 UTC (permalink / raw)
  To: jgarzik; +Cc: linux-ide, alan

Fix clearing/setting the wrong TIME/IE/PPE bits for a slave drive caused by a
wrong shift count.
Fix the PIO mode 1 being overclocked by wrongly selecting the fast timing bank.
Also, fix/rephrase some comments while at it.

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

---
 drivers/ata/pata_mpiix.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

Index: linux-2.6/drivers/ata/pata_mpiix.c
===================================================================
--- linux-2.6.orig/drivers/ata/pata_mpiix.c
+++ linux-2.6/drivers/ata/pata_mpiix.c
@@ -35,7 +35,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME "pata_mpiix"
-#define DRV_VERSION "0.7.3"
+#define DRV_VERSION "0.7.4"
 
 enum {
 	IDETIM = 0x6C,		/* IDE control register */
@@ -80,8 +80,8 @@ static void mpiix_error_handler(struct a
  *	@adev: ATA device
  *
  *	Called to do the PIO mode setup. The MPIIX allows us to program the
- *	IORDY sample point (2-5 clocks), recovery 1-4 clocks and whether
- *	prefetching or iordy are used.
+ *	IORDY sample point (2-5 clocks), recovery (1-4 clocks) and whether
+ *	prefetching or IORDY are used.
  *
  *	This would get very ugly because we can only program timing for one
  *	device at a time, the other gets PIO0. Fortunately libata calls
@@ -103,18 +103,19 @@ static void mpiix_set_piomode(struct ata
 			    { 2, 3 }, };
 
 	pci_read_config_word(pdev, IDETIM, &idetim);
-	/* Mask the IORDY/TIME/PPE0 bank for this device */
+
+	/* Mask the IORDY/TIME/PPE for this device */
 	if (adev->class == ATA_DEV_ATA)
-		control |= PPE;		/* PPE enable for disk */
+		control |= PPE;		/* Enable prefetch/posting for disk */
 	if (ata_pio_need_iordy(adev))
-		control |= IORDY;	/* IORDY */
-	if (pio > 0)
+		control |= IORDY;
+	if (pio > 1)
 		control |= FTIM;	/* This drive is on the fast timing bank */
 
 	/* Mask out timing and clear both TIME bank selects */
 	idetim &= 0xCCEE;
-	idetim &= ~(0x07  << (2 * adev->devno));
-	idetim |= (control << (2 * adev->devno));
+	idetim &= ~(0x07  << (4 * adev->devno));
+	idetim |= control << (4 * adev->devno);
 
 	idetim |= (timings[pio][0] << 12) | (timings[pio][1] << 8);
 	pci_write_config_word(pdev, IDETIM, idetim);


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

* Re: [PATCH] (2.6.20) pata_mpiix: fix PIO setup issues
  2007-02-05 17:24 [PATCH] (2.6.20) pata_mpiix: fix PIO setup issues Sergei Shtylyov
@ 2007-02-05 19:00 ` Alan
  2007-02-07  0:53 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Alan @ 2007-02-05 19:00 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: jgarzik, linux-ide

On Mon, 5 Feb 2007 20:24:57 +0300
Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:

> Fix clearing/setting the wrong TIME/IE/PPE bits for a slave drive caused by a
> wrong shift count.
> Fix the PIO mode 1 being overclocked by wrongly selecting the fast timing bank.
> Also, fix/rephrase some comments while at it.
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

Thanks - I've not managed to find an MPIIX with two devices on it yet.

Acked-by: Alan Cox <alan@redhat.com>

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

* Re: [PATCH] (2.6.20) pata_mpiix: fix PIO setup issues
  2007-02-05 17:24 [PATCH] (2.6.20) pata_mpiix: fix PIO setup issues Sergei Shtylyov
  2007-02-05 19:00 ` Alan
@ 2007-02-07  0:53 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2007-02-07  0:53 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-ide, alan

Sergei Shtylyov wrote:
> Fix clearing/setting the wrong TIME/IE/PPE bits for a slave drive caused by a
> wrong shift count.
> Fix the PIO mode 1 being overclocked by wrongly selecting the fast timing bank.
> Also, fix/rephrase some comments while at it.
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
> ---
>  drivers/ata/pata_mpiix.c |   19 ++++++++++---------
>  1 files changed, 10 insertions(+), 9 deletions(-)

applied



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

end of thread, other threads:[~2007-02-07  0:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-05 17:24 [PATCH] (2.6.20) pata_mpiix: fix PIO setup issues Sergei Shtylyov
2007-02-05 19:00 ` Alan
2007-02-07  0:53 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.