14 Dec, 2006

1 commit

  • Run this:

    #!/bin/sh
    for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
    echo "De-casting $f..."
    perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
    done

    And then go through and reinstate those cases where code is casting pointers
    to non-pointers.

    And then drop a few hunks which conflicted with outstanding work.

    Cc: Russell King , Ian Molton
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Roman Zippel
    Cc: Geert Uytterhoeven
    Cc: Ralf Baechle
    Cc: Paul Mackerras
    Cc: Kyle McMartin
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Greg KH
    Cc: Jens Axboe
    Cc: Paul Fulghum
    Cc: Alan Cox
    Cc: Karsten Keil
    Cc: Mauro Carvalho Chehab
    Cc: Jeff Garzik
    Cc: James Bottomley
    Cc: Ian Kent
    Cc: Steven French
    Cc: David Woodhouse
    Cc: Neil Brown
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     

11 Dec, 2006

1 commit

  • Refactor Kconfig content to maximize nesting of menus by menuconfig and
    xconfig.

    Tested by simultaneously running `make xconfig` with and without
    patch, and comparing displays.

    Signed-off-by: Don Mullis
    Signed-off-by: Randy Dunlap
    Cc: Sam Ravnborg
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Don Mullis
     

09 Dec, 2006

1 commit


08 Dec, 2006

4 commits

  • * 'intx' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
    PCI MSI: always toggle legacy-INTx-enable bit upon MSI entry/exit

    Linus Torvalds
     
  • The current code (prior to this change) would disable the PCI INTx
    legacy interrupt when enabling MSI... but only on PCI Express. We
    should do this for all MSI devices, for safety's sake.

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     
  • Replace all uses of kmem_cache_t with struct kmem_cache.

    The patch was generated using the following script:

    #!/bin/sh
    #
    # Replace one string by another in all the kernel sources.
    #

    set -e

    for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
    quilt add $file
    sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
    mv /tmp/$$ $file
    quilt refresh
    done

    The script was run like this

    sh replace kmem_cache_t "struct kmem_cache"

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • For node-aware skb allocations we need information about the node in struct
    net_device or struct device. Davem suggested to put it into struct device
    which this patch does.

    In particular:

    - struct device gets a new int numa_node member if CONFIG_NUMA is set
    - there are two new helpers, dev_to_node and set_dev_node to
    transparently deal with the non-numa case
    - for pci devices the node-info is set to the value we get from
    pcibus_to_node.

    Note that for some architectures pcibus_to_node doesn't work yet at the time
    we call it currently. This is harmless and will just mean skb allocations
    aren't node-local on this architectures until the implementation of
    pcibus_to_node on these architectures have been updated (There are patches for
    x86 and x86_64 floating around)

    [akpm@osdl.org: cleanup]
    Signed-off-by: Christoph Hellwig
    Cc: Christoph Lameter
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

06 Dec, 2006

1 commit


05 Dec, 2006

1 commit


04 Dec, 2006

1 commit


02 Dec, 2006

20 commits

  • * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (28 commits)
    PCI: make arch/i386/pci/common.c:pci_bf_sort static
    PCI: ibmphp_pci.c: fix NULL dereference
    pciehp: remove unnecessary pci_disable_msi
    pciehp: remove unnecessary free_irq
    PCI: rpaphp: change device tree examination
    PCI: Change memory allocation for acpiphp slots
    i2c-i801: SMBus patch for Intel ICH9
    PCI: irq: irq and pci_ids patch for Intel ICH9
    PCI: pci_{enable,disable}_device() nestable ports
    PCI: switch pci_{enable,disable}_device() to be nestable
    PCI: arch/i386/kernel/pci-dma.c: ioremap balanced with iounmap
    pci/i386: style cleanups
    PCI: Block on access to temporarily unavailable pci device
    pci: fix __pci_register_driver error handling
    pci: clear osc support flags if no _OSC method
    acpiphp: fix missing acpiphp_glue_exit()
    acpiphp: fix use of list_for_each macro
    Altix: Initial ACPI support - ROM shadowing.
    Altix: SN ACPI hotplug support.
    Altix: Add initial ACPI IO support
    ...

    Linus Torvalds
     
  • The correct order is: NULL check before dereference

    Spotted by the Coverity checker.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Greg Kroah-Hartman

    Adrian Bunk
     
  • This patch fixes the problem that "irq XX: nobody cared" kernel oops
    is reported when pciehp is once rmmoded and insmoded again. The cause
    of this problem is pciehp driver calls pci_disable_msi() at controller
    release time, even though it must be done by PCI Express Port Bus
    driver. This patch removes unnecessary pci_disable_msi() call from
    pciehp driver.

    Signed-off-by: Kenji Kaneshige
    Signed-off-by: Kristen Carlson Accardi
    Signed-off-by: Greg Kroah-Hartman

    Kenji Kaneshige
     
  • This patch fixes the problem that the following error messages is
    reported when pciehp driver is rmmoded.

    Trying to free already-free IRQ XX

    The cause of this problem is that pciehp driver is doing unknown 2nd
    free_irq at driver unloading. This patch removes this unknown 2nd
    free_irq call.

    Note: The pciehp driver should be adapted to standard device driver
    mode.

    Signed-off-by: Kenji Kaneshige
    Signed-off-by: Kristen Carlson Accardi
    Signed-off-by: Greg Kroah-Hartman

    Kenji Kaneshige
     
  • Change the criterion that RPA PCI Hotplug and RPA DLPAR use when
    determining the hotplug capabilities of a given device node. The
    "device_type" property is less consistent than "name" across PCI nodes
    on newer hardware.

    Signed-off-by: John Rose
    Signed-off-by: Kristen Carlson Accardi
    Signed-off-by: Greg Kroah-Hartman

    John Rose
     
  • Change memory allocation for acpiphp slots

    Change the "struct slot" that acpiphp uses for managing it's slots to
    directly contain the memory for the needed struct hotplug_slot_info and
    the slot's name. This way we need only two memory allocations per slot
    instead of four.

    While we are at it: make_slot_name() is just a wrapper around snprintf()
    knowing the right arguments to call it. Since the function makes just one
    function call and is only called from one place I inlined it by hand.

    Finally this fixes a possible bug waiting for someone to hit it. There were
    two unused local variables in acpiphp_register_hotplug_slot(). gcc did not
    find them because they were used in memory allocations with sizeof(*var).
    They had the same types as the target of the allocation, but nevertheless
    this was just weird.

    Signed-off-by: Rolf Eike Beer
    Acked-by: Matthew Wilcox
    Signed-off-by: Kristen Carlson Accardi
    Signed-off-by: Greg Kroah-Hartman

    Rolf Eike Beer
     
  • Changes the pci_{enable,disable}_device() functions to work in a
    nested basis, so that eg, three calls to enable_device() require three
    calls to disable_device().

    The reason for this is to simplify PCI drivers for
    multi-interface/capability devices. These are devices that cram more
    than one interface in a single function. A relevant example of that is
    the Wireless [USB] Host Controller Interface (similar to EHCI) [see
    http://www.intel.com/technology/comms/wusb/whci.htm].

    In these kind of devices, multiple interfaces are accessed through a
    single bar and IRQ line. For that, the drivers map only the smallest
    area of the bar to access their register banks and use shared IRQ
    handlers.

    However, because the order at which those drivers load cannot be known
    ahead of time, the sequence in which the calls to pci_enable_device()
    and pci_disable_device() cannot be predicted. Thus:

    1. driverA starts pci_enable_device()
    2. driverB starts pci_enable_device()
    3. driverA shutdown pci_disable_device()
    4. driverB shutdown pci_disable_device()

    between steps 3 and 4, driver B would loose access to it's device,
    even if it didn't intend to.

    By using this modification, the device won't be disabled until all the
    callers to enable() have called disable().

    This is implemented by replacing 'struct pci_dev->is_enabled' from a
    bitfield to an atomic use count. Each caller to enable increments it,
    each caller to disable decrements it. When the count increments from 0
    to 1, __pci_enable_device() is called to actually enable the
    device. When it drops to zero, pci_disable_device() actually does the
    disabling.

    We keep the backend __pci_enable_device() for pci_default_resume() to
    use and also change the sysfs method implementation, so that userspace
    enabling/disabling the device doesn't disable it one time too much.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • The existing implementation of pci_block_user_cfg_access() was recently
    criticised for providing out of date information and for returning errors
    on write, which applications won't be expecting.

    This reimplementation uses a global wait queue and a bit per device.
    I've open-coded prepare_to_wait() / finish_wait() as I could optimise
    it significantly by knowing that the pci_lock protected us at all points.

    It looked a bit funny to be doing a spin_unlock_irqsave(); schedule(),
    so I used spin_lock_irq() for the _user versions of pci_read_config and
    pci_write_config. Not carrying a flags pointer around made the code
    much less nasty.

    Attempts to block an already blocked device hit a BUG() and attempts to
    unblock an already unblocked device hit a WARN(). If we need to block
    access to a device from userspace, it's because it's unsafe for even
    another bit of the kernel to access the device. An attempt to block
    a device for a second time means we're about to access the device to
    perform some other operation, which could provoke undefined behaviour
    from the device.

    Signed-off-by: Matthew Wilcox
    Acked-by: Adam Belay
    Acked-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Matthew Wilcox
     
  • __pci_register_driver() error path forgot to unwind.
    driver_unregister() needs to be called when pci_create_newid_file() failed.

    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Akinobu Mita
     
  • So it looks like pci aer code will call pci_osc_support_set to tell the
    firmware about OSC_EXT_PCI_CONFIG_SUPPORT flag. that causes
    ctrlset_buf[OSC_SUPPORT_TYPE] to evaluate to true when pciehp calls
    pci_osc_control_set() is called (to attempt to use OSC to gain native
    pcie control from firmware), regardless of whether or not _OSC was
    actually successfully executed. That causes this section of code:
    if (ctrlset_buf[OSC_SUPPORT_TYPE] &&
    ((global_ctrlsets & ctrlset) != ctrlset)) {
    return AE_SUPPORT;
    }
    to be hit.

    This patch will reset the OSC_SUPPORT_TYPE field if _OSC fails, and then
    would allow pciehp to go ahead and try to run _OSC again.

    Signed-off-by: Kristen Carlson Accardi
    Signed-off-by: Greg Kroah-Hartman

    Kristen Carlson Accardi
     
  • acpiphp_glue_exit() needs to be called to unwind when no slots found.
    (It fixes data corruption when reloading acpiphp driver with no such devices)

    Signed-off-by: Akinobu Mita
    Signed-off-by: Kristen Carlson Accardi
    Signed-off-by: Greg Kroah-Hartman

    Akinobu Mita
     
  • This patch fixes invalid usage of list_for_each()

    list_for_each (node, &bridge_list) {
    bridge = (struct acpiphp_bridge *)node;
    ...
    }

    This code works while the member of list node is located at the
    head of struct acpiphp_bridge.

    Signed-off-by: Akinobu Mita
    Signed-off-by: Kristen Carlson Accardi
    Signed-off-by: Greg Kroah-Hartman

    Akinobu Mita
     
  • Support a shadowed ROM when running with an ACPI capable PROM.

    Define a new dev.resource flag IORESOURCE_ROM_BIOS_COPY to
    describe the case of a BIOS shadowed ROM, which can then
    be used to avoid pci_map_rom() making an unneeded call to
    pci_enable_rom().

    Signed-off-by: John Keller
    Signed-off-by: Greg Kroah-Hartman

    John Keller
     
  • A few minor changes to the way slot/device fixup is done.

    No need to be calling sn_pci_controller_fixup(), as
    a root bus cannot be hotplugged.

    Signed-off-by: John Keller
    Signed-off-by: Greg Kroah-Hartman

    John Keller
     
  • pSeries is the only architecture left using HAVE_ARCH_PCI_MWI and it's
    really inappropriate for its needs. It really wants to disable MWI
    altogether. So here are a pair of stub implementations for pci_set_mwi
    and pci_clear_mwi.

    Also rename pci_generic_prep_mwi to pci_set_cacheline_size since that
    better reflects what it does.

    Signed-off-by: Matthew Wilcox
    Cc: Paul Mackerras
    Acked-by: Jeff Garzik
    Signed-off-by: Greg Kroah-Hartman

    Matthew Wilcox
     
  • The setting of the CACHE_LINE_SIZE register in sparc64's pci
    initialisation code isn't quite adequate as the device may have
    incompatible requirements. The generic code tests for this, so switch
    sparc64 over to using it.

    Since sparc64 has different L1 cache line size and PCI cache line size,
    it would need to override the generic code like i386 and ia64 do. We
    know what the cache line size is at compile time though, so introduce a
    new optional constant PCI_CACHE_LINE_BYTES.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: David Miller
    Acked-by: Jeff Garzik
    Signed-off-by: Greg Kroah-Hartman

    Matthew Wilcox
     
  • The number of permutations of crap we do is amazing and almost all of it
    has the wrong effect in 2.6.

    At the heart of this is the PCI SFF magic which says that compatibility
    mode PCI IDE controllers use ISA IRQ routing and hard coded addresses
    not the BAR values. The old quirks variously clears them, sets them,
    adjusts them and then IDE ignores the result.

    In order to drive all this garbage out and to do it portably we need to
    handle the SFF rules directly and properly. Because we know the device
    BAR 0-3 are not used in compatibility mode we load them with the values
    that are implied (and indeed which many controllers actually
    thoughtfully put there in this mode anyway).

    This removes special cases in the IDE layer and libata which now knows
    that bar 0/1/2/3 always contain the correct address. It means our
    resource allocation map is accurate from boot, not "mostly accurate"
    after ide is loaded, and it shoots lots of code. There is also lots more
    code and magic constant knowledge to shoot once this is in and settled.

    Been in my test tree for a while both with drivers/ide and with libata.
    Wants some -mm shakedown in case I've missed something dumb or there are
    corner cases lurking.

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

    Alan Cox
     
  • Shouldn't PCI-X state be saved/restored? No device really needs this
    right now. qla24xx (fc HBA) and mthca (infiniband) don't do suspend,
    and sky2 resets its tweaks when links are brought up.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     
  • Move some MSI-X #defines into pci_regs.h so they can be used
    outside of drivers/pci.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Michael Ellerman
     
  • It's not really broken, but people keep running into other problems
    caused by it. Re-enable it so that the drivers get stress tested.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

30 Nov, 2006

3 commits


22 Nov, 2006

2 commits

  • Fix up for make allyesconfig.

    Signed-Off-By: David Howells

    David Howells
     
  • Pass the work_struct pointer to the work function rather than context data.
    The work function can use container_of() to work out the data.

    For the cases where the container of the work_struct may go away the moment the
    pending bit is cleared, it is made possible to defer the release of the
    structure by deferring the clearing of the pending bit.

    To make this work, an extra flag is introduced into the management side of the
    work_struct. This governs auto-release of the structure upon execution.

    Ordinarily, the work queue executor would release the work_struct for further
    scheduling or deallocation by clearing the pending bit prior to jumping to the
    work function. This means that, unless the driver makes some guarantee itself
    that the work_struct won't go away, the work function may not access anything
    else in the work_struct or its container lest they be deallocated.. This is a
    problem if the auxiliary data is taken away (as done by the last patch).

    However, if the pending bit is *not* cleared before jumping to the work
    function, then the work function *may* access the work_struct and its container
    with no problems. But then the work function must itself release the
    work_struct by calling work_release().

    In most cases, automatic release is fine, so this is the default. Special
    initiators exist for the non-auto-release case (ending in _NAR).

    Signed-Off-By: David Howells

    David Howells
     

15 Nov, 2006

1 commit


13 Nov, 2006

1 commit

  • The PCI sysfs attributes are created after the initial PCI bus scan. With
    the addition of more return value checking and assertions in the device and
    sysfs layers we now can get dumps like this on sparc64:

    [ 20.135032] Call Trace:
    [ 20.135042] [0000000000537f88] pci_remove_bus_device+0x30/0xc0
    [ 20.135076] [000000000078f890] pci_fill_in_pbm_cookies+0x98/0x440
    [ 20.135109] [000000000042e828] sabre_scan_bus+0x230/0x400
    [ 20.135139] [000000000078c710] pcibios_init+0x58/0xa0
    [ 20.135159] [0000000000416f14] init+0x9c/0x2e0
    [ 20.135190] [0000000000417a50] kernel_thread+0x38/0x60
    [ 20.135211] [0000000000417170] rest_init+0x18/0x40
    [ 20.135514] PCI0(PBMB): Bus running at 33MHz

    It's triggering because removal of the "config" PCI sysfs file for the
    device fails.

    On sparc64, after probing the device, we'll delete the PCI device via
    pci_remove_bus_device() if we cannot find the firmware device tree node
    corresponding to it.

    This is fine, but at this point the sysfs files for the PCI device won't be
    setup yet.

    So we should not try to do anything in pci_remove_sysfs_dev_files() if
    pci_sysfs_init() has not run yet.

    Signed-off-by: David S. Miller
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Miller
     

09 Nov, 2006

2 commits

  • This patch adds a variant of ht_create_irq __ht_create_irq that takes an
    aditional parameter update that is a function that is called whenever we want
    to write to a drivers htirq configuration registers.

    This is needed to support the ipath_iba6110 because it's registers in the
    proper location are not actually conected to the hardware that controlls
    interrupt delivery.

    [bos@serpentine.com: fixes]
    Signed-off-by: Eric W. Biederman
    Cc: Andi Kleen
    Cc:
    Cc: Roland Dreier
    Signed-off-by: Bryan O'Sullivan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • This refactoring actually optimizes the code a little by caching the value
    that we think the device is programmed with instead of reading it back from
    the hardware. Which simplifies the code a little and should speed things up a
    bit.

    This patch introduces the concept of a ht_irq_msg and modifies the
    architecture read/write routines to update this code.

    There is a minor consistency fix here as well as x86_64 forgot to initialize
    the htirq as masked.

    Signed-off-by: Eric W. Biederman
    Cc: Andi Kleen
    Acked-by: Bryan O'Sullivan
    Cc:
    Cc: Roland Dreier
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

04 Nov, 2006

1 commit

  • PCI_MULTITHREAD_PROBE is an interesting feature, but in its current state
    it seems to be more of a trap for users who accidentally enable it.

    This patch lets PCI_MULTITHREAD_PROBE depend on BROKEN for 2.6.19.

    The intention is to get this patch reversed in -mm as soon as it's in
    Linus' tree, and reverse it for 2.6.20 or 2.6.21 after the fallout of
    in-kernel problems PCI_MULTITHREAD_PROBE causes got fixed.

    (akpm: I get enough bug reports already)

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

    Adrian Bunk