* Re: [2.6] Modular IDE - problem
2003-12-12 13:38 [2.6] Modular IDE - problem Wojciech 'Sas' Cieciwa
@ 2003-12-12 13:31 ` Bartlomiej Zolnierkiewicz
2003-12-12 23:57 ` [PATCH] " Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-12-12 13:31 UTC (permalink / raw)
To: Wojciech 'Sas' Cieciwa; +Cc: linux-kernel
Can you try this patch for 2.6.0-test11?
On Friday 12 of December 2003 14:38, Wojciech 'Sas' Cieciwa wrote:
> Hi,
> I try to build kernel 2.6.0-test11 + cset-20031209_2107 with modular IDE.
>
> But I got some wornings/errors and kernel doesn't works.
>
> Can anyone look at this and help me ?
>
> Thanx.
> Sas.
drivers/block/ll_rw_blk.c | 2 ++
drivers/ide/Makefile | 14 +++++++-------
drivers/ide/ide-probe-mini.c | 23 +++++++++++++++++++++++
drivers/ide/ide-probe.c | 20 +++++++++++++-------
drivers/ide/ide.c | 32 ++++++--------------------------
include/linux/ide.h | 1 -
6 files changed, 51 insertions(+), 41 deletions(-)
diff -puN drivers/block/ll_rw_blk.c~ide-modules drivers/block/ll_rw_blk.c
--- linux-2.6.0-test11-bart1/drivers/block/ll_rw_blk.c~ide-modules 2003-12-12 14:10:29.605600968 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/block/ll_rw_blk.c 2003-12-12 14:10:50.736388600 +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/ide.c~ide-modules drivers/ide/ide.c
--- linux-2.6.0-test11-bart1/drivers/ide/ide.c~ide-modules 2003-12-12 14:10:13.949980984 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/ide/ide.c 2003-12-12 14:10:13.968978096 +0100
@@ -189,9 +189,6 @@ int noautodma = 1;
#endif
EXPORT_SYMBOL(noautodma);
-EXPORT_SYMBOL(ide_bus_type);
-
-int (*ide_probe)(void);
/*
* This is declared extern in ide.h, for access by other IDE modules:
@@ -443,21 +440,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;
@@ -585,8 +567,6 @@ control_region_busy:
return -EBUSY;
}
-EXPORT_SYMBOL(ide_hwif_request_regions);
-
/**
* ide_hwif_release_regions - free IDE resources
*
@@ -622,8 +602,6 @@ void ide_hwif_release_regions(ide_hwif_t
}
}
-EXPORT_SYMBOL(ide_hwif_release_regions);
-
extern void init_hwif_data(unsigned int index);
/**
@@ -992,6 +970,8 @@ void ide_setup_ports ( hw_regs_t *hw,
EXPORT_SYMBOL(ide_setup_ports);
+extern int ideprobe_init_module(void);
+
/*
* Register an IDE interface, specifying exactly the registers etc
* Set init=1 iff calling before probes have taken place.
@@ -1033,7 +1013,10 @@ found:
hwif->chipset = hw->chipset;
if (!initializing) {
- ide_probe_module();
+#ifdef MODULE
+ if (ideprobe_init_module() == -EBUSY)
+#endif
+ ideprobe_init();
#ifdef CONFIG_PROC_FS
create_proc_ide_interfaces();
#endif
@@ -1517,8 +1500,6 @@ int ata_attach(ide_drive_t *drive)
return 1;
}
-EXPORT_SYMBOL(ata_attach);
-
static int generic_ide_suspend(struct device *dev, u32 state)
{
ide_drive_t *drive = dev->driver_data;
@@ -2564,7 +2545,6 @@ EXPORT_SYMBOL(ide_fops);
*/
EXPORT_SYMBOL(ide_lock);
-EXPORT_SYMBOL(ide_probe);
struct bus_type ide_bus_type = {
.name = "ide",
diff -puN drivers/ide/ide-probe.c~ide-modules drivers/ide/ide-probe.c
--- linux-2.6.0-test11-bart1/drivers/ide/ide-probe.c~ide-modules 2003-12-12 14:10:13.943981896 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/ide/ide-probe.c 2003-12-12 14:10:13.964978704 +0100
@@ -1348,27 +1348,33 @@ 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)
+static int ideprobe_done;
+
+int ideprobe_init_module(void)
{
unsigned int index;
-
+
+ if (ideprobe_done)
+ return -EBUSY;
+
for (index = 0; index < MAX_HWIFS; ++index)
ide_unregister(index);
ideprobe_init();
create_proc_ide_interfaces();
+ ideprobe_done = 1;
return 0;
}
-void cleanup_module (void)
+EXPORT_SYMBOL_GPL(ideprobe_init_module);
+
+void ideprobe_cleanup_module(void)
{
- ide_probe = NULL;
}
-MODULE_LICENSE("GPL");
+
+EXPORT_SYMBOL_GPL(ideprobe_cleanup_module);
#endif /* MODULE */
diff -puN /dev/null drivers/ide/ide-probe-mini.c
--- /dev/null 2003-01-30 11:24:37.000000000 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/ide/ide-probe-mini.c 2003-12-12 14:10:13.965978552 +0100
@@ -0,0 +1,23 @@
+/*
+ * linux/drivers/ide/ide-probe-mini.c Version 1
+ *
+ * Copyright (C) 1994-1998 Linus Torvalds & authors (see below)
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/kmod.h>
+
+#ifdef MODULE
+extern int ideprobe_init_module(void);
+extern void ideprobe_cleanup_module(void);
+
+module_init(ideprobe_init_module);
+module_exit(ideprobe_cleanup_module);
+
+MODULE_LICENSE("GPL");
+#endif
diff -puN drivers/ide/Makefile~ide-modules drivers/ide/Makefile
--- linux-2.6.0-test11-bart1/drivers/ide/Makefile~ide-modules 2003-12-12 14:10:13.946981440 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/ide/Makefile 2003-12-12 14:24:35.073070376 +0100
@@ -10,22 +10,22 @@
# First come modules that register themselves with the core
obj-$(CONFIG_BLK_DEV_IDE) += pci/
+ide-core-objs := ide-io.o ide-probe.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.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
-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) += ide-core.o ide-probe-mini.o
obj-$(CONFIG_BLK_DEV_IDE) += legacy/ ppc/ arm/
obj-$(CONFIG_BLK_DEV_HD) += legacy/
diff -puN include/linux/ide.h~ide-modules include/linux/ide.h
--- linux-2.6.0-test11-bart1/include/linux/ide.h~ide-modules 2003-12-12 14:10:13.960979312 +0100
+++ linux-2.6.0-test11-bart1-root/include/linux/ide.h 2003-12-12 14:10:13.969977944 +0100
@@ -1238,7 +1238,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] 4+ messages in thread
* [2.6] Modular IDE - problem
@ 2003-12-12 13:38 Wojciech 'Sas' Cieciwa
2003-12-12 13:31 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 4+ messages in thread
From: Wojciech 'Sas' Cieciwa @ 2003-12-12 13:38 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 352 bytes --]
Hi,
I try to build kernel 2.6.0-test11 + cset-20031209_2107 with modular IDE.
But I got some wornings/errors and kernel doesn't works.
Can anyone look at this and help me ?
Thanx.
Sas.
--
{Wojciech 'Sas' Cieciwa} {Member of PLD Team }
{e-mail: cieciwa@alpha.zarz.agh.edu.pl, http://www2.zarz.agh.edu.pl/~cieciwa}
[-- Attachment #2: Type: APPLICATION/x-gzip, Size: 487 bytes --]
[-- Attachment #3: Type: APPLICATION/x-gzip, Size: 13168 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Re: [2.6] Modular IDE - problem
2003-12-12 13:31 ` Bartlomiej Zolnierkiewicz
@ 2003-12-12 23:57 ` Bartlomiej Zolnierkiewicz
2003-12-15 19:19 ` Wojciech 'Sas' Cieciwa
0 siblings, 1 reply; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-12-12 23:57 UTC (permalink / raw)
To: Wojciech 'Sas' Cieciwa; +Cc: linux-kernel
On Friday 12 of December 2003 14:31, Bartlomiej Zolnierkiewicz wrote:
> Can you try this patch for 2.6.0-test11?
>
> On Friday 12 of December 2003 14:38, Wojciech 'Sas' Cieciwa wrote:
> > Hi,
> > I try to build kernel 2.6.0-test11 + cset-20031209_2107 with modular IDE.
> >
> > But I got some wornings/errors and kernel doesn't works.
> >
> > Can anyone look at this and help me ?
> >
> > Thanx.
> > Sas.
Corrected version.
- ide-disk.o must be linked after ide.o (affects built-in case not modular)
- move initialize=1 to ide_init_data() to fix generic IDE w/o PCI support
drivers/block/ll_rw_blk.c | 2 ++
drivers/ide/Makefile | 16 ++++++++--------
drivers/ide/ide-probe-mini.c | 23 +++++++++++++++++++++++
drivers/ide/ide-probe.c | 20 +++++++++++++-------
drivers/ide/ide.c | 35 ++++++++---------------------------
include/linux/ide.h | 1 -
6 files changed, 54 insertions(+), 43 deletions(-)
diff -puN drivers/block/ll_rw_blk.c~ide-modules drivers/block/ll_rw_blk.c
--- linux-2.6.0-test11-bart1/drivers/block/ll_rw_blk.c~ide-modules 2003-12-12 23:49:03.361002480 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/block/ll_rw_blk.c 2003-12-12 23:49:03.385998680 +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/ide.c~ide-modules drivers/ide/ide.c
--- linux-2.6.0-test11-bart1/drivers/ide/ide.c~ide-modules 2003-12-12 23:49:03.373000656 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/ide/ide.c 2003-12-12 23:50:10.433805864 +0100
@@ -189,9 +189,6 @@ int noautodma = 1;
#endif
EXPORT_SYMBOL(noautodma);
-EXPORT_SYMBOL(ide_bus_type);
-
-int (*ide_probe)(void);
/*
* This is declared extern in ide.h, for access by other IDE modules:
@@ -313,6 +310,8 @@ static void __init init_ide_data (void)
for (index = 0; index < MAX_HWIFS; ++index)
init_hwif_data(index);
+ initializing = 1;
+
/* Add default hw interfaces */
ide_init_default_hwifs();
@@ -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;
@@ -585,8 +569,6 @@ control_region_busy:
return -EBUSY;
}
-EXPORT_SYMBOL(ide_hwif_request_regions);
-
/**
* ide_hwif_release_regions - free IDE resources
*
@@ -622,8 +604,6 @@ void ide_hwif_release_regions(ide_hwif_t
}
}
-EXPORT_SYMBOL(ide_hwif_release_regions);
-
extern void init_hwif_data(unsigned int index);
/**
@@ -992,6 +972,8 @@ void ide_setup_ports ( hw_regs_t *hw,
EXPORT_SYMBOL(ide_setup_ports);
+extern int ideprobe_init_module(void);
+
/*
* Register an IDE interface, specifying exactly the registers etc
* Set init=1 iff calling before probes have taken place.
@@ -1033,7 +1015,10 @@ found:
hwif->chipset = hw->chipset;
if (!initializing) {
- ide_probe_module();
+#ifdef MODULE
+ if (ideprobe_init_module() == -EBUSY)
+#endif
+ ideprobe_init();
#ifdef CONFIG_PROC_FS
create_proc_ide_interfaces();
#endif
@@ -1517,8 +1502,6 @@ int ata_attach(ide_drive_t *drive)
return 1;
}
-EXPORT_SYMBOL(ata_attach);
-
static int generic_ide_suspend(struct device *dev, u32 state)
{
ide_drive_t *drive = dev->driver_data;
@@ -2558,7 +2541,6 @@ EXPORT_SYMBOL(ide_fops);
*/
EXPORT_SYMBOL(ide_lock);
-EXPORT_SYMBOL(ide_probe);
struct bus_type ide_bus_type = {
.name = "ide",
@@ -2600,7 +2582,6 @@ int __init ide_init (void)
(void)qd65xx_init();
#endif
- initializing = 1;
ide_init_builtin_drivers();
initializing = 0;
diff -puN drivers/ide/ide-probe.c~ide-modules drivers/ide/ide-probe.c
--- linux-2.6.0-test11-bart1/drivers/ide/ide-probe.c~ide-modules 2003-12-12 23:49:03.376000200 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/ide/ide-probe.c 2003-12-12 23:49:03.389998072 +0100
@@ -1348,27 +1348,33 @@ 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)
+static int ideprobe_done;
+
+int ideprobe_init_module(void)
{
unsigned int index;
-
+
+ if (ideprobe_done)
+ return -EBUSY;
+
for (index = 0; index < MAX_HWIFS; ++index)
ide_unregister(index);
ideprobe_init();
create_proc_ide_interfaces();
+ ideprobe_done = 1;
return 0;
}
-void cleanup_module (void)
+EXPORT_SYMBOL_GPL(ideprobe_init_module);
+
+void ideprobe_cleanup_module(void)
{
- ide_probe = NULL;
}
-MODULE_LICENSE("GPL");
+
+EXPORT_SYMBOL_GPL(ideprobe_cleanup_module);
#endif /* MODULE */
diff -puN /dev/null drivers/ide/ide-probe-mini.c
--- /dev/null 2003-01-30 11:24:37.000000000 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/ide/ide-probe-mini.c 2003-12-12 23:49:03.389998072 +0100
@@ -0,0 +1,23 @@
+/*
+ * linux/drivers/ide/ide-probe-mini.c Version 1
+ *
+ * Copyright (C) 1994-1998 Linus Torvalds & authors (see below)
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/kmod.h>
+
+#ifdef MODULE
+extern int ideprobe_init_module(void);
+extern void ideprobe_cleanup_module(void);
+
+module_init(ideprobe_init_module);
+module_exit(ideprobe_cleanup_module);
+
+MODULE_LICENSE("GPL");
+#endif
diff -puN drivers/ide/Makefile~ide-modules drivers/ide/Makefile
--- linux-2.6.0-test11-bart1/drivers/ide/Makefile~ide-modules 2003-12-12 23:49:03.378999744 +0100
+++ linux-2.6.0-test11-bart1-root/drivers/ide/Makefile 2003-12-12 23:50:02.471016392 +0100
@@ -10,22 +10,22 @@
# First come modules that register themselves with the core
obj-$(CONFIG_BLK_DEV_IDE) += pci/
+ide-core-objs := ide-io.o ide-probe.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.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
+
+obj-$(CONFIG_BLK_DEV_IDE) += ide-core.o ide-probe-mini.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_HD) += legacy/
diff -puN include/linux/ide.h~ide-modules include/linux/ide.h
--- linux-2.6.0-test11-bart1/include/linux/ide.h~ide-modules 2003-12-12 23:49:03.381999288 +0100
+++ linux-2.6.0-test11-bart1-root/include/linux/ide.h 2003-12-12 23:49:03.391997768 +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] 4+ messages in thread
* Re: [PATCH] Re: [2.6] Modular IDE - problem
2003-12-12 23:57 ` [PATCH] " Bartlomiej Zolnierkiewicz
@ 2003-12-15 19:19 ` Wojciech 'Sas' Cieciwa
0 siblings, 0 replies; 4+ messages in thread
From: Wojciech 'Sas' Cieciwa @ 2003-12-15 19:19 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel
This patch is broken :(
Sorry, Bart.
When I appaly this,compilation looks OK. but when I try tu run
kernel from initrd with ide_disk I'v got many errors:
ie. unknow ide_fops, ide_raw-taskfile, do_rw_taskfile,
proc_ide_read_geometry ...
and many other ...
Can You look at this ?
Sas.
--
{Wojciech 'Sas' Cieciwa} {Member of PLD Team }
{e-mail: cieciwa@alpha.zarz.agh.edu.pl, http://www2.zarz.agh.edu.pl/~cieciwa}
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-12-15 18:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-12 13:38 [2.6] Modular IDE - problem Wojciech 'Sas' Cieciwa
2003-12-12 13:31 ` Bartlomiej Zolnierkiewicz
2003-12-12 23:57 ` [PATCH] " Bartlomiej Zolnierkiewicz
2003-12-15 19:19 ` Wojciech 'Sas' Cieciwa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).