1. 08 12月, 2006 3 次提交
  2. 17 11月, 2006 1 次提交
    • Z
      [PATCH] ipmi: use platform_device_add() instead of platform_device_register()... · b48f5457
      Zhang, Yanmin 提交于
      [PATCH] ipmi: use platform_device_add() instead of platform_device_register() to register device allocated dynamically
      
      I got below warning when running 2.6.19-rc5-mm1 on my ia64 machine.
      
      WARNING at lib/kobject.c:172 kobject_init()
      
      Call Trace:
       [<a0000001000137c0>] show_stack+0x40/0xa0
                                      sp=e0000002ff9f7bc0 bsp=e0000002ff9f0d10
       [<a000000100013850>] dump_stack+0x30/0x60
                                      sp=e0000002ff9f7d90 bsp=e0000002ff9f0cf8
       [<a000000100407bb0>] kobject_init+0x90/0x160
                                      sp=e0000002ff9f7d90 bsp=e0000002ff9f0cd0
       [<a0000001005ae080>] device_initialize+0x40/0x1c0
                                      sp=e0000002ff9f7da0 bsp=e0000002ff9f0cb0
       [<a0000001005b88c0>] platform_device_register+0x20/0x60
                                      sp=e0000002ff9f7dd0 bsp=e0000002ff9f0c90
       [<a000000100592560>] try_smi_init+0xbc0/0x11e0
                                      sp=e0000002ff9f7dd0 bsp=e0000002ff9f0c50
       [<a000000100594900>] init_ipmi_si+0xaa0/0x12e0
                                      sp=e0000002ff9f7de0 bsp=e0000002ff9f0bd8
       [<a000000100009910>] init+0x350/0x780
                                      sp=e0000002ff9f7e00 bsp=e0000002ff9f0ba8
       [<a000000100011d30>] kernel_thread_helper+0x30/0x60
                                      sp=e0000002ff9f7e30 bsp=e0000002ff9f0b80
       [<a0000001000090c0>] start_kernel_thread+0x20/0x40
                                      sp=e0000002ff9f7e30 bsp=e0000002ff9f0b80
      WARNING at lib/kobject.c:172 kobject_init()
      
      Call Trace:
       [<a0000001000137c0>] show_stack+0x40/0xa0
                                      sp=e0000002ff9f7b40 bsp=e0000002ff9f0db0
       [<a000000100013850>] dump_stack+0x30/0x60
                                      sp=e0000002ff9f7d10 bsp=e0000002ff9f0d98
       [<a000000100407bb0>] kobject_init+0x90/0x160
                                      sp=e0000002ff9f7d10 bsp=e0000002ff9f0d70
       [<a0000001005ae080>] device_initialize+0x40/0x1c0
                                      sp=e0000002ff9f7d20 bsp=e0000002ff9f0d50
       [<a0000001005b88c0>] platform_device_register+0x20/0x60
                                      sp=e0000002ff9f7d50 bsp=e0000002ff9f0d30
       [<a00000010058ac00>] ipmi_register_smi+0xcc0/0x18e0
                                      sp=e0000002ff9f7d50 bsp=e0000002ff9f0c90
       [<a000000100592600>] try_smi_init+0xc60/0x11e0
                                      sp=e0000002ff9f7dd0 bsp=e0000002ff9f0c50
       [<a000000100594900>] init_ipmi_si+0xaa0/0x12e0
                                      sp=e0000002ff9f7de0 bsp=e0000002ff9f0bd8
       [<a000000100009910>] init+0x350/0x780
                                      sp=e0000002ff9f7e00 bsp=e0000002ff9f0ba8
       [<a000000100011d30>] kernel_thread_helper+0x30/0x60
                                      sp=e0000002ff9f7e30 bsp=e0000002ff9f0b80
       [<a0000001000090c0>] start_kernel_thread+0x20/0x40
                                      sp=e0000002ff9f7e30 bsp=e0000002ff9f0b80
      
      The root cause is the device struct is initialized twice.
      
      If the device is allocated dynamically by platform_device_alloc,
      platform_device_alloc will initialize struct device, then,
      platform_device_add should be used to register the device.
      
      The difference between platform_device_register and platform_device_add is
      platform_device_register will initiate the device while platform_device_add
      won't.
      Signed-off-by: NZhang Yanmin <yanmin.zhang@intel.com>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b48f5457
  3. 13 11月, 2006 1 次提交
  4. 09 11月, 2006 2 次提交
  5. 12 10月, 2006 1 次提交
  6. 01 10月, 2006 1 次提交
  7. 02 9月, 2006 1 次提交
  8. 01 7月, 2006 1 次提交
  9. 29 6月, 2006 1 次提交
  10. 28 6月, 2006 1 次提交
  11. 27 6月, 2006 2 次提交
  12. 11 4月, 2006 1 次提交
  13. 01 4月, 2006 3 次提交
  14. 28 3月, 2006 1 次提交
    • A
      [PATCH] Notifier chain update: API changes · e041c683
      Alan Stern 提交于
      The kernel's implementation of notifier chains is unsafe.  There is no
      protection against entries being added to or removed from a chain while the
      chain is in use.  The issues were discussed in this thread:
      
          http://marc.theaimsgroup.com/?l=linux-kernel&m=113018709002036&w=2
      
      We noticed that notifier chains in the kernel fall into two basic usage
      classes:
      
      	"Blocking" chains are always called from a process context
      	and the callout routines are allowed to sleep;
      
      	"Atomic" chains can be called from an atomic context and
      	the callout routines are not allowed to sleep.
      
      We decided to codify this distinction and make it part of the API.  Therefore
      this set of patches introduces three new, parallel APIs: one for blocking
      notifiers, one for atomic notifiers, and one for "raw" notifiers (which is
      really just the old API under a new name).  New kinds of data structures are
      used for the heads of the chains, and new routines are defined for
      registration, unregistration, and calling a chain.  The three APIs are
      explained in include/linux/notifier.h and their implementation is in
      kernel/sys.c.
      
      With atomic and blocking chains, the implementation guarantees that the chain
      links will not be corrupted and that chain callers will not get messed up by
      entries being added or removed.  For raw chains the implementation provides no
      guarantees at all; users of this API must provide their own protections.  (The
      idea was that situations may come up where the assumptions of the atomic and
      blocking APIs are not appropriate, so it should be possible for users to
      handle these things in their own way.)
      
      There are some limitations, which should not be too hard to live with.  For
      atomic/blocking chains, registration and unregistration must always be done in
      a process context since the chain is protected by a mutex/rwsem.  Also, a
      callout routine for a non-raw chain must not try to register or unregister
      entries on its own chain.  (This did happen in a couple of places and the code
      had to be changed to avoid it.)
      
      Since atomic chains may be called from within an NMI handler, they cannot use
      spinlocks for synchronization.  Instead we use RCU.  The overhead falls almost
      entirely in the unregister routine, which is okay since unregistration is much
      less frequent that calling a chain.
      
      Here is the list of chains that we adjusted and their classifications.  None
      of them use the raw API, so for the moment it is only a placeholder.
      
        ATOMIC CHAINS
        -------------
      arch/i386/kernel/traps.c:		i386die_chain
      arch/ia64/kernel/traps.c:		ia64die_chain
      arch/powerpc/kernel/traps.c:		powerpc_die_chain
      arch/sparc64/kernel/traps.c:		sparc64die_chain
      arch/x86_64/kernel/traps.c:		die_chain
      drivers/char/ipmi/ipmi_si_intf.c:	xaction_notifier_list
      kernel/panic.c:				panic_notifier_list
      kernel/profile.c:			task_free_notifier
      net/bluetooth/hci_core.c:		hci_notifier
      net/ipv4/netfilter/ip_conntrack_core.c:	ip_conntrack_chain
      net/ipv4/netfilter/ip_conntrack_core.c:	ip_conntrack_expect_chain
      net/ipv6/addrconf.c:			inet6addr_chain
      net/netfilter/nf_conntrack_core.c:	nf_conntrack_chain
      net/netfilter/nf_conntrack_core.c:	nf_conntrack_expect_chain
      net/netlink/af_netlink.c:		netlink_chain
      
        BLOCKING CHAINS
        ---------------
      arch/powerpc/platforms/pseries/reconfig.c:	pSeries_reconfig_chain
      arch/s390/kernel/process.c:		idle_chain
      arch/x86_64/kernel/process.c		idle_notifier
      drivers/base/memory.c:			memory_chain
      drivers/cpufreq/cpufreq.c		cpufreq_policy_notifier_list
      drivers/cpufreq/cpufreq.c		cpufreq_transition_notifier_list
      drivers/macintosh/adb.c:		adb_client_list
      drivers/macintosh/via-pmu.c		sleep_notifier_list
      drivers/macintosh/via-pmu68k.c		sleep_notifier_list
      drivers/macintosh/windfarm_core.c	wf_client_list
      drivers/usb/core/notify.c		usb_notifier_list
      drivers/video/fbmem.c			fb_notifier_list
      kernel/cpu.c				cpu_chain
      kernel/module.c				module_notify_list
      kernel/profile.c			munmap_notifier
      kernel/profile.c			task_exit_notifier
      kernel/sys.c				reboot_notifier_list
      net/core/dev.c				netdev_chain
      net/decnet/dn_dev.c:			dnaddr_chain
      net/ipv4/devinet.c:			inetaddr_chain
      
      It's possible that some of these classifications are wrong.  If they are,
      please let us know or submit a patch to fix them.  Note that any chain that
      gets called very frequently should be atomic, because the rwsem read-locking
      used for blocking chains is very likely to incur cache misses on SMP systems.
      (However, if the chain's callout routines may sleep then the chain cannot be
      atomic.)
      
      The patch set was written by Alan Stern and Chandra Seetharaman, incorporating
      material written by Keith Owens and suggestions from Paul McKenney and Andrew
      Morton.
      
      [jes@sgi.com: restructure the notifier chain initialization macros]
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NChandra Seetharaman <sekharan@us.ibm.com>
      Signed-off-by: NJes Sorensen <jes@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e041c683
  15. 27 3月, 2006 2 次提交
  16. 26 3月, 2006 1 次提交
  17. 04 2月, 2006 1 次提交
    • J
      [PATCH] IPMI: fix issues reported by Coverity in ipmi_msghandler.c · 12fc1d7b
      Jayachandran C 提交于
      While looking to the report by Coverity in ipmi, I came across the
      following issue:
      
      The IPMI message handler relies on two defines which are the same -one in
      include/linux/ipmi.h
      #define IPMI_NUM_CHANNELS 0x10
      and one in drivers/char/ipmi/ipmi_msghandler.
      #define IPMI_MAX_CHANNELS       16
      These are used interchangeably in ipmi_msghandler.c, but since the array
      addr->channels[] is of size IPMI_MAX_CHANNELS, I have made a patch that
      uses IPMI_MAX_CHANNELS for all the checks for the array index.
      
      NOTE: You could probably remove the line that defines IPMI_NUM_CHANNELS
      from ipmi.h, or move IPMI_MAX_CHANNELS to ipmi.h
      Signed-off-by: NJayachandran C. <c.jayachandran@gmail.com>
      Cc: Corey Minyard <minyard@acm.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      12fc1d7b
  18. 11 1月, 2006 1 次提交
    • A
      [PATCH] ipmi: fix compile errors with PROC_FS=n · be4f1bb2
      Adrian Bunk 提交于
      ...
        CC [M]  drivers/char/ipmi/ipmi_msghandler.o
      drivers/char/ipmi/ipmi_msghandler.c:3301: `proc_ipmi_root' undeclared here (not in a function)
      drivers/char/ipmi/ipmi_msghandler.c:3301: initializer element is not constant
      drivers/char/ipmi/ipmi_msghandler.c:3301: (near initialization for `__ksymtab_proc_ipmi_root.value')
      drivers/char/ipmi/ipmi_msghandler.c:1535: warning: `ipmb_file_read_proc' defined but not used
      drivers/char/ipmi/ipmi_msghandler.c:1551: warning: `version_file_read_proc' defined but not used
      drivers/char/ipmi/ipmi_msghandler.c:1561: warning: `stat_file_read_proc' defined but not used
      ...
        CC [M]  drivers/char/ipmi/ipmi_poweroff.o
      drivers/char/ipmi/ipmi_poweroff.c: In function `ipmi_poweroff_init':
      drivers/char/ipmi/ipmi_poweroff.c:616: warning: implicit declaration of function `unregister_sysctl_table'
      drivers/char/ipmi/ipmi_poweroff.c:616: `ipmi_table_header' undeclared (first use in this function)
      drivers/char/ipmi/ipmi_poweroff.c:616: (Each undeclared identifier is reported only once
      drivers/char/ipmi/ipmi_poweroff.c:616: for each function it appears in.)
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Cc: Corey Minyard <minyard@acm.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      be4f1bb2
  19. 07 1月, 2006 1 次提交
  20. 13 12月, 2005 1 次提交
  21. 16 11月, 2005 1 次提交
  22. 12 11月, 2005 1 次提交
  23. 07 11月, 2005 2 次提交
  24. 24 9月, 2005 1 次提交
  25. 08 9月, 2005 5 次提交
  26. 29 6月, 2005 1 次提交
  27. 24 6月, 2005 2 次提交