linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.0-test6: a few __init bugs
@ 2003-09-29 21:58 Robert T. Johnson
  2003-09-29 22:07 ` Pavel Machek
  2003-09-29 22:11 ` Greg KH
  0 siblings, 2 replies; 8+ messages in thread
From: Robert T. Johnson @ 2003-09-29 21:58 UTC (permalink / raw)
  To: Linux Kernel; +Cc: scottm, greg, rgooch, mingo, pavel

Here are several places where non-__init functions call __init functions
or reference __init data.  I've looked at all of them and believe that
they are all either legitimate bugs or opportunities to declare more
code as __init to save memory.  Thanks for looking over these, and sorry
if I've made any mistakes.

Best,
Rob

P.S. All these bugs were found with Cqual, the bug-finding tool
developed by Jeff Foster, John Kodumal, and many others, and available
at http://www.cs.umd.edu/~jfoster/cqual/, although the currently
released version of cqual only has primitive support for 
__init bug-finding.

Linux 2.6.0-test6:

** Possible bug:
** drivers/pci/quirks.c:asus_hides_smbus_hostbridge()                  (__init)
   in table: drivers/pci/quirks.c:pci_fixups                           (not __init)
     indirect call f->hook(): drivers/pci/quirks.c:pci_do_fixups()     (not __init)
       called by: drivers/pci/quirks.c:pci_fixup_device()              (not __init)
         called by: drivers/pci/probe.c:pci_scan_slot()                (not __init)
           called by lots of hotplug enable() functions, e.g.
           drivers/pci/hotplug/ibmphp_core.c:ibm_configure_device()    (not __init)
             called by drivers/pci/hotplug/ibmphp_core.c:enable_slot() (not __init)

Note: It looks like this may have been originally designed to initialize the
      pci bus at startup, but has been re-used in the hotplug code, which means it 
      can be run after the __init segments have gone away.

Fix: Delete all the __init declarations on the quirks hooks.


** Code can be declared __init:
** arch/i386/kernel/cpu/mtrr/generic.c:get_fixed_ranges()              (__init)
     called by: arch/i386/kernel/cpu/mtrr/generic.c:get_mtrr_state()   (not __init)
       only caller: arch/i386/kernel/cpu/mtrr/main.c:init_other_cpus() (not __init)
         only caller: arch/i386/kernel/cpu/mtrr/main.c:mtrr_init()     (__init)
Fix: Declare get_mtrr_state()  __init
Fix: Declare init_other_cpus() __init


** Code can be declared __init:
** arch/i386/kernel/io_apic.c:io_apic_set_pci_routing() (not __init)
     all callers are __init
Fix: Declare io_apic_set_pci_routing() __init


** Code should be declared __init?
** name_to_dev_t()                                                     (__init)
     called by kernel/power/swsusp.c:read_suspend_image()              (not __init)
       called by kernel/power/swsusp.c:software_resume()               (not __init)
Fix: declare read_suspend_image() __init
Fix: declare software_resume() __init

Note: read_suspend_image() in pmdisk.c is declared __init.



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

end of thread, other threads:[~2003-10-01 21:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-29 21:58 2.6.0-test6: a few __init bugs Robert T. Johnson
2003-09-29 22:07 ` Pavel Machek
2003-09-29 22:11 ` Greg KH
     [not found]   ` <1064946634.5734.106.camel@dooby.cs.berkeley.edu>
     [not found]     ` <20030930191117.GA20054@kroah.com>
2003-09-30 21:20       ` Robert T. Johnson
2003-09-30 21:25         ` Greg KH
2003-09-30 21:42           ` Robert T. Johnson
2003-09-30 22:10             ` Greg KH
2003-10-01 21:26             ` bill davidsen

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).