lkml.org 
[lkml]   [2000]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH 2.4.0.9.8: Fix IDE...
Linus,

Ug. Why do I feel like the IDE "driver" is code layered upon code
layered upon code, through the ages, with nary a cleanup in between?

My previous patch was a fix, but (brown paper bag time) standard IDE
devices no longer called chipset init. People either had no IDE, or
were stuck in legacy mode. This fixes it.

The IDE layer is in serious need of a cleanup though, IMHO...

With this tested patch full functionality should be restored, without
reverting to the previously-crazy code found in test9-pre7 and before.

Jeff




Index: drivers/ide/ide-pci.c
===================================================================
RCS file: /usr/jgarzik/cvslan/linux_2_3/drivers/ide/ide-pci.c,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 ide-pci.c
--- drivers/ide/ide-pci.c 2000/10/02 08:32:44 1.1.1.9
+++ drivers/ide/ide-pci.c 2000/10/02 18:28:10
@@ -493,6 +493,7 @@
byte tmp = 0;
ide_hwif_t *hwif, *mate = NULL;
unsigned int class_rev;
+ int pci_class_ide;

#ifdef CONFIG_IDEDMA_AUTO
autodma = 1;
@@ -538,7 +539,8 @@
* Can we trust the reported IRQ?
*/
pciirq = dev->irq;
- if ((dev->class & ~(0xff)) != (PCI_CLASS_STORAGE_IDE << 8)) {
+ pci_class_ide = ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE);
+ if (!pci_class_ide) {
printk("%s: not 100%% native mode: will probe irqs later\n", d->name);
/*
* This allows offboard ide-pci cards the enable a BIOS,
@@ -548,11 +550,17 @@
*/
pciirq = (d->init_chipset) ? d->init_chipset(dev, d->name) : ide_special_settings(dev, d->name);
} else if (tried_config) {
- printk("%s: will probe irqs later\n", d->name);
+ printk(KERN_INFO "%s: will probe irqs later\n", d->name);
pciirq = 0;
} else if (!pciirq) {
- printk("%s: bad irq (%d): will probe later\n", d->name, pciirq);
- pciirq = 0;
+ if (pci_class_ide) {
+ /* this is the normal path for most IDE devices */
+ if (d->init_chipset)
+ pciirq = d->init_chipset(dev, d->name);
+ else
+ printk(KERN_INFO "%s standard IDE storage device detected\n", d->name);
+ } else
+ printk(KERN_WARNING "%s: bad irq (0): will probe later\n", d->name);
} else {
if (d->init_chipset)
(void) d->init_chipset(dev, d->name);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.050 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site