1. 11 6月, 2014 1 次提交
  2. 15 11月, 2013 1 次提交
  3. 18 4月, 2013 1 次提交
    • B
      PCI: Remove __must_check from definitions · d67aed63
      Bjorn Helgaas 提交于
      The __must_check (gcc "warn_unused_result") attribute only makes sense
      when compiling the *caller* of the function, so the attribute should
      appear on the declaration in the header file, not on the definition.
      
      The declarations of these functions are already annotated with
      __must_check.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      d67aed63
  4. 16 4月, 2013 2 次提交
  5. 13 1月, 2012 1 次提交
  6. 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
  7. 23 2月, 2010 1 次提交
  8. 05 11月, 2009 1 次提交
  9. 10 9月, 2009 2 次提交
  10. 30 6月, 2009 1 次提交
  11. 17 6月, 2009 2 次提交
  12. 23 10月, 2008 5 次提交
    • A
      PCI: Hotplug core: remove 'name' · 58319b80
      Alex Chiang 提交于
      Now that the PCI core manages the 'name' for each individual
      hotplug driver, and all drivers (except rpaphp) have been converted
      to use hotplug_slot_name(), there is no need for the PCI hotplug
      core to drag around its own copy of name either.
      
      Cc: kristen.c.accardi@intel.com
      Cc: matthew@wil.cx
      Acked-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      58319b80
    • A
      PCI: prevent duplicate slot names · 5fe6cc60
      Alex Chiang 提交于
      Prevent callers of pci_create_slot() from registering slots with
      duplicate names. This condition occurs most often when PCI hotplug
      drivers are loaded on platforms with broken firmware that assigns
      identical names to multiple slots.
      
      We now rename these duplicate slots on behalf of the user.
      
      If firmware assigns the name N to multiple slots, then:
      
      	The first registered slot is assigned N
      	The second registered slot is assigned N-1
      	The third registered slot is assigned N-2
      	etc.
      
      This is the permanent fix mentioned in earlier commits d6a9e9b4 and
      167e782e (shpchp/pciehp: Rename duplicate slot name...).
      
      We take advantage of the new 'hotplug' parameter in pci_create_slot()
      to prevent a slot create/rename race between hotplug drivers and
      detection drivers.
      
      	Scenario A:
      	hotplug driver                  detection driver
      	--------------                  ----------------
      	pci_create_slot(hotplug=set)
      					pci_create_slot(hotplug=NULL)
      
      The hotplug driver creates the slot with its desired name, and then
      releases the semaphore. Now, the detection driver tries to create
      the same slot, but it already exists. We don't care about renaming,
      so return the existing slot.
      
      	Scenario B:
      	hotplug driver                  detection driver
      	--------------                  ----------------
      					pci_create_slot(hotplug=NULL)
      	pci_create_slot(hotplug=set)
      
      The detection driver creates the slot with name "X". Then the hotplug
      driver tries to create the same slot, but wants the name "Y" instead.
      We detect that we're trying to create the same slot and that we also
      want a rename, so rename the slot to "Y" and return.
      
      	Scenario C:
      	hotplug driver                  hotplug driver
      	--------------                  ----------------
      	pci_create_slot(hotplug=set)
      					pci_create_slot(hotplug=set)
      
      Two separate hotplug drivers are attempting to claim the slot and
      are passing valid hotplug_slot args to pci_create_slot(). We detect
      that the slot already has a ->hotplug callback, prevent a rename,
      and return -EBUSY.
      
      Cc: kristen.c.accardi@intel.com
      Cc: matthew@wil.cx
      Acked-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      5fe6cc60
    • K
      PCI Hotplug: serialize pci_hp_register and pci_hp_deregister · 95cb9093
      Kenji Kaneshige 提交于
      Convert the pci_hotplug_slot_list_lock, which only protected the
      list of hotplug slots, to a pci_hp_mutex which now protects both
      interfaces.
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      95cb9093
    • A
      PCI: update pci_create_slot() to take a 'hotplug' param · 828f3768
      Alex Chiang 提交于
      Slot detection drivers can co-exist with hotplug drivers. The names
      of the detected/claimed slots may be different depending on module
      load order.
      
      For legacy reasons, we need to allow hotplug drivers to override
      the slot name if a detection driver is loaded first (and they find
      the same slots).
      
      Creating and overriding slot names should be an atomic operation,
      otherwise you get a locking nightmare as various drivers race to
      call pci_create_slot().
      
      pci_create_slot() is already serialized by grabbing the pci_bus_sem.
      
      We update the API and add a 'hotplug' param, which is:
      
      	set if the caller is a hotplug driver
      	NULL if the caller is a detection driver
      
      pci_create_slot() does not actually use the 'hotplug' parameter in this
      patch. A later patch will add the logic that uses it.
      
      Cc: kristen.c.accardi@intel.com
      Cc: matthew@wil.cx
      Acked-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      828f3768
    • A
      PCI Hotplug core: add 'name' param pci_hp_register interface · 1359f270
      Alex Chiang 提交于
      Update pci_hp_register() to take a const char *name parameter.
      
      The motivation for this is to clean up the individual hotplug
      drivers so that each one does not have to manage its own name.
      The PCI core should be the place where we manage the name.
      
      We update the interface and all callsites first, in a
      "no functional change" manner, and clean up the drivers later.
      
      Cc: kristen.c.accardi@intel.com
      Acked-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Reviewed-by: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      1359f270
  13. 21 10月, 2008 2 次提交
  14. 26 6月, 2008 2 次提交
  15. 11 6月, 2008 2 次提交
    • A
      PCI: ACPI PCI slot detection driver · 8344b568
      Alex Chiang 提交于
      Detect all physical PCI slots as described by ACPI, and create entries in
      /sys/bus/pci/slots/.
      
      Not all physical slots are hotpluggable, and the acpiphp module does not
      detect them.  Now we know the physical PCI geography of our system, without
      caring about hotplug.
      
      [kaneshige.kenji@jp.fujitsu.com: export-kobject_rename-for-pci_hotplug_core]
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Acked-by: NGreg KH <greg@kroah.com>
      [akpm@linux-foundation.org: build fix]
      [akpm@linux-foundation.org: fix build with CONFIG_DMI=n]
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Acked-by: NLen Brown <len.brown@intel.com>
      Acked-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      8344b568
    • A
      PCI: introduce pci_slot · f46753c5
      Alex Chiang 提交于
      Currently, /sys/bus/pci/slots/ only exposes hotplug attributes when a
      hotplug driver is loaded, but PCI slots have attributes such as address,
      speed, width, etc.  that are not related to hotplug at all.
      
      Introduce pci_slot as the primary data structure and kobject model.
      Hotplug attributes described in hotplug_slot become a secondary
      structure associated with the pci_slot.
      
      This patch only creates the infrastructure that allows the separation of
      PCI slot attributes and hotplug attributes.  In this patch, the PCI
      hotplug core remains the only user of this infrastructure, and thus,
      /sys/bus/pci/slots/ will still only become populated when a hotplug
      driver is loaded.
      
      A later patch in this series will add a second user of this new
      infrastructure and demonstrate splitting the task of exposing pci_slot
      attributes from hotplug_slot attributes.
      
        - Make pci_slot the primary sysfs entity. hotplug_slot becomes a
          subsidiary structure.
          o pci_create_slot() creates and registers a slot with the PCI core
          o pci_slot_add_hotplug() gives it hotplug capability
      
        - Change the prototype of pci_hp_register() to take the bus and
          slot number (on parent bus) as parameters.
      
        - Remove all the ->get_address methods since this functionality is
          now handled by pci_slot directly.
      
      [achiang@hp.com: rpaphp-correctly-pci_hp_register-for-empty-pci-slots]
      Tested-by: NBadari Pulavarty <pbadari@us.ibm.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [akpm@linux-foundation.org: build fix]
      [akpm@linux-foundation.org: make headers_check happy]
      [akpm@linux-foundation.org: nuther build fix]
      [akpm@linux-foundation.org: fix typo in #include]
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NMatthew Wilcox <matthew@wil.cx>
      Cc: Greg KH <greg@kroah.com>
      Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Acked-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      f46753c5
  16. 28 5月, 2008 1 次提交
    • K
      pci hotplug core: add check of duplicate slot name · a86161b3
      Kenji Kaneshige 提交于
      Fix the following errors reported by Jan C. Nordholz in
      http://bugzilla.kernel.org/show_bug.cgi?id=10751.
      
      kobject_add_internal failed for 2 with -EEXIST, don't try to register things with the same name in the same directory.
      Pid: 1, comm: swapper Tainted: G        W 2.6.26-rc3 #1
       [<c0266980>] kobject_add_internal+0x140/0x190
       [<c0266afd>] kobject_init_and_add+0x2d/0x40
       [<c027bc91>] pci_hp_register+0x81/0x2f0
       [<c027fd07>] pciehp_probe+0x1a7/0x470
       [<c01b3b84>] sysfs_add_one+0x44/0xa0
       [<c01b3c1f>] sysfs_addrm_start+0x3f/0xb0
       [<c01b497a>] sysfs_create_link+0x8a/0xf0
       [<c0279570>] pcie_port_probe_service+0x50/0x80
       [<c02e0545>] driver_sysfs_add+0x55/0x70
       [<c02e0662>] driver_probe_device+0x82/0x180
       [<c02e07cc>] __driver_attach+0x6c/0x70
       [<c02dfe0a>] bus_for_each_dev+0x3a/0x60
       [<c05db2d0>] pcied_init+0x0/0x80
       [<c02e04e6>] driver_attach+0x16/0x20
       [<c02e0760>] __driver_attach+0x0/0x70
       [<c02e0341>] bus_add_driver+0x1a1/0x220
       [<c05db2d0>] pcied_init+0x0/0x80
       [<c02e09cd>] driver_register+0x4d/0x120
       [<c05db050>] ibm_acpiphp_init+0x0/0x190
       [<c0125aab>] printk+0x1b/0x20
       [<c05db2d0>] pcied_init+0x0/0x80
       [<c05db2de>] pcied_init+0xe/0x80
       [<c05c751a>] kernel_init+0x10a/0x300
       [<c0120138>] schedule_tail+0x18/0x50
       [<c0103b9a>] ret_from_fork+0x6/0x1c
       [<c05c7410>] kernel_init+0x0/0x300
       [<c05c7410>] kernel_init+0x0/0x300
       [<c010485b>] kernel_thread_helper+0x7/0x1c
       =======================
      pci_hotplug: Unable to register kobject '2'<3>pciehp: pci_hp_register failed with error -22
      
      Slot with the same name can be registered multiple times if shpchp or
      pciehp driver is loaded after acpiphp is loaded because ACPI based
      hotplug driver and Native OS hotplug driver trying to handle the same
      physical slot. In this case, current pci_hotplug core will call
      kobject_init_and_add() muliple time with the same name. This is the
      cause of this problem. To fix this problem, this patch adds the check
      into pci_hp_register() to see if the slot with the same name.
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NKristen Carlson Accardi <kristen.c.accardi@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      a86161b3
  17. 21 4月, 2008 1 次提交
  18. 02 2月, 2008 2 次提交
  19. 25 1月, 2008 5 次提交
  20. 16 10月, 2007 1 次提交
  21. 13 10月, 2007 1 次提交
  22. 09 5月, 2007 1 次提交
  23. 03 5月, 2007 1 次提交
  24. 19 10月, 2006 2 次提交