mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* RE: [PATCH] 2.4.23-pre4 add support for udma6 to nForce IDE drive r
@ 2003-09-19 23:49 Allen Martin
  2003-09-20  2:26 ` Merlin Hughes
  2003-09-20  8:33 ` Andrew de Quincey
  0 siblings, 2 replies; 6+ messages in thread
From: Allen Martin @ 2003-09-19 23:49 UTC (permalink / raw)
  To: 'Merlin Hughes'; +Cc: linux-kernel

> Interesting; lots of ACPI edge-triggered interrupts:
> 
>   dagda:~# cat /proc/interrupts 
>              CPU0       
>     0:     519365    IO-APIC-edge  timer
>     1:      16713    IO-APIC-edge  keyboard
>     2:          0          XT-PIC  cascade
>     8:          4    IO-APIC-edge  rtc
>     9:          0   IO-APIC-level  acpi
>    14:     863415    IO-APIC-edge  ide0
>    15:     201651    IO-APIC-edge  ide1
>    19:     306188   IO-APIC-level  nvidia
>    20:      57261   IO-APIC-level  usb-ohci, eth0
>    21:          0   IO-APIC-level  ehci_hcd, NVidia nForce2
>    22:          3   IO-APIC-level  usb-ohci, ohci1394
>   NMI:          0 
>   LOC:     519312 
>   ERR:          0
>   MIS:          0

Your interrupts look fine, this is the way they should be.


> ... but no stability problems since the primary drive has been
> running at UDMA133. Earlier UDMA100 freezes were completely
> repeatable; identical kernel, just without your two patches.

You can try downgrading your drive to udma5 to see if udma6 really does make
it more stable (hdparm -X udma5 /dev/hdX) but I can't think of any reason
why it should.

> I take it that I should boot with noapic in future to be safe.

I've been telling people to disable APIC / ACPI because of the interrupt
problem, but your interrupts are fine, so I'd leave it alone.  I'm curious,
what version BIOS do you have?

-Allen

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

* Re: [PATCH] 2.4.23-pre4 add support for udma6 to nForce IDE drive r
  2003-09-19 23:49 [PATCH] 2.4.23-pre4 add support for udma6 to nForce IDE drive r Allen Martin
@ 2003-09-20  2:26 ` Merlin Hughes
  2003-09-20  8:33 ` Andrew de Quincey
  1 sibling, 0 replies; 6+ messages in thread
From: Merlin Hughes @ 2003-09-20  2:26 UTC (permalink / raw)
  To: Allen Martin; +Cc: linux-kernel

r/AMartin@nvidia.com/2003.09.19/16:49:45
>You can try downgrading your drive to udma5 to see if udma6 really does make
>it more stable (hdparm -X udma5 /dev/hdX) but I can't think of any reason
>why it should.

That's it; downgrading to UDMA100 crashes within a few minutes
of heavy I/O. Running at UDMA133 is rock solid.

>> I take it that I should boot with noapic in future to be safe.
>
>I've been telling people to disable APIC / ACPI because of the interrupt
>problem, but your interrupts are fine, so I'd leave it alone.  I'm curious,
>what version BIOS do you have?

Very good, thanks. Shuttle SN45G, FN45 mobo, AwardBIOS v6.00PG.
Is that the info you're looking for?

Thanks, Merlin

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

* Re: [PATCH] 2.4.23-pre4 add support for udma6 to nForce IDE drive  r
  2003-09-19 23:49 [PATCH] 2.4.23-pre4 add support for udma6 to nForce IDE drive r Allen Martin
  2003-09-20  2:26 ` Merlin Hughes
@ 2003-09-20  8:33 ` Andrew de Quincey
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew de Quincey @ 2003-09-20  8:33 UTC (permalink / raw)
  To: Allen Martin, 'Merlin Hughes'; +Cc: linux-kernel

On Saturday 20 September 2003 00:49, Allen Martin wrote:
> > Interesting; lots of ACPI edge-triggered interrupts:
> >
> >   dagda:~# cat /proc/interrupts
> >              CPU0
> >     0:     519365    IO-APIC-edge  timer
> >     1:      16713    IO-APIC-edge  keyboard
> >     2:          0          XT-PIC  cascade
> >     8:          4    IO-APIC-edge  rtc
> >     9:          0   IO-APIC-level  acpi
> >    14:     863415    IO-APIC-edge  ide0
> >    15:     201651    IO-APIC-edge  ide1
> >    19:     306188   IO-APIC-level  nvidia
> >    20:      57261   IO-APIC-level  usb-ohci, eth0
> >    21:          0   IO-APIC-level  ehci_hcd, NVidia nForce2
> >    22:          3   IO-APIC-level  usb-ohci, ohci1394
> >   NMI:          0
> >   LOC:     519312
> >   ERR:          0
> >   MIS:          0
>
> Your interrupts look fine, this is the way they should be.
>
> > ... but no stability problems since the primary drive has been
> > running at UDMA133. Earlier UDMA100 freezes were completely
> > repeatable; identical kernel, just without your two patches.
>
> You can try downgrading your drive to udma5 to see if udma6 really does
> make it more stable (hdparm -X udma5 /dev/hdX) but I can't think of any
> reason why it should.
>
> > I take it that I should boot with noapic in future to be safe.
>
> I've been telling people to disable APIC / ACPI because of the interrupt
> problem, but your interrupts are fine, so I'd leave it alone.  I'm curious,
> what version BIOS do you have?

ACPI/APIC should work on most nforce/nforce2 boards in 2.4.22 upwards. If not, 
let me know, and I'll look into it.


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

* Re: [PATCH] 2.4.23-pre4 add support for udma6 to nForce IDE drive r
  2003-09-19 23:08 Allen Martin
@ 2003-09-19 23:34 ` Merlin Hughes
  0 siblings, 0 replies; 6+ messages in thread
From: Merlin Hughes @ 2003-09-19 23:34 UTC (permalink / raw)
  To: Allen Martin; +Cc: linux-kernel

r/AMartin@nvidia.com/2003.09.19/16:08:55
>> Since applying your patch, however, I've managed to run such
>> a dd, with zcav thrown in, with complete relability at UDMA133
>> for several hours without problems.
>
>While I'm certainly happy to hear that, I don't think I can take credit.
>Nothing in the patch should help with system stability issues.
>
>Do you have ACPI turned on?  Look at /proc/interrupts and see if any PCI
>interrupts are set to edge triggered mode.  That's the #1 cause of stability
>problems on nForce systems.

Interesting; lots of ACPI edge-triggered interrupts:

  dagda:~# cat /proc/interrupts 
             CPU0       
    0:     519365    IO-APIC-edge  timer
    1:      16713    IO-APIC-edge  keyboard
    2:          0          XT-PIC  cascade
    8:          4    IO-APIC-edge  rtc
    9:          0   IO-APIC-level  acpi
   14:     863415    IO-APIC-edge  ide0
   15:     201651    IO-APIC-edge  ide1
   19:     306188   IO-APIC-level  nvidia
   20:      57261   IO-APIC-level  usb-ohci, eth0
   21:          0   IO-APIC-level  ehci_hcd, NVidia nForce2
   22:          3   IO-APIC-level  usb-ohci, ohci1394
  NMI:          0 
  LOC:     519312 
  ERR:          0
  MIS:          0

... but no stability problems since the primary drive has been
running at UDMA133. Earlier UDMA100 freezes were completely
repeatable; identical kernel, just without your two patches.

This is a fairly fresh reboot; earlier I had the machine writing
DVDs, hitting firewire (iPod) and USB 2.0 (memory stick pro) drives,
and so forth, without issue.

  AMD_IDE: nVidia Corporation nForce2 IDE (rev a2) UDMA133 controller on pci00:09.0
      ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
      ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:DMA
  hda: Maxtor 6Y160P0, ATA DISK drive
  blk: queue c02b75e0, I/O limit 4095Mb (mask 0xffffffff)
  hdc: PIONEER DVD-RW DVR-106D, ATAPI CD/DVD-ROM drive
  ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
  ide1 at 0x170-0x177,0x376 on irq 15
  hda: attached ide-disk driver.
  hda: host protected area => 1
  hda: 320173056 sectors (163929 MB) w/7936KiB Cache, CHS=19929/255/63, UDMA(133)

I take it that I should boot with noapic in future to be safe.

Thanks, Merlin

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

* RE: [PATCH] 2.4.23-pre4 add support for udma6 to nForce IDE drive r
@ 2003-09-19 23:08 Allen Martin
  2003-09-19 23:34 ` Merlin Hughes
  0 siblings, 1 reply; 6+ messages in thread
From: Allen Martin @ 2003-09-19 23:08 UTC (permalink / raw)
  To: 'Merlin Hughes'; +Cc: linux-kernel

> Since applying your patch, however, I've managed to run such
> a dd, with zcav thrown in, with complete relability at UDMA133
> for several hours without problems.

While I'm certainly happy to hear that, I don't think I can take credit.
Nothing in the patch should help with system stability issues.

Do you have ACPI turned on?  Look at /proc/interrupts and see if any PCI
interrupts are set to edge triggered mode.  That's the #1 cause of stability
problems on nForce systems.

-Allen

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

* RE: [PATCH] 2.4.23-pre4 add support for udma6 to nForce IDE drive r
@ 2003-09-18  4:09 Allen Martin
  0 siblings, 0 replies; 6+ messages in thread
From: Allen Martin @ 2003-09-18  4:09 UTC (permalink / raw)
  To: Allen Martin, Andre Hedrick (andre@linux-ide.org)
  Cc: LKML (linux-kernel@vger.kernel.org)

[-- Attachment #1: Type: text/plain, Size: 6227 bytes --]

Sorry, my mailer added newlines, resending as attachment.

-Allen

> -----Original Message-----
> From: Allen Martin 
> Sent: Wednesday, September 17, 2003 9:00 PM
> To: Andre Hedrick (andre@linux-ide.org)
> Cc: LKML (linux-kernel@vger.kernel.org)
> Subject: [PATCH] 2.4.23-pre4 add support for udma6 to nForce 
> IDE driver
> 
> 
> This adds support for udma6 (Ultra 133) to the combined AMD / 
> NVIDIA IDE
> driver.  It depends on linux-2.4.23-pre4-nvide.patch.
> 
> It looks like UDMA modes > udma2 were shoehorned into this 
> driver, so the
> code to set the UDMA timing registers is pretty ugly.  In particular,
> computing UDMA cycle times from UDMA mode and then mapping that into a
> register value is akward and cause for much of the complexity in
> amd_set_speed().  At least on all the nForce controllers, 
> this register is
> always programmed the same, regardless if the PCI bus is 
> 33MHz or 66MHz, so
> the UDMA cycle times can be ignored.
> 
> 
> 
> diff -ru -X dontdiff linux-2.4.23-pre4-nvide/drivers/ide/pci/amd74xx.c
> linux-2.4.23-pre4-nvata133/drivers/ide/pci/amd74xx.c
> --- linux-2.4.23-pre4-nvide/drivers/ide/pci/amd74xx.c	2003-09-17
> 19:58:46.000000000 -0700
> +++ linux-2.4.23-pre4-nvata133/drivers/ide/pci/amd74xx.c	
> 2003-09-17
> 20:11:20.000000000 -0700
> @@ -40,6 +40,7 @@
>  #define AMD_UDMA_33		0x01
>  #define AMD_UDMA_66		0x02
>  #define AMD_UDMA_100		0x03
> +#define AMD_UDMA_133		0x04
>  #define AMD_CHECK_SWDMA		0x08
>  #define AMD_BAD_SWDMA		0x10
>  #define AMD_BAD_FIFO		0x20
> @@ -60,13 +61,13 @@
>  	{ PCI_DEVICE_ID_AMD_OPUS_7441, 0x00, 0x40, AMD_UDMA_100 },
> /* AMD-768 Opus */
>  	{ PCI_DEVICE_ID_AMD_8111_IDE,  0x00, 0x40, AMD_UDMA_100 },
> /* AMD-8111 */
>          { PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, 0x00, 0x50, 
> AMD_UDMA_100 },
> /* nVidia nForce */
> -        { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, 
> AMD_UDMA_100 },
> /* nVidia nForce2 */
> -        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, 0x00, 0x50, 
> AMD_UDMA_100 },
> /* nVidia nForce2s */
> -        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, 0x00, 0x50, 
> AMD_UDMA_100 },
> /* nVidia nForce2s SATA */
> -        { PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, 0x00, 0x50, 
> AMD_UDMA_100 },
> /* NVIDIA nForce3 */
> -        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, 0x00, 0x50, 
> AMD_UDMA_100 },
> /* NVIDIA nForce3s */
> -        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 0x00, 0x50, 
> AMD_UDMA_100 },
> /* NVIDIA nForce3s SATA */
> -        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x00, 0x50, 
> AMD_UDMA_100 },
> /* NVIDIA nForce3s SATA2 */
> +        { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, 
> AMD_UDMA_133 },
> /* nVidia nForce2 */
> +        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, 0x00, 0x50, 
> AMD_UDMA_133 },
> /* nVidia nForce2s */
> +        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, 0x00, 0x50, 
> AMD_UDMA_133 },
> /* nVidia nForce2s SATA */
> +        { PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, 0x00, 0x50, 
> AMD_UDMA_133 },
> /* NVIDIA nForce3 */
> +        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, 0x00, 0x50, 
> AMD_UDMA_133 },
> /* NVIDIA nForce3s */
> +        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 0x00, 0x50, 
> AMD_UDMA_133 },
> /* NVIDIA nForce3s SATA */
> +        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x00, 0x50, 
> AMD_UDMA_133 },
> /* NVIDIA nForce3s SATA2 */
>  
>  	{ 0 }
>  };
> @@ -76,9 +77,9 @@
>  static unsigned int amd_80w;
>  static unsigned int amd_clock;
>  
> -static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 
> 2, 2, 3, 3 };
> -static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 1 };
> -static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", 
> "UDMA100" };
> +static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 
> 2, 2, 3, 3, 7
> };
> +static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 0 };
> +static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100",
> "UDMA133" };
>  
>  /*
>   * AMD /proc entry.
> @@ -160,6 +161,11 @@
>  			cycle[i] = 666666 / amd_clock;
>  			continue;
>  		}
> +		if (den[i] && uen[i] && udma[i] == 0) {
> +			speed[i] = amd_clock * 4;
> +			cycle[i] = 500000 / amd_clock;
> +			continue;
> +		}
>  
>  		speed[i] = 4 * amd_clock / ((den[i] && uen[i]) 
> ? udma[i] :
> (active[i] + recover[i]) * 2);
>  		cycle[i] = 1000000 * ((den[i] && uen[i]) ? udma[i] :
> (active[i] + recover[i]) * 2) / amd_clock / 2;
> @@ -206,6 +212,7 @@
>  		case AMD_UDMA_33:  t = timing->udma ? (0xc0 |
> (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
>  		case AMD_UDMA_66:  t = timing->udma ? (0xc0 |
> amd_cyc2udma[FIT(timing->udma, 2, 10)]) : 0x03; break;
>  		case AMD_UDMA_100: t = timing->udma ? (0xc0 |
> amd_cyc2udma[FIT(timing->udma, 1, 10)]) : 0x03; break;
> +		case AMD_UDMA_133: t = timing->udma ? (0xc0 |
> amd_cyc2udma[FIT(timing->udma, 1, 11)]) : 0x03; break;
>  		default: return;
>  	}
>  
> @@ -239,7 +246,12 @@
>  		ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
>  	}
>  
> +	/*
> +	 * AMD / nForce UDMA timing register should really be 
> programmed 
> +	 * based on UDMA mode not UDMA cycle time...
> +	 */
>  	if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1;
> +	if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 11;
>  
>  	amd_set_speed(HWIF(drive)->pci_dev, drive->dn, &t);
>  
> @@ -282,7 +294,8 @@
>  		XFER_PIO | XFER_EPIO | XFER_MWDMA | XFER_UDMA |
>  		((amd_config->flags & AMD_BAD_SWDMA) ? 0 : XFER_SWDMA) |
>  		(w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_66 ?
> XFER_UDMA_66 : 0) |
> -		(w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_100 ?
> XFER_UDMA_100 : 0));
> +		(w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_100 ?
> XFER_UDMA_100 : 0) |
> +		(w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_133 ?
> XFER_UDMA_133 : 0));
>  
>  	amd_set_drive(drive, speed);
>  
> @@ -318,6 +331,7 @@
>  
>  	switch (amd_config->flags & AMD_UDMA) {
>  
> +		case AMD_UDMA_133:
>  		case AMD_UDMA_100:
>  			pci_read_config_byte(dev, AMD_CABLE_DETECT, &t);
>  			pci_read_config_dword(dev, AMD_UDMA_TIMING, &u);
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


[-- Attachment #2: linux-2.4.23-pre4-nvata133.patch --]
[-- Type: application/octet-stream, Size: 5002 bytes --]

diff -ru -X dontdiff linux-2.4.23-pre4-nvide/drivers/ide/pci/amd74xx.c linux-2.4.23-pre4-nvata133/drivers/ide/pci/amd74xx.c
--- linux-2.4.23-pre4-nvide/drivers/ide/pci/amd74xx.c	2003-09-17 19:58:46.000000000 -0700
+++ linux-2.4.23-pre4-nvata133/drivers/ide/pci/amd74xx.c	2003-09-17 20:11:20.000000000 -0700
@@ -40,6 +40,7 @@
 #define AMD_UDMA_33		0x01
 #define AMD_UDMA_66		0x02
 #define AMD_UDMA_100		0x03
+#define AMD_UDMA_133		0x04
 #define AMD_CHECK_SWDMA		0x08
 #define AMD_BAD_SWDMA		0x10
 #define AMD_BAD_FIFO		0x20
@@ -60,13 +61,13 @@
 	{ PCI_DEVICE_ID_AMD_OPUS_7441, 0x00, 0x40, AMD_UDMA_100 },			/* AMD-768 Opus */
 	{ PCI_DEVICE_ID_AMD_8111_IDE,  0x00, 0x40, AMD_UDMA_100 },			/* AMD-8111 */
         { PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, 0x00, 0x50, AMD_UDMA_100 },                  /* nVidia nForce */
-        { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, AMD_UDMA_100 },                 /* nVidia nForce2 */
-        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, 0x00, 0x50, AMD_UDMA_100 },                /* nVidia nForce2s */
-        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, 0x00, 0x50, AMD_UDMA_100 },               /* nVidia nForce2s SATA */
-        { PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, 0x00, 0x50, AMD_UDMA_100 },                 /* NVIDIA nForce3 */
-        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, 0x00, 0x50, AMD_UDMA_100 },                /* NVIDIA nForce3s */
-        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 0x00, 0x50, AMD_UDMA_100 },               /* NVIDIA nForce3s SATA */
-        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x00, 0x50, AMD_UDMA_100 },              /* NVIDIA nForce3s SATA2 */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, AMD_UDMA_133 },                 /* nVidia nForce2 */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, 0x00, 0x50, AMD_UDMA_133 },                /* nVidia nForce2s */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, 0x00, 0x50, AMD_UDMA_133 },               /* nVidia nForce2s SATA */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, 0x00, 0x50, AMD_UDMA_133 },                 /* NVIDIA nForce3 */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, 0x00, 0x50, AMD_UDMA_133 },                /* NVIDIA nForce3s */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 0x00, 0x50, AMD_UDMA_133 },               /* NVIDIA nForce3s SATA */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x00, 0x50, AMD_UDMA_133 },              /* NVIDIA nForce3s SATA2 */
 
 	{ 0 }
 };
@@ -76,9 +77,9 @@
 static unsigned int amd_80w;
 static unsigned int amd_clock;
 
-static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3 };
-static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 1 };
-static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100" };
+static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 7 };
+static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 0 };
+static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" };
 
 /*
  * AMD /proc entry.
@@ -160,6 +161,11 @@
 			cycle[i] = 666666 / amd_clock;
 			continue;
 		}
+		if (den[i] && uen[i] && udma[i] == 0) {
+			speed[i] = amd_clock * 4;
+			cycle[i] = 500000 / amd_clock;
+			continue;
+		}
 
 		speed[i] = 4 * amd_clock / ((den[i] && uen[i]) ? udma[i] : (active[i] + recover[i]) * 2);
 		cycle[i] = 1000000 * ((den[i] && uen[i]) ? udma[i] : (active[i] + recover[i]) * 2) / amd_clock / 2;
@@ -206,6 +212,7 @@
 		case AMD_UDMA_33:  t = timing->udma ? (0xc0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
 		case AMD_UDMA_66:  t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 2, 10)]) : 0x03; break;
 		case AMD_UDMA_100: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 10)]) : 0x03; break;
+		case AMD_UDMA_133: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 11)]) : 0x03; break;
 		default: return;
 	}
 
@@ -239,7 +246,12 @@
 		ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
 	}
 
+	/*
+	 * AMD / nForce UDMA timing register should really be programmed 
+	 * based on UDMA mode not UDMA cycle time...
+	 */
 	if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1;
+	if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 11;
 
 	amd_set_speed(HWIF(drive)->pci_dev, drive->dn, &t);
 
@@ -282,7 +294,8 @@
 		XFER_PIO | XFER_EPIO | XFER_MWDMA | XFER_UDMA |
 		((amd_config->flags & AMD_BAD_SWDMA) ? 0 : XFER_SWDMA) |
 		(w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_66 ? XFER_UDMA_66 : 0) |
-		(w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_100 ? XFER_UDMA_100 : 0));
+		(w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_100 ? XFER_UDMA_100 : 0) |
+		(w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_133 ? XFER_UDMA_133 : 0));
 
 	amd_set_drive(drive, speed);
 
@@ -318,6 +331,7 @@
 
 	switch (amd_config->flags & AMD_UDMA) {
 
+		case AMD_UDMA_133:
 		case AMD_UDMA_100:
 			pci_read_config_byte(dev, AMD_CABLE_DETECT, &t);
 			pci_read_config_dword(dev, AMD_UDMA_TIMING, &u);

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

end of thread, other threads:[~2003-09-20  8:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-19 23:49 [PATCH] 2.4.23-pre4 add support for udma6 to nForce IDE drive r Allen Martin
2003-09-20  2:26 ` Merlin Hughes
2003-09-20  8:33 ` Andrew de Quincey
  -- strict thread matches above, loose matches on Subject: below --
2003-09-19 23:08 Allen Martin
2003-09-19 23:34 ` Merlin Hughes
2003-09-18  4:09 Allen Martin

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

all inboxes | Powered by JetHome®