04 Nov, 2008

3 commits

  • pci_mmap_fits() returns the wrong answer if the sysfs resource file size
    is not a multiple of the page size. vm_end and vm_start are already
    page-aligned, so size - start < nr, causing mmap() to return EINVAL.

    Signed-off-by: Ed Swierk
    Signed-off-by: Andrew Morton
    Signed-off-by: Jesse Barnes

    Ed Swierk
     
  • Fix pci/rom.c kernel-doc function notation:

    Warning(drivers/pci/rom.c:110): Excess function parameter or struct member 'return' description in 'pci_map_rom'
    Warning(drivers/pci/rom.c:177): Excess function parameter or struct member 'return' description in 'pci_map_rom_copy'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Jesse Barnes

    Randy Dunlap
     
  • VPD quirks need to be called after the VPD capability is initialized.
    Since VPD initialization now runs after pci_fixup_header (due to the
    capabilities consolidation), VPD quirks should be done at
    pci_fixup_final stage correspondingly.

    Tested-by: Eric Dumazet
    Signed-off-by: Yu Zhao
    Signed-off-by: Jesse Barnes

    Yu Zhao
     

31 Oct, 2008

1 commit


25 Oct, 2008

2 commits

  • ACPI Warning (nseval-0168): Insufficient arguments - method [_OSC] needs 5, found 4 [20080926]
    ACPI Warning (nspredef-0252): \_SB_.PCI0._OSC: Parameter count mismatch - ASL declared 5, expected 4 [20080926]
    ACPI Error (nspredef-0163): \_SB_.PCI0._OSC: Missing expected return value [20080926]
    BUG: unable to handle kernel NULL pointer dereference at 00000000
    IP: [] acpi_run_osc+0xa1/0x170

    Signed-off-by: Rafael J. Wysocki
    Tested-by: James Bottomley
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     
  • On Thu, Oct 23, 2008 at 04:09:52PM -0700, Alexander Beregalov wrote:
    > arch/x86/kernel/built-in.o: In function `iommu_setup':
    > pci-dma.c:(.init.text+0x36ad): undefined reference to `forbid_dac'
    > pci-dma.c:(.init.text+0x36cc): undefined reference to `forbid_dac'
    > pci-dma.c:(.init.text+0x3711): undefined reference to `forbid_dac

    This patch partially reverts a patch to add IOMMU support to ia64. The
    forbid_dac variable was incorrectly moved to quirks.c, which isn't built
    when PCI is disabled.

    Tested-by: "Alexander Beregalov"
    Acked-by: FUJITA Tomonori
    Signed-off-by: Fenghua Yu
    Signed-off-by: Jesse Barnes

    Fenghua Yu
     

24 Oct, 2008

10 commits

  • Fix printk format warning:

    drivers/pci/hotplug/acpiphp_ibm.c:207: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'long long unsigned int'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • This cleanup removes the resource assignment in pci_read_bridge_bases()
    since it has taken care by pci_alloc_child_bus() when allocating the bus:

    /* Set up default resource pointers and names.. */
    for (i = 0; i < PCI_BRIDGE_RES_NUM; i++) {
    child->resource[i] = &bridge->resource[PCI_BRIDGE_RESOURCES+i];
    child->resource[i]->name = child->name;
    }

    Signed-off-by: Yu Zhao
    Signed-off-by: Jesse Barnes

    Zhao, Yu
     
  • This patch refines messages in shpchp module. The main changes are as
    follows:

    - remove the trailing "."
    - remove __func__ as much as possible
    - capitalize the first letter of messages
    - show PCI device address including its domain

    Signed-off-by: Taku Izumi
    Signed-off-by: Jesse Barnes

    Taku Izumi
     
  • This patch replaces printks within shpchp module with dev_printks.

    Signed-off-by: Taku Izumi
    Signed-off-by: Jesse Barnes

    Taku Izumi
     
  • We're getting a lot of storage drivers blamed for interrupt misrouting
    issues. This patch provides a standard way of reporting the problem
    ... and, if possible, correcting it.

    Signed-off-by: James Bottomley
    Signed-off-by: Jesse Barnes

    James Bottomley
     
  • This patch refines messages in pciehp module. The main changes are as
    follows:

    - remove the trailing "."
    - remove __func__ as much as possible
    - capitalize the first letter of messages
    - show PCI device address including its domain

    Signed-off-by: Taku Izumi
    Signed-off-by: Jesse Barnes

    Taku Izumi
     
  • The original ARI support code has a compatibility problem with non-ARI
    devices. If a device doesn't support ARI, turning on ARI forwarding on
    its upper level bridge will cause undefined behavior.

    This fix turns on ARI forwarding only when the subordinate devices
    support it.

    Tested-by: Suresh Siddha
    Signed-off-by: Yu Zhao
    Signed-off-by: Jesse Barnes

    Zhao, Yu
     
  • The following patch fixes the regression in 2.6.27 that causes kernel
    NULL pointer dereference at cpqphp driver probe time. This patch should
    be backported to the .27 stable series.

    Seems to have been introduced by
    f46753c5e354b857b20ab8e0fe7b2579831dc369.

    The root cause of this problem seems that cpqphp driver calls
    pci_hp_register() wrongly. In current implementation, cpqphp driver
    passes 'ctrl->pci_dev->subordinate' as a second parameter for
    pci_hp_register(). But because hotplug slots and it's hotplug controller
    (exists as a pci funcion) are on the same bus, it should be
    'ctrl->pci_dev->bus' instead.

    Cc:
    Tested-by: Ingo Molnar
    Signed-off-by: Kenji Kaneshige
    Signed-off-by: Jesse Barnes

    Kenji Kaneshige
     
  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (123 commits)
    dock: make dock driver not a module
    ACPI: fix ia64 build warning
    ACPI: hack around sysfs warning with link order
    ACPI suspend: fix build warning when CONFIG_ACPI_SLEEP=n
    intel_menlo: fix build warning
    panasonic-laptop: fix build
    ACPICA: Update version to 20080926
    ACPICA: Add support for zero-length buffer-to-string conversions
    ACPICA: New: Validation for predefined ACPI methods/objects
    ACPICA: Fix for implicit return compatibility
    ACPICA: Fixed a couple memory leaks associated with "implicit return"
    ACPICA: Optimize buffer allocation procedure
    ACPICA: Fix possible memory leak, error exit path
    ACPICA: Fix fault after mem allocation failure in AML parser
    ACPICA: Remove unused ACPI register bit definition
    ACPICA: Update version to 20080829
    ACPICA: Fix possible memory leak in acpi_ns_get_external_pathname
    ACPICA: Cleanup for internal Reference Object
    ACPICA: Update comments - no functional changes
    ACPICA: Update for Reference ACPI_OPERAND_OBJECT
    ...

    Linus Torvalds
     
  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (32 commits)
    PCI hotplug: fix logic in Compaq hotplug controller bus speed setup
    PCI: don't export linux/io.h from pci.h
    PCI: PCI_QUIRKS depends on PCI
    PCI hotplug: pciehp: poll data link layer link active
    PCI hotplug: pciehp: fix possible memory leak in pcie_init
    PCI: Workaround invalid P2P bridge bus numbers
    PCI Hotplug: fakephp: add duplicate slot name debugging
    PCI: Hotplug core: remove 'name'
    PCI: shcphp: remove 'name' parameter
    PCI: SGI Hotplug: stop managing bss_hotplug_slot->name
    PCI: rpaphp: kmalloc/kfree slot->name directly
    PCI: pciehp: remove 'name' parameter
    PCI: ibmphp: stop managing hotplug_slot->name
    PCI: fakephp: remove 'name' parameter
    PCI, PCI Hotplug: introduce slot_name helpers
    PCI: cpqphp: stop managing hotplug_slot->name
    PCI: cpci_hotplug: stop managing hotplug_slot->name
    PCI: acpiphp: remove 'name' parameter
    PCI: prevent duplicate slot names
    PCI Hotplug: serialize pci_hp_register and pci_hp_deregister
    ...

    Linus Torvalds
     

23 Oct, 2008

24 commits

  • Conflicts:
    MAINTAINERS
    arch/x86/kernel/acpi/boot.c
    arch/x86/kernel/acpi/sleep.c
    drivers/acpi/Kconfig
    drivers/pnp/Makefile
    drivers/pnp/quirks.c

    Signed-off-by: Len Brown

    Len Brown
     
  • Conflicts:
    drivers/acpi/bay.c
    drivers/acpi/dock.c
    drivers/ata/libata-acpi.c

    Signed-off-by: Len Brown

    Len Brown
     
  • Conflicts:
    drivers/acpi/osl.c

    Signed-off-by: Len Brown

    Len Brown
     
  • The pattern !E && !E->fld is nonsensical. The patch below updates this
    according to the assumption that && should be ||. But perhaps another
    solution was intended.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @disable and_comm@
    expression E;
    identifier fld;
    @@

    - !E && !E->fld
    + !E || !E->fld
    //

    Signed-off-by: Julia Lawall
    Reviewed-by: Matthew Wilcox
    Signed-off-by: Andrew Morton
    Signed-off-by: Jesse Barnes

    Julia Lawall
     
  • This patch adds polling mechanism for Data Link Layer Link Active bit
    after turning power on, instead of waiting for 1000 msec. This reduces
    reduce the unnecessary long wait.

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

    Kenji Kaneshige
     
  • Fix the error paths in pcie_init to avoid leaking memory.

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

    Kenji Kaneshige
     
  • Some firmware fail to properly configure P2P bridges, leaving them
    with invalid bus numbers. In some cases, this happens on some embedded
    4xx boards as the result of the kernel allocating different bus space
    than the firmware does to host bridges while not setting
    pcibios_assign_all_busses() for various reasons. In other cases, it can
    just be bogus firmware.

    This adds some sanity checking to the PCI probing code. If a bridge is
    found whose primary bus number doesn't match the bus it's sitting on,
    or whose secondary bus number not strictly above it's primary bus
    number, then the bridge bus numbers are deconfigured in the first pass
    of pci_scan_bridge() to be re-assigned in the second pass.

    Tested-by: "Ayman El-Khashab"
    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Jesse Barnes

    Benjamin Herrenschmidt
     
  • The PCI core now manages slot names on behalf of slot detection
    and slot hotplug drivers, including the handling of duplicate
    slot names.

    We can use the fakephp driver to help test the new functionality.
    Add a 'dup_slots' module param to force fakephp to create multiple
    slots with the same name. We can then verify that the PCI core
    correctly renamed the slots.

    sapphire:/sys/bus/pci/slots # modprobe fakephp dup_slots
    sapphire:/sys/bus/pci/slots # ls
    fake fake-10 fake-3 fake-5 fake-7 fake-9
    fake-1 fake-2 fake-4 fake-6 fake-8

    Cc: kristen.c.accardi@intel.com
    Cc: matthew@wil.cx
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    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: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • We do not need to manage our own name parameter, especially since
    the PCI core can change it on our behalf, in the case of duplicate
    slot names.

    Remove 'name' from shpchp's version of struct slot.

    This change also removes the unused struct task_event from the
    slot structure.

    Cc: kristen.c.accardi@intel.com
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • We no longer need to manage our version of hotplug_slot->name
    since the PCI and hotplug core manage it on our behalf.

    Update the sn_hp_slot_private_alloc() interface to fill in
    the correct name for us, as that function already has all
    the parameters needed to determine the name.

    Cc: kristen.c.accardi@intel.com
    Cc: jpk@sgi.com
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • rpaphp tends to use slot->name directly everywhere, and doesn't
    ever need slot->hotplug_slot->name.

    struct hotplug_slot->name is going away, so convert rpaphp directly
    manipulate its own slot->name everywhere, and don't bother touching
    slot->hotplug_slot->name.

    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • We do not need to manage our own name parameter, especially since
    the PCI core can change it on our behalf, in the case of duplicate
    slot names.

    Remove 'name' from pciehp's version of struct slot, and remove
    unused 'task_list' as well.

    Cc: kristen.c.accardi@intel.com
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • We no longer need to manage our version of hotplug_slot->name
    since the PCI and hotplug core manage it on our behalf.

    Now, we simply advise the PCI core of the name that we would
    like, and let the core take care of the rest.

    Additionally, slightly rearrange the members of struct slot
    so they are naturally aligned to eliminate holes.

    Cc: jbarnes@virtuousgeek.org
    Cc: kristen.c.accardi@intel.com
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • Remove 'name' from fakephp's struct dummy_slot, as the PCI core
    will now manage our slot name for us.

    Cc: jbarnes@virtuousgeek.org
    Cc: kristen.c.accardi@intel.com
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • In preparation for cleaning up the various hotplug drivers
    such that they don't have to manage their own 'name' parameters
    anymore, we provide the following convenience functions:

    pci_slot_name()
    hotplug_slot_name()

    These helpers will be used by individual hotplug drivers.

    Cc: kristen.c.accardi@intel.com
    Cc: matthew@wil.cx
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • We no longer need to manage our version of hotplug_slot->name
    since the PCI and hotplug core manage it on our behalf.

    Now, we simply advise the PCI core of the name that we would
    like, and let the core take care of the rest.

    Cc: jbarnes@virtuousgeek.org
    Cc: kristen.c.accardi@intel.com
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • We no longer need to manage our version of hotplug_slot->name
    since the PCI and hotplug core manage it on our behalf.

    Now, we simply advise the PCI core of the name that we would
    like, and let the core take care of the rest.

    Cc: kristen.c.accardi@intel.com
    Cc: scottm@somanetworks.com
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • We do not need to manage our own name parameter, especially since
    the PCI core can change it on our behalf, in the case of duplicate
    slot names.

    Remove 'name' from acpiphp's version of struct slot.

    Cc: kristen.c.accardi@intel.com
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    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: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • 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: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Kenji Kaneshige
     
  • 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: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • The GPL exported symbol pci_update_slot_number has been renamed to
    pci_renumber_slot. Some of the safety checks were unnecessary and
    were removed.

    Cc: kristen.c.accardi@intel.com
    Cc: matthew@wil.cx
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    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: Kenji Kaneshige
    Reviewed-by: Matthew Wilcox
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang