mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] 2.5.46 reloading a block device module doesn't probe devices
@ 2002-11-07 20:51 Dave Olien
  2002-11-07 22:02 ` Mike Anderson
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Olien @ 2002-11-07 20:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: mochel



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


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

* Re: [BUG] 2.5.46 reloading a block device module doesn't probe devices
  2002-11-07 20:51 [BUG] 2.5.46 reloading a block device module doesn't probe devices Dave Olien
@ 2002-11-07 22:02 ` Mike Anderson
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Anderson @ 2002-11-07 22:02 UTC (permalink / raw)
  To: Dave Olien; +Cc: linux-kernel, mochel

Dave Olien [dmo@osdl.org] wrote:
> 
> 
> 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
andmike@us.ibm.com

 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
+++ edited/drivers/base/bus.c	Wed Nov  6 22:06:39 2002
@@ -209,8 +209,10 @@
 				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
+++ edited/drivers/base/core.c	Wed Nov  6 13:07:47 2002
@@ -173,8 +173,6 @@
 		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
+++ edited/drivers/base/driver.c	Wed Nov  6 21:41:48 2002
@@ -127,6 +127,8 @@
 	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);
 }
 

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

end of thread, other threads:[~2002-11-07 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-07 20:51 [BUG] 2.5.46 reloading a block device module doesn't probe devices Dave Olien
2002-11-07 22:02 ` Mike Anderson

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

all inboxes | Powered by JetHome®