Skip to contentSkip to conversation

Promise, DMA and RAID5 problems running 2.4.1

DISCUSSION Petr Vandrovec 4 participants 4 messages Feb 7, 2001 – Feb 9, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 9 lines · Alan Cox
Quoted 5 lines

It is known bug which I reported to Andre already. Open drivers/ide/ide.c in favorite text editor, and replace strange body of ide_delay_50ms() with simple mdelay(50). Promise driver invokes ide_delay_50ms with interrupts disabled, so it freezes here forever. If you have NMI watchdog, you'll get nice oopses.

Its a bug in the promise driver. ide_delay_50ms() is being friendly to the rest of the box. If the reset path for the promise cant be polite then it should use mdelay() itself.

Iff CONFIG_BLK_DEV_IDECS is set then yes, doing schedule is better. But I do not see any benefit in doing

unsigned long timeout = jiffies + ((HZ + 19)/20) + 1; while (0 < (signed long)(timeout - jiffies));

over

mdelay(50);

And on my box, busy while loop is executed, not schedule(HZ/20)...

Thanks,
Petr Vandrovec [email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 5 lines

Iff CONFIG_BLK_DEV_IDECS is set then yes, doing schedule is better. But I do not see any benefit in doing

unsigned long timeout = jiffies + ((HZ + 19)/20) + 1; while (0 < (signed long)(timeout - jiffies));

On that bit we agree.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 7 lines · Alan Cox
Quoted 5 lines

Iff CONFIG_BLK_DEV_IDECS is set then yes, doing schedule is better. But I do not see any benefit in doing

unsigned long timeout = jiffies + ((HZ + 19)/20) + 1; while (0 < (signed long)(timeout - jiffies));

On that bit we agree.

What do you want fixed?
Send a patch and lets try it....

Andre Hedrick
Linux ATA Development
ASL Kernel Development
-----------------------------------------------------------------------------

ASL, Inc.                                     Toll free: 1-877-ASL-3535
1757 Houret Court                             Fax: 1-408-941-2071
Milpitas, CA 95035                            Web: www.aslab.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw
In reply to Alan Cox
Quoted 5 lines · Andre Hedrick
Quoted 3 lines · Alan Cox
Quoted 3 lines

Iff CONFIG_BLK_DEV_IDECS is set then yes, doing schedule is better. But I do not see any benefit in doing

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

unsigned long timeout = jiffies + ((HZ + 19)/20) + 1; while (0 < (signed long)(timeout - jiffies));

On that bit we agree.

What do you want fixed?
Send a patch and lets try it....

How about this?

Signature · 2 lines
Vojtech Pavlik
SuSE Labs
pdc202xx.c renamed from pdc202xx.c.old +4 -10
@@ -747,14 +747,11 @@
 {
 	unsigned long high_16	= pci_resource_start(HWIF(drive)->pci_dev, 4);
 	byte udma_speed_flag	= inb(high_16 + 0x001f);
-	int i			= 0;
 
 	OUT_BYTE(udma_speed_flag | 0x10, high_16 + 0x001f);
-	ide_delay_50ms();
-	ide_delay_50ms();
+	mdelay(100)
 	OUT_BYTE(udma_speed_flag & ~0x10, high_16 + 0x001f);
-	for (i = 0; i < 40; i++)
-		ide_delay_50ms();
+	mdelay(2000);		/* 2 seconds ?! */
 }
 
 unsigned int __init pci_init_pdc202xx (struct pci_dev *dev, const char *name)
@@ -767,7 +764,6 @@
 	if ((dev->device == PCI_DEVICE_ID_PROMISE_20262) ||
 	    (dev->device == PCI_DEVICE_ID_PROMISE_20265) ||
 	    (dev->device == PCI_DEVICE_ID_PROMISE_20267)) {
-		int i = 0;
 		/*
 		 * software reset -  this is required because the bios
 		 * will set UDMA timing on if the hdd supports it. The
@@ -779,11 +775,9 @@
 		 */
 
 		OUT_BYTE(udma_speed_flag | 0x10, high_16 + 0x001f);
-		ide_delay_50ms();
-		ide_delay_50ms();
+		mdelay(100);
 		OUT_BYTE(udma_speed_flag & ~0x10, high_16 + 0x001f);
-		for (i=0; i<40; i++)
-			ide_delay_50ms();
+		mdelay(2000);	/* 2 seconds ?! */
 	}
 
 	if (dev->resource[PCI_ROM_RESOURCE].start) {