public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.19 1/3] sata_promise: PHYMODE4 fixup
@ 2006-12-01  9:55 Mikael Pettersson
  2006-12-03 13:05 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2006-12-01  9:55 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, linux-kernel

This patch adds code to fix up the PHYMODE4 "align timing"
register value on second-generation Promise SATA chips.
Failure to correct this value on non-x86 machines makes
drive detection prone to failure due to timeouts. (I've
observed about 50% detection failure rates on SPARC64.)

The HW boots with a bad value in this register, but on x86
machines the Promise BIOS corrects it to the value recommended
by the manual, so most people have been unaffected by this issue.

After developing the patch I checked Promise's SATAII driver,
and discovered that it also corrects PHYMODE4 just like this
patch does.

This patch depends on the sata_promise SATAII updates
patch I sent recently.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>

diff -rupN linux-2.6.19.sata_promise-1-genII-fixes/drivers/ata/sata_promise.c linux-2.6.19.sata_promise-2-PHYMODE4-fixup/drivers/ata/sata_promise.c
--- linux-2.6.19.sata_promise-1-genII-fixes/drivers/ata/sata_promise.c	2006-11-30 23:25:03.000000000 +0100
+++ linux-2.6.19.sata_promise-2-PHYMODE4-fixup/drivers/ata/sata_promise.c	2006-11-30 23:36:57.000000000 +0100
@@ -281,6 +281,7 @@ static struct pci_driver pdc_ata_pci_dri
 static int pdc_port_start(struct ata_port *ap)
 {
 	struct device *dev = ap->host->dev;
+	struct pdc_host_priv *hp = ap->host->private_data;
 	struct pdc_port_priv *pp;
 	int rc;
 
@@ -302,6 +303,16 @@ static int pdc_port_start(struct ata_por
 
 	ap->private_data = pp;
 
+	/* fix up PHYMODE4 align timing */
+	if ((hp->flags & PDC_FLAG_GEN_II) && sata_scr_valid(ap)) {
+		void __iomem *mmio = (void __iomem *) ap->ioaddr.scr_addr;
+		unsigned int tmp;
+
+		tmp = readl(mmio + 0x014);
+		tmp = (tmp & ~3) | 1;	/* set bits 1:0 = 0:1 */
+		writel(tmp, mmio + 0x014);
+	}
+
 	return 0;
 
 err_out_kfree:

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

* Re: [PATCH 2.6.19 1/3] sata_promise: PHYMODE4 fixup
  2006-12-01  9:55 [PATCH 2.6.19 1/3] sata_promise: PHYMODE4 fixup Mikael Pettersson
@ 2006-12-03 13:05 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-12-03 13:05 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: linux-ide, linux-kernel

Mikael Pettersson wrote:
> This patch adds code to fix up the PHYMODE4 "align timing"
> register value on second-generation Promise SATA chips.
> Failure to correct this value on non-x86 machines makes
> drive detection prone to failure due to timeouts. (I've
> observed about 50% detection failure rates on SPARC64.)
> 
> The HW boots with a bad value in this register, but on x86
> machines the Promise BIOS corrects it to the value recommended
> by the manual, so most people have been unaffected by this issue.
> 
> After developing the patch I checked Promise's SATAII driver,
> and discovered that it also corrects PHYMODE4 just like this
> patch does.
> 
> This patch depends on the sata_promise SATAII updates
> patch I sent recently.
> 
> Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>

applied


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

end of thread, other threads:[~2006-12-03 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-01  9:55 [PATCH 2.6.19 1/3] sata_promise: PHYMODE4 fixup Mikael Pettersson
2006-12-03 13:05 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox