Commit a50de1c4 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by David S. Miller

[PATCH] fix issues with loading PCI IDE drivers as modules

From: Davin McCall <davmac@ozonline.com.au>

Set hwif->chipset to ide_forced if it was forced by kernel parameters.

Set hwif->chipset to ide_generic for hwifs controlled by generic IDE
code, so they wont be taken by setup_pci.c:ide_match_hwif().

Patch also fixes /proc/ide/ideX/model to report "generic" instead of
"(none)" for default hwifs.

This has been in -mm since 2.6.1-mm1.
parent 4a9c380d
...@@ -1343,6 +1343,8 @@ int ideprobe_init (void) ...@@ -1343,6 +1343,8 @@ int ideprobe_init (void)
int unit; int unit;
if (!hwif->present) if (!hwif->present)
continue; continue;
if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced)
hwif->chipset = ide_generic;
for (unit = 0; unit < MAX_DRIVES; ++unit) for (unit = 0; unit < MAX_DRIVES; ++unit)
if (hwif->drives[unit].present) if (hwif->drives[unit].present)
ata_attach(&hwif->drives[unit]); ata_attach(&hwif->drives[unit]);
......
...@@ -348,8 +348,10 @@ static int proc_ide_read_imodel ...@@ -348,8 +348,10 @@ static int proc_ide_read_imodel
int len; int len;
const char *name; const char *name;
/*
* Neither ide_unknown nor ide_forced should be set at this point.
*/
switch (hwif->chipset) { switch (hwif->chipset) {
case ide_unknown: name = "(none)"; break;
case ide_generic: name = "generic"; break; case ide_generic: name = "generic"; break;
case ide_pci: name = "pci"; break; case ide_pci: name = "pci"; break;
case ide_cmd640: name = "cmd640"; break; case ide_cmd640: name = "cmd640"; break;
......
...@@ -2179,7 +2179,7 @@ int __init ide_setup (char *s) ...@@ -2179,7 +2179,7 @@ int __init ide_setup (char *s)
memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
hwif->irq = vals[2]; hwif->irq = vals[2];
hwif->noprobe = 0; hwif->noprobe = 0;
hwif->chipset = ide_generic; hwif->chipset = ide_forced;
goto done; goto done;
case 0: goto bad_option; case 0: goto bad_option;
......
...@@ -419,7 +419,7 @@ static void __init setup_device_ptrs (void) ...@@ -419,7 +419,7 @@ static void __init setup_device_ptrs (void)
cmd_hwif1 = &ide_hwifs[1]; /* default, if not found below */ cmd_hwif1 = &ide_hwifs[1]; /* default, if not found below */
for (i = 0; i < MAX_HWIFS; i++) { for (i = 0; i < MAX_HWIFS; i++) {
ide_hwif_t *hwif = &ide_hwifs[i]; ide_hwif_t *hwif = &ide_hwifs[i];
if (hwif->chipset == ide_unknown || hwif->chipset == ide_generic) { if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced) {
if (hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0) if (hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0)
cmd_hwif0 = hwif; cmd_hwif0 = hwif;
else if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170) else if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170)
......
...@@ -59,7 +59,7 @@ static ide_hwif_t *ide_match_hwif(unsigned long io_base, u8 bootable, const char ...@@ -59,7 +59,7 @@ static ide_hwif_t *ide_match_hwif(unsigned long io_base, u8 bootable, const char
for (h = 0; h < MAX_HWIFS; ++h) { for (h = 0; h < MAX_HWIFS; ++h) {
hwif = &ide_hwifs[h]; hwif = &ide_hwifs[h];
if (hwif->io_ports[IDE_DATA_OFFSET] == io_base) { if (hwif->io_ports[IDE_DATA_OFFSET] == io_base) {
if (hwif->chipset == ide_generic) if (hwif->chipset == ide_forced)
return hwif; /* a perfect match */ return hwif; /* a perfect match */
} }
} }
......
...@@ -279,7 +279,7 @@ typedef enum { ide_unknown, ide_generic, ide_pci, ...@@ -279,7 +279,7 @@ typedef enum { ide_unknown, ide_generic, ide_pci,
ide_pdc4030, ide_rz1000, ide_trm290, ide_pdc4030, ide_rz1000, ide_trm290,
ide_cmd646, ide_cy82c693, ide_4drives, ide_cmd646, ide_cy82c693, ide_4drives,
ide_pmac, ide_etrax100, ide_acorn, ide_pmac, ide_etrax100, ide_acorn,
ide_pc9800 ide_pc9800, ide_forced
} hwif_chipset_t; } hwif_chipset_t;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment