fix/improve modular IDE (-mm)
PATCH 1/1 fix/improve modular IDE (-mm)
Hi,
Please add this patch to -mm and remove modular-ide-is-broken.patch.
Thanks,
--bart
- IDE can be used as module again (compiles and works), this fixes bugzilla bugs #576 and #1700
- separate module for probing is no longer required
- generic/default host driver is available as ide_generic module
linux-2.6.1-root/drivers/block/ll_rw_blk.c | 2 + linux-2.6.1-root/drivers/ide/Kconfig | 6 +++ linux-2.6.1-root/drivers/ide/Makefile | 39 +++++++++++++++------ linux-2.6.1-root/drivers/ide/ide-generic.c | 36 +++++++++++++++++++ linux-2.6.1-root/drivers/ide/ide-probe.c | 25 +------------ linux-2.6.1-root/drivers/ide/ide.c | 49 +++------------------------ linux-2.6.1-root/drivers/ide/legacy/Makefile | 8 ---- linux-2.6.1-root/drivers/ide/pci/Makefile | 1 linux-2.6.1-root/include/linux/ide.h | 1 linux-2.6.1/drivers/ide/ppc/Makefile | 6 --- 10 files changed, 80 insertions(+), 93 deletions(-)
drivers/block/ll_rw_blk.c renamed from drivers/block/ll_rw_blk.c~modular-ide-fix +2 -0
@@ -146,6 +146,8 @@ void blk_queue_activity_fn(request_queue q->activity_data = data; } +EXPORT_SYMBOL (blk_queue_activity_fn); +/** * blk_queue_prep_rq - set a prepare_request function for queue * @q: queue
drivers/ide/Makefile renamed from drivers/ide/Makefile~modular-ide-fix +28 -11
@@ -10,22 +10,39 @@ # First come modules that register themselves with the core obj-$(CONFIG_BLK_DEV_IDE) += pci/ +ide-core-y += ide.o ide-default.o ide-io.o ide-iops.o ide-lib.o ide-probe.o \ + ide-taskfile.o + +ide-core-$(CONFIG_BLK_DEV_CMD640) += pci/cmd640.o + # Core IDE code - must come before legacy +ide-core-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o +ide-core-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o +ide-core-$(CONFIG_BLK_DEV_IDE_TCQ) += ide-tcq.o +ide-core-$(CONFIG_PROC_FS) += ide-proc.o +ide-core-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o + +# built-in only drivers from legacy/ +ide-core-$(CONFIG_BLK_DEV_IDE_PC9800) += pc9800.o +ide-core-$(CONFIG_BLK_DEV_PDC4030) += pdc4030.o +ide-core-$(CONFIG_BLK_DEV_BUDDHA) += buddha.o +ide-core-$(CONFIG_BLK_DEV_FALCON_IDE) += falconide.o +ide-core-$(CONFIG_BLK_DEV_GAYLE) += gayle.o +ide-core-$(CONFIG_BLK_DEV_MAC_IDE) += macide.o +ide-core-$(CONFIG_BLK_DEV_Q40IDE) += q40ide.o + +# built-in only drivers from ppc/ +ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE) += mpc8xx.o +ide-core-$(CONFIG_BLK_DEV_IDE_PMAC) += pmac.o +ide-core-$(CONFIG_BLK_DEV_IDE_SWARM) += swarm.o + +obj-$(CONFIG_BLK_DEV_IDE) += ide-core.o +obj-$(CONFIG_IDE_GENERIC) += ide-generic.o -obj-$(CONFIG_BLK_DEV_IDE) += ide-io.o ide-probe.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.o obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk.o obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd.o obj-$(CONFIG_BLK_DEV_IDETAPE) += ide-tape.o obj-$(CONFIG_BLK_DEV_IDEFLOPPY) += ide-floppy.o -obj-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o -obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o -obj-$(CONFIG_BLK_DEV_IDE_TCQ) += ide-tcq.o -obj-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o - -ifeq ($(CONFIG_BLK_DEV_IDE),y) -obj-$(CONFIG_PROC_FS) += ide-proc.o -endif - -obj-$(CONFIG_BLK_DEV_IDE) += legacy/ ppc/ arm/ +obj-$(CONFIG_BLK_DEV_IDE) += legacy/ arm/ obj-$(CONFIG_BLK_DEV_HD) += legacy/
drivers/ide/legacy/Makefile renamed from drivers/ide/legacy/Makefile~modular-ide-fix +0 -8
@@ -2,17 +2,9 @@ obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o -obj-$(CONFIG_BLK_DEV_IDE_PC9800) += pc9800.o -obj-$(CONFIG_BLK_DEV_PDC4030) += pdc4030.o obj-$(CONFIG_BLK_DEV_QD65XX) += qd65xx.o obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o -obj-$(CONFIG_BLK_DEV_BUDDHA) += buddha.o -obj-$(CONFIG_BLK_DEV_FALCON_IDE) += falconide.o -obj-$(CONFIG_BLK_DEV_GAYLE) += gayle.o -obj-$(CONFIG_BLK_DEV_MAC_IDE) += macide.o -obj-$(CONFIG_BLK_DEV_Q40IDE) += q40ide.o - obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o # Last of all
drivers/ide/pci/Makefile renamed from drivers/ide/pci/Makefile~modular-ide-fix +0 -1
@@ -3,7 +3,6 @@ obj-$(CONFIG_BLK_DEV_ADMA100) += adma10 obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o -obj-$(CONFIG_BLK_DEV_CMD640) += cmd640.o obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o obj-$(CONFIG_BLK_DEV_CS5520) += cs5520.o obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o
drivers/ide/ppc/Makefile deleted +0 -6
@@ -1,6 +0,0 @@ - -obj-$(CONFIG_BLK_DEV_MPC8xx_IDE) += mpc8xx.o -obj-$(CONFIG_BLK_DEV_IDE_PMAC) += pmac.o -obj-$(CONFIG_BLK_DEV_IDE_SWARM) += swarm.o - -EXTRA_CFLAGS := -Idrivers/ide
drivers/ide/Kconfig renamed from drivers/ide/Kconfig~modular-ide-fix +6 -0
@@ -296,6 +296,12 @@ config IDE_TASKFILE_IO comment "IDE chipset support/bugfixes" +config IDE_GENERIC + tristate "generic/default IDE chipset support" + default y + help + If unsure, say Y. + config BLK_DEV_CMD640 bool "CMD640 chipset bugfix/support" depends on X86
drivers/ide/ide.c renamed from drivers/ide/ide.c~modular-ide-fix +6 -43
93 lines not on this page · raw message
drivers/ide/ide-generic.c new file +36 -0
@@ -0,0 +1,36 @@ +/* +* generic/default IDE host driver +* +* Copyright (C) 2004 Bartlomiej Zolnierkiewicz +*/ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/module.h> +#include <linux/ide.h> + +static int __init ide_generic_init (void ) +{ +MOD_INC_USE_COUNT ; +if (ide_hwifs[0 ].io_ports[IDE_DATA_OFFSET ]) +ide_get_lock (NULL ,NULL );/* for atari only */ + + (void )ideprobe_init (); + +if (ide_hwifs[0 ].io_ports[IDE_DATA_OFFSET ]) +ide_release_lock ();/* for atari only */ + +#ifdef CONFIG_PROC_FS +create_proc_ide_interfaces (); +#endif +return 0 ; +} + +static void __exit ide_generic_exit(void) +{ +} + +module_init (ide_generic_init); +module_exit (ide_generic_exit); + +MODULE_LICENSE ("GPL" );
drivers/ide/ide-probe.c renamed from drivers/ide/ide-probe.c~modular-ide-fix +2 -23
@@ -1322,8 +1322,7 @@ int ideprobe_init (void) {unsigned int index;int probe[MAX_HWIFS ]; - -MOD_INC_USE_COUNT ; +memset (probe,0 ,MAX_HWIFS *sizeof (int ));for (index =0 ; index <MAX_HWIFS ; ++index) probe[index] = !ide_hwifs[index].present;
@@ -1350,27 +1349,7 @@ int ideprobe_init (void)ata_attach (&hwif->drives[unit]); } } -if (!ide_probe) - ide_probe = &ideprobe_init; -MOD_DEC_USE_COUNT ;return 0 ; } -#ifdef MODULE -int init_module (void ) -{ -unsigned int index; - -for (index =0 ; index <MAX_HWIFS ; ++index) -ide_unregister (index); -ideprobe_init (); -create_proc_ide_interfaces (); -return 0 ; -} - -void cleanup_module (void ) -{ - ide_probe =NULL ; -} -MODULE_LICENSE ("GPL" ); -#endif /* MODULE */ +EXPORT_SYMBOL_GPL (ideprobe_init);
include/linux/ide.h renamed from include/linux/ide.h~modular-ide-fix +0 -1
@@ -1231,7 +1231,6 @@ typedef struct ide_devices_s {*/ #ifndef _IDE_Cextern ide_hwif_t ide_hwifs[];/* master data repository */ -extern int (*ide_probe)(void );extern ide_devices_t *idedisk;extern ide_devices_t *idecd;
_