1. 20 5月, 2010 4 次提交
  2. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  3. 28 1月, 2010 1 次提交
  4. 31 12月, 2009 1 次提交
  5. 30 12月, 2009 2 次提交
  6. 24 12月, 2009 1 次提交
  7. 06 11月, 2009 1 次提交
  8. 29 8月, 2009 1 次提交
  9. 27 8月, 2009 1 次提交
    • C
      wmi: fix kernel panic when stack protection enabled. · f3d83e24
      Costantino Leandro 提交于
      Summary:
      Kernel panic arise when stack protection is enabled, since strncat will
      add a null terminating byte '\0'; So in functions
      like this one (wmi_query_block):
              char wc[4]="WC";
      	....
      	strncat(method, block->object_id, 2);
              ...
      the length of wc should be n+1 (wc[5]) or stack protection
      fault will arise. This is not noticeable when stack protection is
      disabled,but , isn't good either.
      Config used: [CONFIG_CC_STACKPROTECTOR_ALL=y,
      	      CONFIG_CC_STACKPROTECTOR=y]
      
      Panic Trace
      ------------
             .... stack-protector: kernel stack corrupted in : fa7b182c
             2.6.30-rc8-obelisco-generic
             call_trace:
                 [<c04a6c40>] ? panic+0x45/0xd9
      	   [<c012925d>] ? __stack_chk_fail+0x1c/0x40
      	   [<fa7b182c>] ? wmi_query_block+0x15a/0x162 [wmi]
      	   [<fa7b182c>] ? wmi_query_block+0x15a/0x162 [wmi]
      	   [<fa7e7000>] ? acer_wmi_init+0x00/0x61a [acer_wmi]
      	   [<fa7e7135>] ? acer_wmi_init+0x135/0x61a [acer_wmi]
      	   [<c0101159>] ? do_one_initcall+0x50+0x126
      
      Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13514Signed-off-by: NCostantino Leandro <lcostantino@gmail.com>
      Signed-off-by: NCarlos Corbacho <carlos@strangeworlds.co.uk>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f3d83e24
  10. 08 4月, 2009 1 次提交
  11. 16 3月, 2009 1 次提交
  12. 19 12月, 2008 1 次提交
  13. 07 11月, 2008 1 次提交
    • K
      ACPI: struct device - replace bus_id with dev_name(), dev_set_name() · 0794469d
      Kay Sievers 提交于
      This patch is part of a larger patch series which will remove
      the "char bus_id[20]" name string from struct device. The device
      name is managed in the kobject anyway, and without any size
      limitation, and just needlessly copied into "struct device".
      
      To set and read the device name dev_name(dev) and dev_set_name(dev)
      must be used. If your code uses static kobjects, which it shouldn't
      do, "const char *init_name" can be used to statically provide the
      name the registered device should have. At registration time, the
      init_name field is cleared, to enforce the use of dev_name(dev) to
      access the device name at a later time.
      
      We need to get rid of all occurrences of bus_id in the entire tree
      to be able to enable the new interface. Please apply this patch,
      and possibly convert any remaining remaining occurrences of bus_id.
      
      We want to submit a patch to -next, which will remove bus_id from
      "struct device", to find the remaining pieces to convert, and finally
      switch over to the new api, which will remove the 20 bytes array
      and does no longer have a size limitation.
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-Off-By: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      0794469d
  14. 23 10月, 2008 1 次提交
  15. 09 10月, 2008 1 次提交
  16. 15 8月, 2008 1 次提交
  17. 12 3月, 2008 1 次提交
  18. 13 2月, 2008 1 次提交
  19. 12 2月, 2008 1 次提交
    • L
      WMI: initialize wmi_blocks.list even if ACPI is disabled · 96b5a46e
      Linus Torvalds 提交于
      Even if we don't want to register the WMI driver, we should initialize
      the wmi_blocks list to be empty, since we don't want the wmi helper
      functions to oops just because that basic list has not even been set up.
      
      With this, "find_guid()" will happily return "not found" rather than
      oopsing all over the place, and the callers will then just automatically
      return false or AE_NOT_FOUND as appropriate.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      96b5a46e
  20. 06 2月, 2008 1 次提交
    • C
      ACPI: WMI: Add ACPI-WMI mapping driver · bff431e4
      Carlos Corbacho 提交于
      The following is an implementation of the Windows Management
      Instrumentation (WMI) ACPI interface mapper (PNP0C14).
      
      What it does:
      
      Parses the _WDG method and exports functions to process WMI method calls,
      data block query/ set commands (both based on GUID) and does basic event
      handling.
      
      How: WMI presents an in kernel interface here (essentially, a minimal
      wrapper around ACPI)
      
      (const char *guid assume the 36 character ASCII representation of
      a GUID - e.g. 67C3371D-95A3-4C37-BB61-DD47B491DAAB)
      
      wmi_evaluate_method(const char *guid, u8 instance, u32 method_id,
      const struct acpi_buffer *in, struct acpi_buffer *out)
      
      wmi_query_block(const char *guid, u8 instance,
      struct acpi_buffer *out)
      
      wmi_set_block(const char *guid, u38 instance,
      const struct acpi_buffer *in)
      
      wmi_install_notify_handler(acpi_notify_handler handler);
      
      wmi_remove_notify_handler(void);
      
      wmi_get_event_data(u32 event, struct acpi_buffer *out)
      
      wmi_has_guid(const char guid*)
      
      wmi_has_guid() is a helper function to find if a GUID exists or not on the
      system (a quick and easy way for WMI dependant drivers to see if the
      the method/ block they want exists, since GUIDs are supposed to be unique).
      
      Event handling - allow a WMI based driver to register a notifier handler
      for each GUID with WMI. When a notification is sent to a GUID in WMI, the
      handler registered with WMI is then called (it is left to the caller to
      ask for the WMI event data associated with the GUID, if needed).
      
      What it won't do:
      
      Unicode - The MS article[1] calls for converting between ASCII and Unicode (or
      vice versa) if a GUID is marked as "string". This is left up to the calling
      driver.
      
      Handle a MOF[1] - the WMI mapper just exports methods, data and events to
      userspace. MOF handling is down to userspace.
      
      Userspace interface - this will be added later.
      
      [1] http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx
      
      ===
      ChangeLog
      ==
      
      v1 (2007-10-02):
      
      * Initial release
      
      v2 (2007-10-05):
      
      * Cleaned up code - split up super "wmi_evaluate_block" -> each external
        symbol now handles its own ACPI calls, rather than handing off to
        a "super" method (and in turn, is a lot simpler to read)
      * Added a find_guid() symbol - return true if a given GUID exists on
        the system
      * wmi_* functions now return type acpi_status (since they are just
        fancy wrappers around acpi_evaluate_object())
      * Removed extra debug code
      
      v3 (2007-10-27)
      
      * More code clean up - now passes checkpatch.pl
      * Change data block calls - ref MS spec, method ID is not required for
        them, so drop it from the function parameters.
      * Const'ify guid in the function call parameters.
      * Fix _WDG buffer handling - copy the data to our own private structure.
      * Change WMI from tristate to bool - otherwise the external functions are
        not exported in linux/acpi.h if you try to build WMI as a module.
      * Fix more flag comparisons.
      * Add a maintainers entry - since I wrote this, I should take the blame
        for it.
      
      v4 (2007-10-30)
      
      * Add missing brace from after fixing checkpatch errors.
      * Rewrote event handling - allow external drivers to register with WMI to
        handle WMI events
      * Clean up flags and sanitise flag handling
      
      v5 (2007-11-03)
      
      * Add sysfs interface for userspace. Export events over netlink again.
      * Remove module left overs, fully convert to built-in driver.
      * Tweak in-kernel API to use u8 for instance, since this is what the GUID
        blocks use (so instance cannot be greater than u8).
      * Export wmi_get_event_data() for in kernel WMI drivers.
      
      v6 (2007-11-07)
      
      * Split out userspace into a different patch
      
      v7 (2007-11-20)
      
      * Fix driver to handle multiple PNP0C14 devices - store all GUIDs using
        the kernel's built in list functions, and just keep adding to the list
        every time we handle a PNP0C14 devices - GUIDs will always be unique,
        and WMI callers do not know or care about different devices.
      * Change WMI event handler registration to use its' own event handling
        struct; we should not pass an acpi_handle down to any WMI based drivers
        - they should be able to function with only the calls provided in WMI.
      * Update my e-mail address
      
      v8 (2007-11-28)
      
      * Convert back to a module.
      * Update Kconfig to default to building as a module.
      * Remove an erroneous printk.
      * Simply comments for string flag (since we now leave the handling to the
        caller).
      
      v9 (2007-12-07)
      
      * Add back missing MODULE_DEVICE_TABLE for autoloading
      * Checkpatch fixes
      
      v10 (2007-12-12)
      
      * Workaround broken GUIDs declared expensive without a WCxx method.
      * Minor cleanups
      
      v11 (2007-12-17)
      
      * More fixing for broken GUIDs declared expensive without a WCxx method.
      * Add basic EmbeddedControl region handling.
      
      v12 (2007-12-18)
      
      * Changed EC region handling code, as per Alexey's comments.
      
      v13 (2007-12-27)
      
      * Changed event handling so that we can have one event handler registered
        per GUID, as per Matthew Garrett's suggestion.
      
      v14 (2008-01-12)
      
      * Remove ACPI debug statements
      
      v15 (2008-02-01)
      
      * Replace two remaining 'x == NULL' type tests with '!x'
      
      v16 (2008-02-05)
      
      * Change MAINTAINERS entry, as I am not, and never have been, paid to work
        on WMI
      * Remove 'default' line from Kconfig
      Signed-off-by: NCarlos Corbacho <carlos@strangeworlds.co.uk>
      CC: Matthew Garrett <mjg59@srcf.ucam.org>
      CC: Alexey Starikovskiy <aystarik@gmail.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      bff431e4