1. 06 8月, 2010 2 次提交
  2. 22 5月, 2010 7 次提交
  3. 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
  4. 19 3月, 2010 2 次提交
    • R
      driver-core: fix missing kernel-doc in firmware_class · e59817bf
      Randy Dunlap 提交于
      Fix kernel-doc warning in firmware_class.c:
      
      Warning(drivers/base/firmware_class.c:94): No description found for parameter 'attr'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e59817bf
    • J
      sysfs: use sysfs_bin_attr_init in firmware class driver · e1955ca0
      Jiri Kosina 提交于
      Annotate dynamic sysfs attribute in fw_setup_device(). This gets
      rid of the following lockdep warning:
      
      bnx2 0000:08:00.0: firmware: requesting bnx2/bnx2-mips-06-5.0.0.j6.fw
      BUG: key ffff880008293470 not in .data!
      ------------[ cut here ]------------
      WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0x562/0x620()
      Modules linked in: bnx2(+) sg tpm_bios floppy rtc_lib usb_storage i2c_piix4 joydev button container shpchp i2c_core sr_mod cdrom pci_hotplug usbhid hid ohci_hcd ehci_hcd sd_mod usbcore edd ext3 mbcache jbd fan ata_generic sata_svw pata_serverworks libata scsi_mod thermal processor
      Pid: 1915, comm: work_for_cpu Not tainted 2.6.34-rc1-default #81
      Call Trace:
       [<ffffffff8107c1d2>] ? lockdep_init_map+0x562/0x620
       [<ffffffff81049fd8>] warn_slowpath_common+0x78/0xd0
       [<ffffffff8104a03f>] warn_slowpath_null+0xf/0x20
       [<ffffffff8107c1d2>] lockdep_init_map+0x562/0x620
       [<ffffffff8117a236>] ? sysfs_new_dirent+0x76/0x120
       [<ffffffff8126edb2>] ? put_device+0x12/0x20
       [<ffffffff811797cc>] sysfs_add_file_mode+0x6c/0xd0
       [<ffffffff8117983c>] sysfs_add_file+0xc/0x10
       [<ffffffff8117bf61>] sysfs_create_bin_file+0x21/0x30
       [<ffffffff81279c61>] _request_firmware+0x2f1/0x650
       [<ffffffff8127a04e>] request_firmware+0xe/0x10
       [<ffffffffa01ec19e>] bnx2_init_one+0x8f5/0x177e [bnx2]
       [<ffffffff81389eab>] ? _raw_spin_unlock_irq+0x2b/0x40
       [<ffffffff81040ed9>] ? finish_task_switch+0x69/0x100
       [<ffffffff81040e70>] ? finish_task_switch+0x0/0x100
       [<ffffffff81064b40>] ? do_work_for_cpu+0x0/0x30
       [<ffffffff811e6302>] local_pci_probe+0x12/0x20
       [<ffffffff81064b53>] do_work_for_cpu+0x13/0x30
       [<ffffffff81064b40>] ? do_work_for_cpu+0x0/0x30
       [<ffffffff81068c56>] kthread+0x96/0xa0
       [<ffffffff81003e64>] kernel_thread_helper+0x4/0x10
       [<ffffffff8138a350>] ? restore_args+0x0/0x30
       [<ffffffff81068bc0>] ? kthread+0x0/0xa0
       [<ffffffff81003e60>] ? kernel_thread_helper+0x0/0x10
      ---[ end trace a2ecee9c9602d195 ]---
      
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      e1955ca0
  5. 08 3月, 2010 3 次提交
  6. 12 12月, 2009 1 次提交
    • J
      firmware_class: make request_firmware_nowait more useful · 9ebfbd45
      Johannes Berg 提交于
      Unfortunately, one cannot hold on to the struct firmware
      that request_firmware_nowait() hands off, which is needed
      in some cases. Allow this by requiring the callback to
      free it (via release_firmware).
      
      Additionally, give it a gfp_t parameter -- all the current
      users call it from a GFP_KERNEL context so the GFP_ATOMIC
      isn't necessary. This also marks an API break which is
      useful in a sense, although that is obviously not the
      primary purpose of this change.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Cc: Ming Lei <tom.leiming@gmail.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: David Woodhouse <David.Woodhouse@intel.com>
      Cc: Pavel Roskin <proski@gnu.org>
      Cc: Abhay Salunke <abhay_salunke@dell.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9ebfbd45
  7. 29 7月, 2009 1 次提交
  8. 13 7月, 2009 1 次提交
  9. 09 7月, 2009 1 次提交
  10. 16 6月, 2009 4 次提交
  11. 15 5月, 2009 1 次提交
    • D
      firmware: speed up request_firmware(), v3 · 6e03a201
      David Woodhouse 提交于
      Rather than calling vmalloc() repeatedly to grow the firmware image as
      we receive data from userspace, just allocate and fill individual pages.
      Then vmap() the whole lot in one go when we're done.
      
      A quick test with a 337KiB iwlagn firmware shows the time taken for
      request_firmware() going from ~32ms to ~5ms after I apply this patch.
      
      [v2: define PAGE_KERNEL_RO as PAGE_KERNEL where necessary, use min_t()]
      [v3: kunmap() takes the struct page *, not the virtual address]
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Tested-by: NSachin Sant <sachinp@in.ibm.com>
      6e03a201
  12. 25 3月, 2009 1 次提交
    • M
      Driver core: implement uevent suppress in kobject · f67f129e
      Ming Lei 提交于
      This patch implements uevent suppress in kobject and removes it
      from struct device, based on the following ideas:
      
      1,Uevent sending should be one attribute of kobject, so suppressing it
      in kobject layer is more natural than in device layer. By this way,
      we can do it for other objects embedded with kobject.
      
      2,It may save several bytes for each instance of struct device.(On my
      omap3(32bit ARM) based box, can save 8bytes per device object)
      
      This patch also introduces dev_set|get_uevent_suppress() helpers to
      set and query uevent_suppress attribute in case to help kobject
      as private part of struct device in future.
      
      [This version is against the latest driver-core patch set of Greg,please
      ignore the last version.]
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f67f129e
  13. 07 1月, 2009 1 次提交
  14. 17 10月, 2008 1 次提交
  15. 26 7月, 2008 1 次提交
  16. 10 7月, 2008 2 次提交
    • D
      firmware: allow firmware files to be built into kernel image · 5658c769
      David Woodhouse 提交于
      Some drivers have their own hacks to bypass the kernel's firmware loader
      and build their firmware into the kernel; this renders those unnecessary.
      
      Other drivers don't use the firmware loader at all, because they always
      want the firmware to be available. This allows them to start using the
      firmware loader.
      
      A third set of drivers already use the firmware loader, but can't be
      used without help from userspace, which sometimes requires an initrd.
      This allows them to work in a static kernel.
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      5658c769
    • D
      firmware: make fw->data const · b7a39bd0
      David Woodhouse 提交于
      In preparation for supporting firmware files linked into the static
      kernel, make fw->data const to ensure that users aren't modifying it (so
      that we can pass a pointer to the original in-kernel copy, rather than
      having to copy it).
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      b7a39bd0
  17. 29 4月, 2008 1 次提交
  18. 20 4月, 2008 1 次提交
  19. 08 2月, 2008 1 次提交
  20. 13 10月, 2007 2 次提交
  21. 31 7月, 2007 1 次提交
  22. 12 7月, 2007 2 次提交
    • Z
      sysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes · 91a69029
      Zhang Rui 提交于
      Well, first of all, I don't want to change so many files either.
      
      What I do:
      Adding a new parameter "struct bin_attribute *" in the
      .read/.write methods for the sysfs binary attributes.
      
      In fact, only the four lines change in fs/sysfs/bin.c and
      include/linux/sysfs.h do the real work.
      But I have to update all the files that use binary attributes
      to make them compatible with the new .read and .write methods.
      I'm not sure if I missed any. :(
      
      Why I do this:
      For a sysfs attribute, we can get a pointer pointing to the
      struct attribute in the .show/.store method,
      while we can't do this for the binary attributes.
      I don't know why this is different, but this does make it not
      so handy to use the binary attributes as the regular ones.
      So I think this patch is reasonable. :)
      
      Who benefits from it:
      The patch that exposes ACPI tables in sysfs
      requires such an improvement.
      All the table binary attributes share the same .read method.
      Parameter "struct bin_attribute *" is used to get
      the table signature and instance number which are used to
      distinguish different ACPI table binary attributes.
      
      Without this parameter, we need to offer different .read methods
      for different ACPI table binary attributes.
      This is impossible as there are various ACPI tables on different
      platforms, and we don't know what they are until they are loaded.
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      91a69029
    • T
      sysfs: kill unnecessary attribute->owner · 7b595756
      Tejun Heo 提交于
      sysfs is now completely out of driver/module lifetime game.  After
      deletion, a sysfs node doesn't access anything outside sysfs proper,
      so there's no reason to hold onto the attribute owners.  Note that
      often the wrong modules were accounted for as owners leading to
      accessing removed modules.
      
      This patch kills now unnecessary attribute->owner.  Note that with
      this change, userland holding a sysfs node does not prevent the
      backing module from being unloaded.
      
      For more info regarding lifetime rule cleanup, please read the
      following message.
      
        http://article.gmane.org/gmane.linux.kernel/510293
      
      (tweaked by Greg to not delete the field just yet, to make it easier to
      merge things properly.)
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7b595756
  23. 09 6月, 2007 1 次提交
  24. 28 4月, 2007 1 次提交