summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-10 00:01:11 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-10 00:01:11 +0200
commit6d208b39c45edee5def6c201fcd51561c5a39828 (patch)
tree55645d2b6173e3161d12e5c9efdc4bd052b75b56
parent5cbf79cdb37be2aa2a1b4fa94144526b14557060 (diff)
downloadop-kernel-dev-6d208b39c45edee5def6c201fcd51561c5a39828.zip
op-kernel-dev-6d208b39c45edee5def6c201fcd51561c5a39828.tar.gz
ide: legacy PCI bus order probing fixes
IDE PCI host drivers should register themselves with IDE core only when IDE driver is built-in, otherwise (IDE driver is modular and thus IDE PCI host drivers are also modular) the code has no effect and just complicates the probing. Fix it by adding new config option CONFIG_IDEPCI_PCIBUS (defined only when needed and invisible to the user) and covering by #ifdef/#endif the code in question. It turned out that "ide=reverse" was silently accepted but did nothing in case when IDE driver was modular, this is fixed now. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/Kconfig3
-rw-r--r--drivers/ide/ide.c10
-rw-r--r--drivers/ide/setup-pci.c2
-rw-r--r--include/linux/ide.h5
4 files changed, 15 insertions, 5 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index a678bbe..1d06b41 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -371,6 +371,9 @@ config IDEPCI_SHARE_IRQ
It is safe to say Y to this question, in most cases.
If unsure, say N.
+config IDEPCI_PCIBUS_ORDER
+ def_bool PCI && BLK_DEV_IDE=y && BLK_DEV_IDEPCI
+
config BLK_DEV_OFFBOARD
bool "Boot off-board chipsets first support"
depends on PCI && BLK_DEV_IDEPCI
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 038f261..f2b547f 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -172,7 +172,7 @@ static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */
DECLARE_MUTEX(ide_cfg_sem);
__cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock);
-#ifdef CONFIG_BLK_DEV_IDEPCI
+#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */
#endif
@@ -1333,13 +1333,13 @@ static int __init ide_setup(char *s)
return 1;
}
-#ifdef CONFIG_BLK_DEV_IDEPCI
+#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
if (!strcmp(s, "ide=reverse")) {
ide_scan_direction = 1;
printk(" : Enabled support for IDE inverse scan order.\n");
return 1;
}
-#endif /* CONFIG_BLK_DEV_IDEPCI */
+#endif
#ifdef CONFIG_BLK_DEV_IDEACPI
if (!strcmp(s, "ide=noacpi")) {
@@ -1599,9 +1599,9 @@ extern void __init h8300_ide_init(void);
*/
static void __init probe_for_hwifs (void)
{
-#ifdef CONFIG_BLK_DEV_IDEPCI
+#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
ide_scan_pcibus(ide_scan_direction);
-#endif /* CONFIG_BLK_DEV_IDEPCI */
+#endif
#ifdef CONFIG_ETRAX_IDE
{
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 892cda7..67035ba 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -772,6 +772,7 @@ out:
EXPORT_SYMBOL_GPL(ide_setup_pci_devices);
+#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
/*
* Module interfaces
*/
@@ -878,3 +879,4 @@ void __init ide_scan_pcibus (int scan_direction)
__pci_register_driver(d, d->driver.owner, d->driver.mod_name);
}
}
+#endif
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 52d482a..df4e6a5 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1205,9 +1205,14 @@ void ide_init_disk(struct gendisk *, ide_drive_t *);
extern int ideprobe_init(void);
+#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
extern void ide_scan_pcibus(int scan_direction) __init;
extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name);
#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME)
+#else
+#define ide_pci_register_driver(d) pci_register_driver(d)
+#endif
+
void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);
extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d);
OpenPOWER on IntegriCloud