public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] modular IDE for 2.6.1 ugly but working fix
@ 2004-01-17 12:13 Witold Krecicki
  2004-01-17 13:22 ` [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix) Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 9+ messages in thread
From: Witold Krecicki @ 2004-01-17 12:13 UTC (permalink / raw)
  To: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

Here it goes - modular 2.6 IDE - I know it's ugly (and I don't know whether it 
will work with cmd640 chipset) but it's working for me and several other 
people.

-- 
Witold Kręcicki (adasi) adasi [at] culm.net
GPG key: 7AE20871
http://www.culm.net

[-- Attachment #2: linux-2.6.1-modular_ide.patch --]
[-- Type: text/x-diff, Size: 4309 bytes --]

diff -urN --exclude-from=zf linux-2.6.1/drivers/block/ll_rw_blk.c linux-2.6.1-ziew/drivers/block/ll_rw_blk.c
--- linux-2.6.1/drivers/block/ll_rw_blk.c	2004-01-17 13:02:01.084322656 +0100
+++ linux-2.6.1-ziew/drivers/block/ll_rw_blk.c	2004-01-15 18:14:33.000000000 +0100
@@ -145,7 +145,7 @@
 	q->activity_fn = fn;
 	q->activity_data = data;
 }
-
+EXPORT_SYMBOL(blk_queue_activity_fn);
 /**
  * blk_queue_prep_rq - set a prepare_request function for queue
  * @q:		queue
diff -urN --exclude-from=zf linux-2.6.1/drivers/ide/ide-probe.c linux-2.6.1-ziew/drivers/ide/ide-probe.c
--- linux-2.6.1/drivers/ide/ide-probe.c	2004-01-09 07:59:44.000000000 +0100
+++ linux-2.6.1-ziew/drivers/ide/ide-probe.c	2004-01-15 18:10:37.000000000 +0100
@@ -1354,21 +1354,5 @@
 	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(ideprobe_init);
diff -urN --exclude-from=zf linux-2.6.1/drivers/ide/ide-probe-mod.c linux-2.6.1-ziew/drivers/ide/ide-probe-mod.c
--- linux-2.6.1/drivers/ide/ide-probe-mod.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.1-ziew/drivers/ide/ide-probe-mod.c	2004-01-15 18:07:42.000000000 +0100
@@ -0,0 +1,42 @@
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/timer.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <linux/major.h>
+#include <linux/errno.h>
+#include <linux/genhd.h>
+#include <linux/slab.h>
+#include <linux/delay.h>
+#include <linux/ide.h>
+#include <linux/spinlock.h>
+#include <linux/pci.h>
+#include <linux/kmod.h>
+
+#include <asm/byteorder.h>
+#include <asm/irq.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+extern int ideprobe_init (void);
+#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 */
diff -urN --exclude-from=zf linux-2.6.1/drivers/ide/Makefile linux-2.6.1-ziew/drivers/ide/Makefile
--- linux-2.6.1/drivers/ide/Makefile	2004-01-09 07:59:34.000000000 +0100
+++ linux-2.6.1-ziew/drivers/ide/Makefile	2004-01-17 12:41:59.000000000 +0100
@@ -12,19 +12,26 @@
 
 # Core IDE code - must come before legacy
 
-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_IDE)		+= ide-mod.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
+
+ide-mod-y				+= ide.o ide-io.o ide-iops.o ide-taskfile.o ide-lib.o ide-default.o ide-probe.o 
+ide-mod-$(CONFIG_BLK_DEV_CMD640)	+= pci/cmd640.o
+ide-mod-$(CONFIG_BLK_DEV_IDEPNP)	+= ide-pnp.o
+ide-mod-$(CONFIG_BLK_DEV_IDEPCI)	+= setup-pci.o
+ide-mod-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
+ide-mod-$(CONFIG_BLK_DEV_IDE_TCQ)	+= ide-tcq.o
 
 ifeq ($(CONFIG_BLK_DEV_IDE),y)
-obj-$(CONFIG_PROC_FS)			+= ide-proc.o
+ide-mod-$(CONFIG_PROC_FS)		+= ide-proc.o
+endif
+
+ifeq ($(CONFIG_BLK_DEV_IDE),m)
+ide-mod-$(CONFIG_PROC_FS)		+= ide-proc.o
 endif
 
 obj-$(CONFIG_BLK_DEV_IDE)		+= legacy/ ppc/ arm/
diff -urN --exclude-from=zf linux-2.6.1/drivers/ide/pci/Makefile linux-2.6.1-ziew/drivers/ide/pci/Makefile
--- linux-2.6.1/drivers/ide/pci/Makefile	2004-01-09 07:59:10.000000000 +0100
+++ linux-2.6.1-ziew/drivers/ide/pci/Makefile	2004-01-15 18:11:38.000000000 +0100
@@ -4,7 +4,6 @@
 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
 obj-$(CONFIG_BLK_DEV_SC1200)		+= sc1200.o

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix)
  2004-01-17 12:13 [PATCH] modular IDE for 2.6.1 ugly but working fix Witold Krecicki
@ 2004-01-17 13:22 ` Bartlomiej Zolnierkiewicz
  2004-01-17 15:38   ` Sam Ravnborg
  2004-01-20  2:01   ` Rusty Russell
  0 siblings, 2 replies; 9+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-01-17 13:22 UTC (permalink / raw)
  To: Witold Krecicki; +Cc: Linux Kernel Mailing List


Hi,

On Saturday 17 of January 2004 13:13, Witold Krecicki wrote:
> Here it goes - modular 2.6 IDE - I know it's ugly (and I don't know whether
> it will work with cmd640 chipset) but it's working for me and several other
> people.

It will probably work for cmd640 but won't for all other drivers which can't
be build as modules.  What about this patch instead?  I've been working on
it from some time and I think all cornercases are covered.

Cheers,
--bart


- IDE can be used as module again (compiles and works)
- 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   |   37 +++++++++++++++++++++
 linux-2.6.1-root/drivers/ide/ide-probe.c     |   23 -------------
 linux-2.6.1-root/drivers/ide/ide.c           |   46 +++------------------------
 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(+), 89 deletions(-)

diff -puN drivers/block/ll_rw_blk.c~modular-ide-fix drivers/block/ll_rw_blk.c
--- linux-2.6.1/drivers/block/ll_rw_blk.c~modular-ide-fix	2004-01-17 13:51:23.000000000 +0100
+++ linux-2.6.1-root/drivers/block/ll_rw_blk.c	2004-01-17 13:51:45.000000000 +0100
@@ -145,6 +145,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
diff -puN drivers/ide/Makefile~modular-ide-fix drivers/ide/Makefile
--- linux-2.6.1/drivers/ide/Makefile~modular-ide-fix	2004-01-17 13:31:34.000000000 +0100
+++ linux-2.6.1-root/drivers/ide/Makefile	2004-01-17 13:41:24.000000000 +0100
@@ -10,22 +10,39 @@
 # First come modules that register themselves with the core
 obj-$(CONFIG_BLK_DEV_IDE)		+= pci/
 
+ide-core-objs += 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/
diff -puN drivers/ide/legacy/Makefile~modular-ide-fix drivers/ide/legacy/Makefile
--- linux-2.6.1/drivers/ide/legacy/Makefile~modular-ide-fix	2004-01-17 13:42:11.000000000 +0100
+++ linux-2.6.1-root/drivers/ide/legacy/Makefile	2004-01-17 13:42:27.000000000 +0100
@@ -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
diff -puN drivers/ide/pci/Makefile~modular-ide-fix drivers/ide/pci/Makefile
--- linux-2.6.1/drivers/ide/pci/Makefile~modular-ide-fix	2004-01-17 13:31:34.000000000 +0100
+++ linux-2.6.1-root/drivers/ide/pci/Makefile	2004-01-17 13:31:34.000000000 +0100
@@ -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
diff -puN -L drivers/ide/ppc/Makefile drivers/ide/ppc/Makefile~modular-ide-fix /dev/null
--- linux-2.6.1/drivers/ide/ppc/Makefile
+++ /dev/null	2004-01-17 00:25:55.000000000 +0100
@@ -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
diff -puN drivers/ide/Kconfig~modular-ide-fix drivers/ide/Kconfig
--- linux-2.6.1/drivers/ide/Kconfig~modular-ide-fix	2004-01-17 13:31:34.000000000 +0100
+++ linux-2.6.1-root/drivers/ide/Kconfig	2004-01-17 13:31:34.000000000 +0100
@@ -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
diff -puN drivers/ide/ide.c~modular-ide-fix drivers/ide/ide.c
--- linux-2.6.1/drivers/ide/ide.c~modular-ide-fix	2004-01-17 13:31:34.000000000 +0100
+++ linux-2.6.1-root/drivers/ide/ide.c	2004-01-17 13:46:04.000000000 +0100
@@ -153,7 +153,6 @@
 #include <linux/cdrom.h>
 #include <linux/seq_file.h>
 #include <linux/device.h>
-#include <linux/kmod.h>
 
 #include <asm/byteorder.h>
 #include <asm/irq.h>
@@ -443,21 +442,6 @@ u8 ide_dump_status (ide_drive_t *drive, 
 
 EXPORT_SYMBOL(ide_dump_status);
 
-
-
-void ide_probe_module (void)
-{
-	if (!ide_probe) {
-#if defined(CONFIG_KMOD) && defined(CONFIG_BLK_DEV_IDE_MODULE)
-		(void) request_module("ide-probe-mod");
-#endif /* (CONFIG_KMOD) && (CONFIG_BLK_DEV_IDE_MODULE) */
-	} else {
-		(void)ide_probe();
-	}
-}
-
-EXPORT_SYMBOL(ide_probe_module);
-
 static int ide_open (struct inode * inode, struct file * filp)
 {
 	return -ENXIO;
@@ -1033,7 +1017,7 @@ found:
 	hwif->chipset = hw->chipset;
 
 	if (!initializing) {
-		ide_probe_module();
+		probe_hwif_init(hwif);
 #ifdef CONFIG_PROC_FS
 		create_proc_ide_interfaces();
 #endif
@@ -2282,28 +2266,6 @@ static void __init probe_for_hwifs (void
 #endif /* CONFIG_BLK_DEV_IDEPNP */
 }
 
-void __init ide_init_builtin_drivers (void)
-{
-	/*
-	 * Probe for special PCI and other "known" interface chipsets
-	 */
-	probe_for_hwifs ();
-
-#ifdef CONFIG_BLK_DEV_IDE
-	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 */
-#endif /* CONFIG_BLK_DEV_IDE */
-
-#ifdef CONFIG_PROC_FS
-	proc_ide_create();
-#endif
-}
-
 /*
  *	Actually unregister the subdriver. Called with the
  *	request lock dropped.
@@ -2607,9 +2569,13 @@ int __init ide_init (void)
 #endif
 
 	initializing = 1;
-	ide_init_builtin_drivers();
+	/* Probe for special PCI and other "known" interface chipsets. */
+	probe_for_hwifs();
 	initializing = 0;
 
+#ifdef CONFIG_PROC_FS
+	proc_ide_create();
+#endif
 	return 0;
 }
 
diff -puN /dev/null drivers/ide/ide-generic.c
--- /dev/null	2004-01-17 00:25:55.000000000 +0100
+++ linux-2.6.1-root/drivers/ide/ide-generic.c	2004-01-17 14:05:13.792216384 +0100
@@ -0,0 +1,37 @@
+
+/*
+ * 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");
diff -puN drivers/ide/ide-probe.c~modular-ide-fix drivers/ide/ide-probe.c
--- linux-2.6.1/drivers/ide/ide-probe.c~modular-ide-fix	2004-01-17 13:31:34.000000000 +0100
+++ linux-2.6.1-root/drivers/ide/ide-probe.c	2004-01-17 13:52:16.000000000 +0100
@@ -1323,7 +1323,6 @@ 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;
@@ -1348,27 +1347,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);
diff -puN include/linux/ide.h~modular-ide-fix include/linux/ide.h
--- linux-2.6.1/include/linux/ide.h~modular-ide-fix	2004-01-17 13:31:34.000000000 +0100
+++ linux-2.6.1-root/include/linux/ide.h	2004-01-17 13:31:34.000000000 +0100
@@ -1231,7 +1231,6 @@ typedef struct ide_devices_s {
  */
 #ifndef _IDE_C
 extern	ide_hwif_t	ide_hwifs[];		/* master data repository */
-extern int (*ide_probe)(void);
 
 extern ide_devices_t   *idedisk;
 extern ide_devices_t   *idecd;

_


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix)
  2004-01-17 13:22 ` [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix) Bartlomiej Zolnierkiewicz
@ 2004-01-17 15:38   ` Sam Ravnborg
  2004-01-17 16:02     ` Bartlomiej Zolnierkiewicz
  2004-01-20  2:01   ` Rusty Russell
  1 sibling, 1 reply; 9+ messages in thread
From: Sam Ravnborg @ 2004-01-17 15:38 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Witold Krecicki, Linux Kernel Mailing List

>  
> +ide-core-objs += ide.o ide-default.o ide-io.o ide-iops.o ide-lib.o \
> +	ide-probe.o ide-taskfile.o

It would be more consistent to use "ide-core-y" since this is
what the following lines are expanded to.

> +
> +ide-core-$(CONFIG_BLK_DEV_CMD640)	+= pci/cmd640.o
Like this line.

	Sam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix)
  2004-01-17 15:38   ` Sam Ravnborg
@ 2004-01-17 16:02     ` Bartlomiej Zolnierkiewicz
  2004-01-18 11:52       ` Arkadiusz Miskiewicz
  0 siblings, 1 reply; 9+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-01-17 16:02 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Witold Krecicki, Linux Kernel Mailing List


On Saturday 17 of January 2004 16:38, Sam Ravnborg wrote:
> > +ide-core-objs += ide.o ide-default.o ide-io.o ide-iops.o ide-lib.o \
> > +	ide-probe.o ide-taskfile.o
>
> It would be more consistent to use "ide-core-y" since this is
> what the following lines are expanded to.
>
> > +
> > +ide-core-$(CONFIG_BLK_DEV_CMD640)	+= pci/cmd640.o
>
> Like this line.

Yep, thanks!


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix)
  2004-01-17 16:02     ` Bartlomiej Zolnierkiewicz
@ 2004-01-18 11:52       ` Arkadiusz Miskiewicz
  2004-01-18 12:25         ` Sam Ravnborg
  2004-01-18 12:56         ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 9+ messages in thread
From: Arkadiusz Miskiewicz @ 2004-01-18 11:52 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Sam Ravnborg, Witold Krecicki, Linux Kernel Mailing List

Dnia sob 17. stycznia 2004 17:02, Bartlomiej Zolnierkiewicz napisał:
> On Saturday 17 of January 2004 16:38, Sam Ravnborg wrote:
> > > +ide-core-objs += ide.o ide-default.o ide-io.o ide-iops.o ide-lib.o \
> > > +	ide-probe.o ide-taskfile.o
> >
> > It would be more consistent to use "ide-core-y" since this is
> > what the following lines are expanded to.
> >
> > > +
> > > +ide-core-$(CONFIG_BLK_DEV_CMD640)	+= pci/cmd640.o
> >
> > Like this line.
>
> Yep, thanks!
Could you send updated patch so we could test it?

Also would be nice if ide-detect name was used instead of ide-generic so it 
will be consistent with 2.4 naming.

ps. patch by Witold Krecicki works for other drivers - I've seen it working - 
but it's hacky anyway.
-- 
Arkadiusz Miśkiewicz    CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix)
  2004-01-18 11:52       ` Arkadiusz Miskiewicz
@ 2004-01-18 12:25         ` Sam Ravnborg
  2004-01-18 12:56         ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 9+ messages in thread
From: Sam Ravnborg @ 2004-01-18 12:25 UTC (permalink / raw)
  To: Arkadiusz Miskiewicz
  Cc: Bartlomiej Zolnierkiewicz, Sam Ravnborg, Witold Krecicki,
	Linux Kernel Mailing List

On Sun, Jan 18, 2004 at 12:52:49PM +0100, Arkadiusz Miskiewicz wrote:
> Dnia sob 17. stycznia 2004 17:02, Bartlomiej Zolnierkiewicz napisa?:
> > On Saturday 17 of January 2004 16:38, Sam Ravnborg wrote:
> > > > +ide-core-objs += ide.o ide-default.o ide-io.o ide-iops.o ide-lib.o \
> > > > +	ide-probe.o ide-taskfile.o
> > >
> > > It would be more consistent to use "ide-core-y" since this is
> > > what the following lines are expanded to.
> > >
> > > > +
> > > > +ide-core-$(CONFIG_BLK_DEV_CMD640)	+= pci/cmd640.o
> > >
> > > Like this line.
> >
> > Yep, thanks!
> Could you send updated patch so we could test it?
The change I requested is cosmetic only. It may have a small impact on
link-order, but that would not make a difference in this case.

	Sam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix)
  2004-01-18 11:52       ` Arkadiusz Miskiewicz
  2004-01-18 12:25         ` Sam Ravnborg
@ 2004-01-18 12:56         ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 9+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-01-18 12:56 UTC (permalink / raw)
  To: Arkadiusz Miskiewicz
  Cc: Sam Ravnborg, Witold Krecicki, Linux Kernel Mailing List

On Sunday 18 of January 2004 12:52, Arkadiusz Miskiewicz wrote:
> Dnia sob 17. stycznia 2004 17:02, Bartlomiej Zolnierkiewicz napisał:
> > On Saturday 17 of January 2004 16:38, Sam Ravnborg wrote:
> > > > +ide-core-objs += ide.o ide-default.o ide-io.o ide-iops.o ide-lib.o \
> > > > +	ide-probe.o ide-taskfile.o
> > >
> > > It would be more consistent to use "ide-core-y" since this is
> > > what the following lines are expanded to.
> > >
> > > > +
> > > > +ide-core-$(CONFIG_BLK_DEV_CMD640)	+= pci/cmd640.o
> > >
> > > Like this line.
> >
> > Yep, thanks!
>
> Could you send updated patch so we could test it?
>
> Also would be nice if ide-detect name was used instead of ide-generic so it
> will be consistent with 2.4 naming.

ide-detect != ide-generic

In 2.4 you have to load ide-detect after loading chipset module.
In 2.6+patch you don't have to load anything after loading chipset module.

ide-detect is used for all chipset modules to probe for drives.
ide-generic is generic/default host driver - you use it only if you don't have
specific modules for your IDE chipsets.

> ps. patch by Witold Krecicki works for other drivers - I've seen it working
> - but it's hacky anyway.

Sure, it works for other *PCI* drivers, but not ie. PPC ones (easy to fix).

--bart


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix)
  2004-01-17 13:22 ` [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix) Bartlomiej Zolnierkiewicz
  2004-01-17 15:38   ` Sam Ravnborg
@ 2004-01-20  2:01   ` Rusty Russell
  2004-01-20 15:45     ` Bartlomiej Zolnierkiewicz
  1 sibling, 1 reply; 9+ messages in thread
From: Rusty Russell @ 2004-01-20  2:01 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Linux Kernel Mailing List

In message <200401171422.06211.bzolnier@elka.pw.edu.pl> you write:
> +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)
> +{
> +}

If you don't want to be unloadable, just don't have a module_exit() at
all.

Thanks,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix)
  2004-01-20  2:01   ` Rusty Russell
@ 2004-01-20 15:45     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 9+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-01-20 15:45 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Linux Kernel Mailing List

On Tuesday 20 of January 2004 03:01, Rusty Russell wrote:
> In message <200401171422.06211.bzolnier@elka.pw.edu.pl> you write:
> > +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)
> > +{
> > +}
>
> If you don't want to be unloadable, just don't have a module_exit() at
> all.

Ok, I will update it later.  Thanks for a hint!
--bart


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-01-20 15:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-17 12:13 [PATCH] modular IDE for 2.6.1 ugly but working fix Witold Krecicki
2004-01-17 13:22 ` [PATCH] fix/improve modular IDE (Re: [PATCH] modular IDE for 2.6.1 ugly but working fix) Bartlomiej Zolnierkiewicz
2004-01-17 15:38   ` Sam Ravnborg
2004-01-17 16:02     ` Bartlomiej Zolnierkiewicz
2004-01-18 11:52       ` Arkadiusz Miskiewicz
2004-01-18 12:25         ` Sam Ravnborg
2004-01-18 12:56         ` Bartlomiej Zolnierkiewicz
2004-01-20  2:01   ` Rusty Russell
2004-01-20 15:45     ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox