public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFT][PATCH] fix ServerWorks PIO auto-tuning
@ 2003-10-16 21:44 Bartlomiej Zolnierkiewicz
  2003-10-17  7:37 ` Tomas Szepe
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-10-16 21:44 UTC (permalink / raw)
  To: Torben Mathiasen, Tomas Szepe; +Cc: linux-kernel


Hi,

I wonder if this patch fixes problems (reported back in 2.4.21 days)
with CSB5 IDE and Compaq Proliant machines.  Please test it if you can.

thanks,
--bartlomiej

[IDE] fix ServerWorks PIO auto-tuning

If PIO mode should be auto-tuned xferspeed argument for svwks_tune_chipset()
is equal to 255 (0xFF).  It is then passed to ide_rate_filter() which matches
desired mode with chipset capabilities.  Since 255 is greater than any of the
values used for transfer modes, ide_rate_filter() will always return the
highest mode supported by both device/chipset (which sometimes should not be
used ie. when host is a simplex one) and the wrong mode will be set.

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

diff -puN drivers/ide/pci/serverworks.c~ide-serverworks-fix drivers/ide/pci/serverworks.c
--- linux-2.6.0-test7/drivers/ide/pci/serverworks.c~ide-serverworks-fix	2003-10-16 23:03:11.844836632 +0200
+++ linux-2.6.0-test7-root/drivers/ide/pci/serverworks.c	2003-10-16 23:36:01.068469136 +0200
@@ -272,7 +272,7 @@ static int svwks_tune_chipset (ide_drive
 
 	ide_hwif_t *hwif	= HWIF(drive);
 	struct pci_dev *dev	= hwif->pci_dev;
-	u8 speed		= ide_rate_filter(svwks_ratemask(drive), xferspeed);
+	u8 speed;
 	u8 pio			= ide_get_best_pio_mode(drive, 255, 5, NULL);
 	u8 unit			= (drive->select.b.unit & 0x01);
 	u8 csb5			= svwks_csb_check(dev);
@@ -280,6 +280,11 @@ static int svwks_tune_chipset (ide_drive
 	u8 dma_timing		= 0, pio_timing = 0;
 	u16 csb5_pio		= 0;
 
+	if (xferspeed == 255)	/* PIO auto-tuning */
+		speed = XFER_PIO_0 + pio;
+	else
+		speed = ide_rate_filter(svwks_ratemask(drive), xferspeed);
+
 	/* If we are about to put a disk into UDMA mode we screwed up.
 	   Our code assumes we never _ever_ do this on an OSB4 */
 	   

_


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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-16 21:44 [RFT][PATCH] fix ServerWorks PIO auto-tuning Bartlomiej Zolnierkiewicz
@ 2003-10-17  7:37 ` Tomas Szepe
  2003-10-17  9:30   ` Bartlomiej Zolnierkiewicz
  2003-10-17  9:51 ` Torben Mathiasen
  2003-10-18 13:02 ` Tomas Szepe
  2 siblings, 1 reply; 11+ messages in thread
From: Tomas Szepe @ 2003-10-17  7:37 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Torben Mathiasen, linux-kernel

On Oct-16 2003, Thu, 23:44 +0200
Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> wrote:

> I wonder if this patch fixes problems (reported back in 2.4.21 days)
> with CSB5 IDE and Compaq Proliant machines.  Please test it if you can.

Sure.  What kernel series is the patch against?

-- 
Tomas Szepe <szepe@pinerecords.com>

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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-17  7:37 ` Tomas Szepe
@ 2003-10-17  9:30   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 11+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-10-17  9:30 UTC (permalink / raw)
  To: Tomas Szepe; +Cc: Torben Mathiasen, linux-kernel

On Friday 17 of October 2003 09:37, Tomas Szepe wrote:
> On Oct-16 2003, Thu, 23:44 +0200
>
> Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> wrote:
> > I wonder if this patch fixes problems (reported back in 2.4.21 days)
> > with CSB5 IDE and Compaq Proliant machines.  Please test it if you can.
>
> Sure.  What kernel series is the patch against?

Patch is against 2.6.0-test7 but also applies to 2.4.22 / 2.4.23-pre.


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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-16 21:44 [RFT][PATCH] fix ServerWorks PIO auto-tuning Bartlomiej Zolnierkiewicz
  2003-10-17  7:37 ` Tomas Szepe
@ 2003-10-17  9:51 ` Torben Mathiasen
  2003-10-17 10:22   ` Bartlomiej Zolnierkiewicz
  2003-10-17 10:23   ` Tomas Szepe
  2003-10-18 13:02 ` Tomas Szepe
  2 siblings, 2 replies; 11+ messages in thread
From: Torben Mathiasen @ 2003-10-17  9:51 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Torben Mathiasen, Tomas Szepe, linux-kernel

On Thu, Oct 16 2003, Bartlomiej Zolnierkiewicz wrote:
> 
> Hi,
> 
> I wonder if this patch fixes problems (reported back in 2.4.21 days)
> with CSB5 IDE and Compaq Proliant machines.  Please test it if you can.
>
Hi Bart,

Funny you should send this as I was just looking at it. The good news is that
it works!. We're not seeing any failed commands during boot anymore. I tested
it on both 2.4.23-pre7 and 2.6.0-test7.

Also, the previous problem we had where Linux would enable DMA on a device
(system) not supporting it has also been fixed now that we look at the dma_stat
bits to determine whether the BIOS indicated DMA. We're currently making sure
that all of our servers does proper BIOS IDE setup to make things work as expected.

Thanks for the patch, please include it.

Torben

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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-17 10:22   ` Bartlomiej Zolnierkiewicz
@ 2003-10-17 10:20     ` Torben Mathiasen
  0 siblings, 0 replies; 11+ messages in thread
From: Torben Mathiasen @ 2003-10-17 10:20 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Torben Mathiasen, Tomas Szepe, linux-kernel

On Fri, Oct 17 2003, Bartlomiej Zolnierkiewicz wrote:
> > Also, the previous problem we had where Linux would enable DMA on a device
> > (system) not supporting it has also been fixed now that we look at the
> > dma_stat bits to determine whether the BIOS indicated DMA. We're currently
> 
> Can I assume that "biostimings" option is no longer needed for ServerWorks?
> 
> If so I will remove it because it is dangerous on many chipsets.
> Even if some chipset needs it in the future it should be reimplemented
> in specific chipset driver, not in generic IDE code.
>

Yes, even though I haven't tested on many systems, I believe this is the right
fix. Regarding the biostimings stuff, then I already sent fixes to Alan a long
time ago but I think they got lost. Please remove it and we can come up with
something else if ever needed.

Torben
-- 

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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-17  9:51 ` Torben Mathiasen
@ 2003-10-17 10:22   ` Bartlomiej Zolnierkiewicz
  2003-10-17 10:20     ` Torben Mathiasen
  2003-10-17 10:23   ` Tomas Szepe
  1 sibling, 1 reply; 11+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-10-17 10:22 UTC (permalink / raw)
  To: Torben Mathiasen; +Cc: Tomas Szepe, linux-kernel

On Friday 17 of October 2003 11:51, Torben Mathiasen wrote:
> On Thu, Oct 16 2003, Bartlomiej Zolnierkiewicz wrote:
> > Hi,
> >
> > I wonder if this patch fixes problems (reported back in 2.4.21 days)
> > with CSB5 IDE and Compaq Proliant machines.  Please test it if you can.
>
> Hi Bart,
>
> Funny you should send this as I was just looking at it. The good news is
> that it works!. We're not seeing any failed commands during boot anymore. I
> tested it on both 2.4.23-pre7 and 2.6.0-test7.

Great!

> Also, the previous problem we had where Linux would enable DMA on a device
> (system) not supporting it has also been fixed now that we look at the
> dma_stat bits to determine whether the BIOS indicated DMA. We're currently

Can I assume that "biostimings" option is no longer needed for ServerWorks?

If so I will remove it because it is dangerous on many chipsets.
Even if some chipset needs it in the future it should be reimplemented
in specific chipset driver, not in generic IDE code.

> making sure that all of our servers does proper BIOS IDE setup to make
> things work as expected.
>
> Thanks for the patch, please include it.

Sure.

thanks,
--bartlomiej


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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-17  9:51 ` Torben Mathiasen
  2003-10-17 10:22   ` Bartlomiej Zolnierkiewicz
@ 2003-10-17 10:23   ` Tomas Szepe
  1 sibling, 0 replies; 11+ messages in thread
From: Tomas Szepe @ 2003-10-17 10:23 UTC (permalink / raw)
  To: Torben Mathiasen; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

On Oct-17 2003, Fri, 11:51 +0200
Torben Mathiasen <torben.mathiasen@hp.com> wrote:

> Funny you should send this as I was just looking at it. The good news is that
> it works!. We're not seeing any failed commands during boot anymore. I tested
> it on both 2.4.23-pre7 and 2.6.0-test7.

OK, I too can confirm this fix appears to work as expected.

Thanks!

-- 
Tomas Szepe <szepe@pinerecords.com>

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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-16 21:44 [RFT][PATCH] fix ServerWorks PIO auto-tuning Bartlomiej Zolnierkiewicz
  2003-10-17  7:37 ` Tomas Szepe
  2003-10-17  9:51 ` Torben Mathiasen
@ 2003-10-18 13:02 ` Tomas Szepe
  2003-10-18 15:45   ` Bartlomiej Zolnierkiewicz
  2 siblings, 1 reply; 11+ messages in thread
From: Tomas Szepe @ 2003-10-18 13:02 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Torben Mathiasen, linux-kernel

On Oct-16 2003, Thu, 23:44 +0200
Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> wrote:

> I wonder if this patch fixes problems (reported back in 2.4.21 days)
> with CSB5 IDE and Compaq Proliant machines.  Please test it if you can.

Still, there's one prevailing problem:

Compaq Proliant ML350 G3
ServerWorks CSB5 IDE Controller (rev 93) (prog-if 8a [Master SecP PriP])
WDC WD1200JB-00CRA1 as hdb

No autodma on boot, even w/ 2.4.23-pre7 + the pio autotuning fix:

Linux version 2.4.23-pre7 (kala@ns) (gcc version 2.95.3 20010315 (release)) #1 SMP Sat Oct 18 14:40:16 CEST 2003
Kernel command line: root=/dev/md0 vga=normal
...
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
SvrWks CSB5: IDE controller at PCI slot 00:0f.1
SvrWks CSB5: chipset revision 147
SvrWks CSB5: not 100% native mode: will probe irqs later
SvrWks CSB5: simplex device: DMA forced
    ide0: BM-DMA at 0x2000-0x2007, BIOS settings: hda:pio, hdb:pio
SvrWks CSB5: simplex device: DMA forced
    ide1: BM-DMA at 0x2008-0x200f, BIOS settings: hdc:pio, hdd:pio
hda: HL-DT-ST CD-ROM GCR-8480B, ATAPI CD/DVD-ROM drive
hdb: WDC WD1200JB-00CRA1, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hdb: attached ide-disk driver.
hdb: host protected area => 1
hdb: 234441648 sectors (120034 MB) w/8192KiB Cache, CHS=232581/16/63
hda: attached ide-cdrom driver.
hda: ATAPI 48X CD-ROM drive, 128kB Cache
...

devel:~# hdparm -Iv /dev/hdb|grep -a dma
 using_dma    =  0 (off)
        DMA: mdma0 mdma1 *mdma2 udma0 udma1 udma2 udma3 udma4 udma5 

After issuing "/usr/sbin/hdparm -d1 -Xudma5 /dev/hdb" all's running nicely,
no errors whatsoever.

devel:/etc/rc.d# hdparm -Iv /dev/hdb|grep -a dma
 using_dma    =  1 (on)
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 

-- 
Tomas Szepe <szepe@pinerecords.com>

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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-18 13:02 ` Tomas Szepe
@ 2003-10-18 15:45   ` Bartlomiej Zolnierkiewicz
  2003-10-20  9:24     ` Torben Mathiasen
  0 siblings, 1 reply; 11+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-10-18 15:45 UTC (permalink / raw)
  To: Tomas Szepe; +Cc: Torben Mathiasen, linux-kernel


We depend on BIOS hints for ServerWorks and BIOS is not enabling DMA.
AFAIR we can't force DMA in this case because there are broken hardware
designs, so current behavior is safe.  However more research is needed...

thanks,
--bartlomiej

On Saturday 18 of October 2003 15:02, Tomas Szepe wrote:
> On Oct-16 2003, Thu, 23:44 +0200
>
> Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> wrote:
> > I wonder if this patch fixes problems (reported back in 2.4.21 days)
> > with CSB5 IDE and Compaq Proliant machines.  Please test it if you can.
>
> Still, there's one prevailing problem:
>
> Compaq Proliant ML350 G3
> ServerWorks CSB5 IDE Controller (rev 93) (prog-if 8a [Master SecP PriP])
> WDC WD1200JB-00CRA1 as hdb
>
> No autodma on boot, even w/ 2.4.23-pre7 + the pio autotuning fix:
>
> Linux version 2.4.23-pre7 (kala@ns) (gcc version 2.95.3 20010315 (release))
> #1 SMP Sat Oct 18 14:40:16 CEST 2003 Kernel command line: root=/dev/md0
> vga=normal
> ...
> Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
> ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
> SvrWks CSB5: IDE controller at PCI slot 00:0f.1
> SvrWks CSB5: chipset revision 147
> SvrWks CSB5: not 100% native mode: will probe irqs later
> SvrWks CSB5: simplex device: DMA forced
>     ide0: BM-DMA at 0x2000-0x2007, BIOS settings: hda:pio, hdb:pio
> SvrWks CSB5: simplex device: DMA forced
>     ide1: BM-DMA at 0x2008-0x200f, BIOS settings: hdc:pio, hdd:pio
> hda: HL-DT-ST CD-ROM GCR-8480B, ATAPI CD/DVD-ROM drive
> hdb: WDC WD1200JB-00CRA1, ATA DISK drive
> ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
> hdb: attached ide-disk driver.
> hdb: host protected area => 1
> hdb: 234441648 sectors (120034 MB) w/8192KiB Cache, CHS=232581/16/63
> hda: attached ide-cdrom driver.
> hda: ATAPI 48X CD-ROM drive, 128kB Cache
> ...
>
> devel:~# hdparm -Iv /dev/hdb|grep -a dma
>  using_dma    =  0 (off)
>         DMA: mdma0 mdma1 *mdma2 udma0 udma1 udma2 udma3 udma4 udma5
>
> After issuing "/usr/sbin/hdparm -d1 -Xudma5 /dev/hdb" all's running nicely,
> no errors whatsoever.
>
> devel:/etc/rc.d# hdparm -Iv /dev/hdb|grep -a dma
>  using_dma    =  1 (on)
>         DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5


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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-18 15:45   ` Bartlomiej Zolnierkiewicz
@ 2003-10-20  9:24     ` Torben Mathiasen
  2003-10-20 10:44       ` Tomas Szepe
  0 siblings, 1 reply; 11+ messages in thread
From: Torben Mathiasen @ 2003-10-20  9:24 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Tomas Szepe, Torben Mathiasen, linux-kernel

On Sat, Oct 18 2003, Bartlomiej Zolnierkiewicz wrote:
> 
> We depend on BIOS hints for ServerWorks and BIOS is not enabling DMA.
> AFAIR we can't force DMA in this case because there are broken hardware
> designs, so current behavior is safe.  However more research is needed...
>

On a Proliant, DMA may or may not be supported on different devices, and the
BIOS knows about it. So by letting it hint its setup, we have a safe way of
configuring the chipset. The 'biostimings' code used a similar approach (by
leaving the BIOS setup timings alone), but as you also reported, was so generic
that it could be dangerous for other chipsets.

So if you have a Proliant where you get DMA enabled and it fails, it has to be
a BIOS bug (since the BIOS hintet DMA), and I'd like to know about it. OTOH, if
you have to explicitly enable DMA using hdparm, it may not be supported (since
the BIOS hinted pio). 


BTW Tomas, that drive you're adding to your ML350G2, is that just to have a spare IDE
disk drive? IIRC, the 350 is a SCSI system with only an ATAPI cdrom drive. But
I could be wrong.

Thanks,
Torben

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

* Re: [RFT][PATCH] fix ServerWorks PIO auto-tuning
  2003-10-20  9:24     ` Torben Mathiasen
@ 2003-10-20 10:44       ` Tomas Szepe
  0 siblings, 0 replies; 11+ messages in thread
From: Tomas Szepe @ 2003-10-20 10:44 UTC (permalink / raw)
  To: Torben Mathiasen; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

On Oct-20 2003, Mon, 11:24 +0200
Torben Mathiasen <torben.mathiasen@hp.com> wrote:

> BTW Tomas, that drive you're adding to your ML350G2, is that just to have
> a spare IDE disk drive? IIRC, the 350 is a SCSI system with only an ATAPI
> cdrom drive. But I could be wrong.

Yes, Torben, you are corrent, the IDE drive is just a spare
used for doing nightly backups of the SCSI system partitions.
We've been using 80GB/120GB WD drives in many OSB4/CSB5-based
HP/Compaq systems (mostly this Proliant model, HP E800 and HP
TC3100) with hand-enabled DMA and have so far had no problems.

(Btw, this particular ML350G3 came with an add-on cciss hwraid
card that seemed to exhibit extremely poor performance, so we
attached all the SCSI drives directly to the onboard AIC7xxx
and went for /dev/md*.)

Thanks,
-- 
Tomas Szepe <szepe@pinerecords.com>

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

end of thread, other threads:[~2003-10-20 10:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-16 21:44 [RFT][PATCH] fix ServerWorks PIO auto-tuning Bartlomiej Zolnierkiewicz
2003-10-17  7:37 ` Tomas Szepe
2003-10-17  9:30   ` Bartlomiej Zolnierkiewicz
2003-10-17  9:51 ` Torben Mathiasen
2003-10-17 10:22   ` Bartlomiej Zolnierkiewicz
2003-10-17 10:20     ` Torben Mathiasen
2003-10-17 10:23   ` Tomas Szepe
2003-10-18 13:02 ` Tomas Szepe
2003-10-18 15:45   ` Bartlomiej Zolnierkiewicz
2003-10-20  9:24     ` Torben Mathiasen
2003-10-20 10:44       ` Tomas Szepe

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