Re: [PATCH] call drv->shutdown at rmmod

From: Randy.Dunlap (rddunlap_at_osdl.org)
Date: 08/14/03

  • Next message: John Levon: "Re: [PATCH] Make modules work in Linus' tree on ARM"
    Date:	Thu, 14 Aug 2003 09:47:33 -0700
    To: ebiederm@xmission.com (Eric W. Biederman)
    
    

    On 14 Aug 2003 10:26:47 -0600 ebiederm@xmission.com (Eric W. Biederman) wrote:

    | Patrick Mochel <mochel@osdl.org> writes:
    |
    | > > At the kexec BOF at OSDL there was some discussion on calling the
    | > > device shutdown method at module remove time, in addition to calling
    | > > it during reboot. The driver was the observation that the primary
    | > > source of problems in booting linux from linux are drivers with bad
    | > > or missing drv->shutdown() routines. The hope is this will increase
    | > > the testing so people can get it right and kexec can become more
    | > > useful. In addition to making normal reboots more reliable.
    | > >
    | > > The following patch is an implementation of that idea it calls drv->shutdown()
    | >
    | > > before calling drv->remove(). If drv->shutdown() is implemented.
    | >
    | > I like the idea behind the patch, but we shouldn't be calling it
    | > unconditionally. We're bound to run into some suprises that could really
    | > kill us this late in the 2.6 game.
    | >
    | > I do think it should go in, as long as there is a flag telling the core
    | > whether or not to call shutdown for that particular device. I think it
    | > could also be extended to include a power state, so the core could suspend
    | > the device before removing the module.
    |
    | Assuming the device driver can get a device out of the suspend state
    | when the module is loaded. This has been one of the biggest problem areas
    | with the e100 driver. It's init code cannot bring the device out of a low
    | power state.
    |
    | > The default would always be 'Do Nothing', but with a per-device sysfs
    | > file, a developer/user/gui app could be used to set the policy from user
    | > space.
    |
    | Possibly. But this is getting complicated. And while I do support things
    | being complicated enough to handle the problem this part of the API feels
    | like it is excessively complicated. Which is why I was trying to simply
    | it by always calling shutdown on a device before we remove it.

    Can it just be a (kernel hacking/debug) CONFIG_DRIVER_SHUTDOWN build
    option?

    --
    ~Randy
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: John Levon: "Re: [PATCH] Make modules work in Linus' tree on ARM"

    Relevant Pages

    • [PATCH] call drv->shutdown at rmmod
      ... At the kexec BOF at OSDL there was some discussion on calling the ... device shutdown method at module remove time, ... The driver was the observation that the primary ... +shutdown is called to quiescent a device before a reboot, ...
      (Linux-Kernel)
    • Re: [PATCH] call drv->shutdown at rmmod
      ... > At the kexec BOF at OSDL there was some discussion on calling the ... > device shutdown method at module remove time, in addition to calling ... And having shutdown maybe called before remove ...
      (Linux-Kernel)
    • Re: How to call function from driver in inline assembler
      ... It seems that in calling by this way must be prepared ebx register? ... Or not possible to call other functions than are part of calling driver? ... Yes I agree with you that using inline _asm is not very effective ... push 0x48c ...
      (microsoft.public.development.device.drivers)
    • Interpreting ERROR!!! Calling xxx_SetProcPermissions in Wince 6.0 with platman cepermon tool
      ... viewed by all clients - display drivers, dshow filters, etc. ... To implement this, I wrapped the hardware libraries in a device driver, ... Calling xxx_SetProcPermissions ...
      (microsoft.public.windowsce.platbuilder)
    • Re: [PATCH] call drv->shutdown at rmmod
      ... Patrick Mochel writes: ... >> device shutdown method at module remove time, in addition to calling ... > could also be extended to include a power state, ... Assuming the device driver can get a device out of the suspend state ...
      (Linux-Kernel)