mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* PCI hotplug w/ drivers linked statically vs. module
@ 2003-03-07  3:27 Stephen Cameron
  2003-03-10 17:50 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Cameron @ 2003-03-07  3:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: michael.ni, greg, torben.mathiasen


HI,

I noticed a difference in behavior with PCI hotplug, depending
on if the driver in questino is loaded as a module, or statically
linked.

For example, the tg3 driver, hot-unplugging, then hot-replugging
works seemingly well if the driver is a module, but differnetly (poorly?)
if it is statically linked. (eth0 disappears and does not come
back.)

Trying out the cciss driver (with some changes), we did get it to
hot-unplug and hot-replug while it was in use as md multipath
primary path (failed over to secondary path ok upon hot-unplug.)  
and then i/o was able to be done on the old card when the card was 
re-plugged.  This was with the driver linked as a module.
(BTW, how can you tell the md driver that a failed path
is now good again?)

However, if we linked statically, then we still get requests
coming into the driver after the hba[] structure is deallocated.
(resulting in a panic). This does not seem to happen if the driver 
is linked as a module.

Looking at the tg3 driver, it doesn't seem to take any precautions
in it's remove function.  (Maybe there are things in the upper layers
there for e.g. pcmcia, that make it work...)

Note, in no case that I can see is the modular driver _unloaded_.
(e.g. there are other same type  boards in the system which continue to
function after one board is hot-unplugged) 

So why the difference in behavior with PCI hotplug and drivers
linked statically vs. as a module?

Thanks,

-- steve


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

* Re: PCI hotplug w/ drivers linked statically vs. module
  2003-03-07  3:27 PCI hotplug w/ drivers linked statically vs. module Stephen Cameron
@ 2003-03-10 17:50 ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2003-03-10 17:50 UTC (permalink / raw)
  To: Stephen Cameron; +Cc: linux-kernel, michael.ni, torben.mathiasen

On Fri, Mar 07, 2003 at 09:27:40AM +0600, Stephen Cameron wrote:
> 
> I noticed a difference in behavior with PCI hotplug, depending
> on if the driver in questino is loaded as a module, or statically
> linked.
> 
> For example, the tg3 driver, hot-unplugging, then hot-replugging
> works seemingly well if the driver is a module, but differnetly (poorly?)
> if it is statically linked. (eth0 disappears and does not come
> back.)

Is the tg3 driver's remove() function actually being called?  In looking
at the driver, the callback is declared properly, so it should be
present when building the driver into the kernel.

> So why the difference in behavior with PCI hotplug and drivers
> linked statically vs. as a module?

I have no idea right now, sorry.
Only thing I can think of is you have to mark the remove function as
"__devexit" and not "__exit" to make sure the function is really there
if CONFIG_HOTPLUG is enabled.

thanks,

greg k-h

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

* RE: PCI hotplug w/ drivers linked statically vs. module
@ 2003-03-07 15:29 Cameron, Steve
  0 siblings, 0 replies; 3+ messages in thread
From: Cameron, Steve @ 2003-03-07 15:29 UTC (permalink / raw)
  To: Cameron, Steve, linux-kernel; +Cc: Ni, Michael, greg, Mathiasen, Torben

I forgot to mention, this was with a 2.4.21-pre5 kernel
(plus a few changes) -- steve

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

end of thread, other threads:[~2003-03-10 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-07  3:27 PCI hotplug w/ drivers linked statically vs. module Stephen Cameron
2003-03-10 17:50 ` Greg KH
2003-03-07 15:29 Cameron, Steve

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®