2.5.46 reloading a block device module doesn't probe devices

2.5.46 reloading a block device module doesn't probe devices

Post by Dave Olie » Fri, 08 Nov 2002 23:00:06



I just converted the DAC960 driver in 2.5.46 to use the pci_register_driver()
to discover devices.

I've been experimenting loading the DAC960 driver module, unloading
the module, and then loading it again.  I get curious behavior.
The load, unload seem to work fine.

The reload also APPEARS to succeed. The insmod command completes
with a successful status.

But the second loading of the driver never calls the driver's probe routines.
I added printfs, and determined that the module_init() function
DOES get called the second time.  But a printf in the probe() routine
doesn't show up the second time.

Has there been a patch recently for this problem?

Thanks!

Dave Olien

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.46 reloading a block device module doesn't probe devices

Post by Mike Anderso » Sat, 09 Nov 2002 00:10:11



> I just converted the DAC960 driver in 2.5.46 to use the pci_register_driver()
> to discover devices.

> I've been experimenting loading the DAC960 driver module, unloading
> the module, and then loading it again.  I get curious behavior.
> The load, unload seem to work fine.

> The reload also APPEARS to succeed. The insmod command completes
> with a successful status.

> But the second loading of the driver never calls the driver's probe routines.
> I added printfs, and determined that the module_init() function
> DOES get called the second time.  But a printf in the probe() routine
> doesn't show up the second time.

> Has there been a patch recently for this problem?

Dave,

In scsi we where having issues of insmod / rmmod not cleaning up sysfs
correctly resulting in secondary insmod problems and shutdown oops.

The problems where:
 - If no probe routine than a device is attach, but error is returned
   allowing more than one attach.
 - Parent always +2 on device_register.
 - driver_unregister lacks full cleanup.

The patch below contains a few workarounds patmans and I have been using
to get our scsi insmod / rmmod plus shutdown working. Mochel has been
offline for a few days so I have not got any feedback from him on the
correctness.  YMMV.

-andmike
--
Michael Anderson

 bus.c    |    4 +++-
 core.c   |    2 --
 driver.c |    2 ++
 3 files changed, 5 insertions(+), 3 deletions(-)
------

--- 1.22/drivers/base/bus.c     Thu Oct 31 08:20:23 2002

                                attach(dev);
                        else
                                dev->driver = NULL;
-               } else
+               } else  {
                        attach(dev);
+                       error = 0;
+               }
        }
        return error;
 }
--- 1.50/drivers/base/core.c    Thu Oct 31 08:20:23 2002

                return -EINVAL;

        device_initialize(dev);
-       if (dev->parent)
-               get_device(dev->parent);
        error = device_add(dev);
        if (error && dev->parent)
                put_device(dev->parent);
--- 1.14/drivers/base/driver.c  Wed Oct 30 16:35:48 2002

        drv->present = 0;
        spin_unlock(&device_lock);
        pr_debug("driver %s:%s: unregistering\n",drv->bus->name,drv->name);
+       bus_remove_driver(drv);
+       kobject_unregister(&drv->kobj);
        put_driver(drv);
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. 2.5.46 -- can't build ide as modules

There are unresolved symbols on when building the IDE subsystem as
modules:

CONFIG_IDE=m
CONFIG_BLK_DEV_IDE=m
CONFIG_BLK_DEV_IDEDISK=m
CONFIG_BLK_DEV_IDECD=m
CONFIG_BLK_DEV_IDEFLOPPY=m
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_BLK_DEV_GENERIC=y
CONFIG_BLK_DEV_IDEDMA=y
CONFIG_BLK_DEV_ADMA=y
CONFIG_BLK_DEV_PIIX=y
CONFIG_BLK_DEV_IDE_MODES=y

depmod -ae output:

depmod: *** Unresolved symbols in
/lib/modules/2.5.45/kernel/drivers/ide/ide-disk.o
depmod:         proc_ide_read_geometry
depmod: *** Unresolved symbols in
/lib/modules/2.5.45/kernel/drivers/ide/ide-floppy.o
depmod:         proc_ide_read_geometry
depmod: *** Unresolved symbols in
/lib/modules/2.5.45/kernel/drivers/ide/ide-probe.o
depmod:         do_ide_request
depmod:         ide_add_generic_settings
depmod:         ide_bus_type
depmod:         create_proc_ide_interfaces
depmod: *** Unresolved symbols in
/lib/modules/2.5.45/kernel/drivers/ide/ide.o
depmod:         ide_release_dma
depmod:         ide_add_proc_entries
depmod:         ide_scan_pcibus
depmod:         proc_ide_read_capacity
depmod:         proc_ide_create
depmod:         ide_remove_proc_entries
depmod:         destroy_proc_ide_drives
depmod:         proc_ide_destroy
depmod:         create_proc_ide_interfaces
depmod: *** Unresolved symbols in
/lib/modules/2.5.45/kernel/fs/binfmt_aout.o
depmod:         ptrace_notify
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Athlon systems?

3. 2.5.46: epoll ep_insert doesn't wake waiters if events exist

4. NIS question

5. Patch?: 2.5.46/drivers/block/genhd.c - static allocation of gendisks

6. What's left over.

7. 2.5.46-mm2 a.out as module

8. Remote printing problem

9. Module loader against 2.5.46: Summary

10. 2.5.46 - missing symbol from binfmt_aout built as a module

11. 2.5.46 make modules fail

12. Module loader against 2.5.46: 1/9

13. 2.5.46 won't boot with root=/dev/hda5, does with /dev/ide.../part5