31 Jul, 2010

1 commit


30 Mar, 2010

1 commit

  • …it 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: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

17 Dec, 2009

1 commit

  • Changing occurrences of variants of PCI-X and PCIe to the PCI-SIG
    terms listed in the "Trademark and Logo Usage Guidelines".
    http://www.pcisig.com/developers/procedures/logos/Trademark_and_Logo_Usage_Guidelines_updated_112206.pdf

    Patch is limited to drivers/pci/ and changes concern comments only.

    Signed-off-by: Stefan Assmann
    Signed-off-by: Jesse Barnes

    Stefan Assmann
     

25 Nov, 2009

1 commit


05 Nov, 2009

1 commit

  • Added the pci_get_domain_and_slot_function which is analogous to
    pci_get_bus_and_slot. It returns a pci_dev given a domain (segment) number,
    bus number, and devnr. Like pci_get_bus_and_slot,
    pci_get_domain_bus_and_slot holds a reference to the returned pci_dev.

    Converted pci_get_bus_and_slot to a wrapper that calls
    pci_get_domain_bus_and_slot with the domain hard-coded to 0.

    This routine was patterned off code suggested by Bjorn Helgaas.

    Acked-by: Huang Ying
    Signed-off-by: Andrew Patterson
    Signed-off-by: Jesse Barnes

    Andrew Patterson
     

10 Sep, 2009

1 commit

  • Shut off the long standing

    linux/drivers/pci/search.c:144: warning: 'pci_find_device' is deprecated (declared at linux/drivers/pci/search.c:136)
    linux/drivers/pci/search.c:144: warning: 'pci_find_device' is deprecated (declared at linux/drivers/pci/search.c:136)

    warnings that appear on every build when CONFIG_PCI_LEGACY is enabled.

    gcc warns for the use in EXPORT_SYMBOL

    I moved these to a separate file and disabled the warning in the Makefile for that file.

    Signed-off-by: Andi Kleen
    Signed-off-by: Jesse Barnes

    Andi Kleen
     

17 Jun, 2009

1 commit


12 Jun, 2009

1 commit


21 Mar, 2009

1 commit

  • Current pci_find_upstream_pcie_bridge() has a wrong assumption that
    pci_bus->self is NULL on the root pci bus. But it might not true on
    some platforms. Because of this wrong assumption, current
    pci_find_upstream_pcie_bridge() might cause endless loop. We must
    check pci_bus->parent instead.

    Signed-off-by: Kenji Kaneshige
    Signed-off-by: Jesse Barnes

    Kenji Kaneshige
     

23 Oct, 2008

1 commit

  • pci_get_subsys() will decrement the reference count of the device that
    it starts searching from. Unfortunately, the pci_find_device() interface
    will already have decremented the reference count of the device earlier,
    so the device will end up losing all reference counts and be freed.

    We can fix this by incrementing the reference count of the device to
    start searching from before calling pci_get_subsys().

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Jesse Barnes

    Matthew Wilcox
     

17 Sep, 2008

1 commit

  • pci_get_subsys() changed in 2.6.26 so that the from pointer is modified
    when the call is being invoked, so fix up the 'const' marking of it that
    the compiler is complaining about.

    Reported-by: Rufus & Azrael
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Jesse Barnes

    Greg KH
     

22 Aug, 2008

1 commit

  • Alex Chiang and Matthew Wilcox pointed out that pci_get_dev_by_id() does
    not properly decrement the reference on the from pointer if it is
    present, like the documentation for the function states it will.

    It fixes a pretty bad leak in the hotplug core (we were leaking an
    entire struct pci_dev for each function of each offlined card, the first
    time around; subsequent onlines/offlines were ok).

    Cc: Matthew Wilcox
    Cc: stable
    Tested-by: Alex Chiang
    Acked-by: Alex Chiang
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Jesse Barnes

    Greg KH
     

21 Apr, 2008

3 commits

  • This cleans up the search.c file, now using the pci list of devices that
    are created for the driver core, instead of relying on our separate list
    of devices. It's better to use the functions already created for this
    kind of thing, instead of rolling our own all the time.

    This work is done in anticipation of getting rid of that second list of
    pci devices all together.

    And it ends up saving code, always a nice benefit.

    This also removes one compiler warning for when CONFIG_PCI_LEGACY is
    enabled as we no longer internally use the deprecated functions anymore.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This removes the pci_get_device_reverse function as there should not be
    any need to walk pci devices backwards anymore. All users of this call
    are now gone from the tree, so it is safe to remove it.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • No one is using this function anymore for quite some time, so remove it.
    Everyone calls pci_dev_present() instead anyway...

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

06 Nov, 2007

1 commit


22 Oct, 2007

1 commit

  • When devices are under a p2p bridge, upstream transactions get replaced by the
    device id of the bridge as it owns the PCIE transaction. Hence its necessary
    to setup translations on behalf of the bridge as well. Due to this limitation
    all devices under a p2p share the same domain in a DMAR.

    We just cache the type of device, if its a native PCIe device
    or not for later use.

    [akpm@linux-foundation.org: BUG_ON -> WARN_ON+recover]
    Signed-off-by: Anil S Keshavamurthy
    Cc: Andi Kleen
    Cc: Peter Zijlstra
    Cc: Muli Ben-Yehuda
    Cc: "Siddha, Suresh B"
    Cc: Arjan van de Ven
    Cc: Ashok Raj
    Cc: "David S. Miller"
    Cc: Christoph Lameter
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keshavamurthy, Anil S
     

17 Jul, 2007

1 commit


12 Jul, 2007

1 commit

  • Limit pci_get_bus_and_slot() to domain (segment) 0 since domain is not
    specified in the function call and defaulting to domain 0 is the only
    reasonable thing to do (rather than returning a device from some other
    unknown domain).

    Signed-off-by: Randy Dunlap
    Acked-by: H. Peter Anvin
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     

01 Jun, 2007

1 commit

  • pci_find_present() is only matching the last item in the list of ids.

    The break after the match is found only escapes the for loop, not the
    while loop, so found gets reset to NULL on the next pass.

    Signed-off-by: Ben Gardner
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Ben Gardner
     

03 May, 2007

1 commit

  • Functions marked __devinit will be removed after kernel init. But being
    exported they are potentially called by a module much later.

    So the safer choice seems to be to keep the function even in the non
    CONFIG_HOTPLUG case.

    This silence the follwoing section mismatch warnings:
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_add_device from __ksymtab_gpl between '__ksymtab_pci_bus_add_device' (at offset 0x20) and '__ksymtab_pci_walk_bus'
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_create_bus from __ksymtab_gpl between '__ksymtab_pci_create_bus' (at offset 0x40) and '__ksymtab_pci_stop_bus_device'
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_max_busnr from __ksymtab_gpl between '__ksymtab_pci_bus_max_busnr' (at offset 0xc0) and '__ksymtab_pci_assign_resource_fixed'
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_claim_resource from __ksymtab_gpl between '__ksymtab_pci_claim_resource' (at offset 0xe0) and '__ksymtab_pcie_port_bus_type'
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_add_devices from __ksymtab between '__ksymtab_pci_bus_add_devices' (at offset 0x70) and '__ksymtab_pci_bus_alloc_resource'
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_scan_bus_parented from __ksymtab between '__ksymtab_pci_scan_bus_parented' (at offset 0x90) and '__ksymtab_pci_root_buses'
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_assign_resources from __ksymtab between '__ksymtab_pci_bus_assign_resources' (at offset 0x4d0) and '__ksymtab_pci_bus_size_bridges'
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_size_bridges from __ksymtab between '__ksymtab_pci_bus_size_bridges' (at offset 0x4e0) and '__ksymtab_pci_setup_cardbus'

    Signed-off-by: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Sam Ravnborg
     

10 Mar, 2007

1 commit

  • drivers/pci/search.c caused following section mismatch warning
    (if compiled with CONFIG_HOTPLUG=n):

    WARNING: drivers/pci/built-in.o - Section mismatch: reference to .init.text: from .text.pci_find_bus after 'pci_find_bus' (at offset 0x24)

    This was due to pci_find_bus() calling a function marked __devinit.
    Fix was to remove the __devinit from the offending function.

    Signed-off-by: Sam Ravnborg
    Signed-off-by: Greg Kroah-Hartman

    Sam Ravnborg
     

08 Feb, 2007

1 commit


02 Feb, 2007

1 commit

  • Remove these recently-added warnings. They don't tell us anythng very
    interesting and Kumar says "On an embedded PPC reference system I see this
    message 6 times when I've got no cards in the PCI slots."

    Acked-by: Kumar Gala
    Acked-by: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

06 Jan, 2007

1 commit

  • The pci_find_subsys gets called very early by obsolete ide setup parameters.
    This is a bogus call since pci is not initialized yet, so the list is empty.
    But in the mean time, interrupts get enabled by down_read. This can result in
    a kernel panic when the irq controller gets initialized.

    This patch checks if the device list is empty before taking the semaphore, and
    hence will not enable irq's. Furthermore it will inform that it is called
    while pci_devices is empty as a reminder that the ide code needs to be fixed.

    The pci_get_subsys can get called in the same manner, and as such is patched
    in the same manner.

    [akpm@osdl.org: cleanups]
    Signed-off-by: Ard van Breemen
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ard van Breemen
     

21 Dec, 2006

2 commits

  • This patch is designed to fix:
    - Disk eating corruptor on KT7 after resume from RAM
    - VIA IRQ handling
    - VIA fixups for bus lockups after resume from RAM

    The core of this is to add a table of resume fixups run at resume time.
    We need to do this for a variety of boards and features, but particularly
    we need to do this to get various critical VIA fixups done on resume.

    The second part of the problem is to handle VIA IRQ number rules which
    are a bit odd and need special handling for PIC interrupts. Various
    patches broke various boxes and while this one may not be perfect
    (hopefully it is) it ensures the workaround is applied to the right
    devices only.

    From: Jean Delvare

    Now that PCI quirks are replayed on software resume, we can safely
    re-enable the Asus SMBus unhiding quirk even when software suspend support
    is enabled.

    [akpm@osdl.org: fix const warning]
    Signed-off-by: Alan Cox
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     
  • This works like pci_dev_present but instead of returning boolean returns
    the matching pci_device_id entry. This makes it much more useful. Code
    bloat is basically nil as the old boolean function is rewritten in terms of
    the new one.

    This will be used by the updated VIA PCI quirks for one

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

19 Oct, 2006

1 commit

  • In order to finish converting to pci_get_* interfaces we need to add a couple
    of bits of missing functionaility

    pci_get_bus_and_slot() provides the equivalent to pci_find_slot()
    (pci_get_slot is already taken as a name for something similar but not the
    same)

    pci_get_device_reverse() is the equivalent of pci_find_device_reverse but
    refcounting

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

04 Aug, 2006

1 commit


01 Aug, 2006

1 commit


22 Jun, 2006

1 commit

  • pci_walk_bus has a race with pci_destroy_dev. When cb is called
    in pci_walk_bus, pci_destroy_dev might unlink the dev pointed by next.
    Later on in the next loop, pointer next becomes NULL and cause
    kernel panic.

    Below patch against 2.6.17-rc4 fixes it by changing pci_bus_lock (spin_lock)
    to pci_bus_sem (rw_semaphore).

    Signed-off-by: Zhang Yanmin
    Signed-off-by: Greg Kroah-Hartman

    Zhang Yanmin
     

24 Mar, 2006

1 commit


07 Jul, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds