1. 03 May, 2007 12 commits
    • Sergei Shtylyov's avatar
      PCI: define pci_request/release_regions() for CONFIG_PCI=n · 0da0ead9
      Sergei Shtylyov authored
      Balance declarations of pci_request_regions() and pci_release_regions() with
      empty inline definitions for the CONFIG_PCI=n case -- otherwise my patch to
      drivers/net/3c59x.c in the -mm tree doesn't compile. :-)
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0da0ead9
    • Sam Ravnborg's avatar
      pci: do not mark exported functions as __devinit · 96bde06a
      Sam Ravnborg authored
      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: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      96bde06a
    • Jean Delvare's avatar
      PCI: Require vendor and device for new_id · 6ba18636
      Jean Delvare authored
      Currently, there is no minimum number of fields required when adding
      a new device ID to a PCI driver through the new_id sysfs file. It is
      possible to add a new ID with only the vendor ID set, causing the
      driver to attempt to attach to all PCI devices from that vendor. This
      has been reported to happen accidentally:
        http://lists.lm-sensors.org/pipermail/lm-sensors/2007-March/019366.html
      It is even possible to not even set the vendor ID field, causing the
      driver to attempt to attach to _all_ the PCI devices.
      
      This sounds dangerous and I fail to see any valid use of this
      "feature". Thus I suggest that we now require at least the first two
      fields (vendor ID and device ID) to be set. For what it's worth, this
      is what the USB subsystem does.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6ba18636
    • Jesse Barnes's avatar
      PCI: fix sysfs rom file creation for BIOS ROM shadows · 40ee9e9f
      Jesse Barnes authored
      At one time, if a BIOS ROM shadow was detected for the boot video
      device (stored at offset 0xc0000), we'd set a special resource flag,
      IORESOURCE_ROM_SHADOW, so that the sysfs ROM file code could handle
      it properly.  That broke along the way somewhere though, so current
      kernels will be missing 'rom' files in sysfs if the video device
      doesn't have an explicit ROM BAR.
      
      This patch fixes the regression by moving the video fixup quirk to a
      little later in the boot cycle (to avoid having its work undone by
      PCI resource allocation) and checking in the PCI sysfs code whether
      a rom file should be created due to a shadow resource, which is also
      moved to a little later in the boot cycle so it will occur after the
      video fixup.  Tested and works on my i386 test box.
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      40ee9e9f
    • Randy Dunlap's avatar
      PCI: kernel-doc fix · 8d7d86e9
      Randy Dunlap authored
      Warning(linux-2621-rc3g7/drivers/pci/pci.c:1283): No description found for parameter 'dev'
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8d7d86e9
    • Jean Delvare's avatar
      PCI: Cleanup the includes of <linux/pci.h> · 6473d160
      Jean Delvare authored
      I noticed that many source files include <linux/pci.h> while they do
      not appear to need it. Here is an attempt to clean it all up.
      
      In order to find all possibly affected files, I searched for all
      files including <linux/pci.h> but without any other occurence of "pci"
      or "PCI". I removed the include statement from all of these, then I
      compiled an allmodconfig kernel on both i386 and x86_64 and fixed the
      false positives manually.
      
      My tests covered 66% of the affected files, so there could be false
      positives remaining. Untested files are:
      
      arch/alpha/kernel/err_common.c
      arch/alpha/kernel/err_ev6.c
      arch/alpha/kernel/err_ev7.c
      arch/ia64/sn/kernel/huberror.c
      arch/ia64/sn/kernel/xpnet.c
      arch/m68knommu/kernel/dma.c
      arch/mips/lib/iomap.c
      arch/powerpc/platforms/pseries/ras.c
      arch/ppc/8260_io/enet.c
      arch/ppc/8260_io/fcc_enet.c
      arch/ppc/8xx_io/enet.c
      arch/ppc/syslib/ppc4xx_sgdma.c
      arch/sh64/mach-cayman/iomap.c
      arch/xtensa/kernel/xtensa_ksyms.c
      arch/xtensa/platform-iss/setup.c
      drivers/i2c/busses/i2c-at91.c
      drivers/i2c/busses/i2c-mpc.c
      drivers/media/video/saa711x.c
      drivers/misc/hdpuftrs/hdpu_cpustate.c
      drivers/misc/hdpuftrs/hdpu_nexus.c
      drivers/net/au1000_eth.c
      drivers/net/fec_8xx/fec_main.c
      drivers/net/fec_8xx/fec_mii.c
      drivers/net/fs_enet/fs_enet-main.c
      drivers/net/fs_enet/mac-fcc.c
      drivers/net/fs_enet/mac-fec.c
      drivers/net/fs_enet/mac-scc.c
      drivers/net/fs_enet/mii-bitbang.c
      drivers/net/fs_enet/mii-fec.c
      drivers/net/ibm_emac/ibm_emac_core.c
      drivers/net/lasi_82596.c
      drivers/parisc/hppb.c
      drivers/sbus/sbus.c
      drivers/video/g364fb.c
      drivers/video/platinumfb.c
      drivers/video/stifb.c
      drivers/video/valkyriefb.c
      include/asm-arm/arch-ixp4xx/dma.h
      sound/oss/au1550_ac97.c
      
      I would welcome test reports for these files. I am fine with removing
      the untested files from the patch if the general opinion is that these
      changes aren't safe. The tested part would still be nice to have.
      
      Note that this patch depends on another header fixup patch I submitted
      to LKML yesterday:
        [PATCH] scatterlist.h needs types.h
        http://lkml.org/lkml/2007/3/01/141Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6473d160
    • Jean Delvare's avatar
      PCI: scatterlist.h needs types.h · a9dfd281
      Jean Delvare authored
      Most architectures' scatterlist.h use the type dma_addr_t, but omit to
      include <asm/types.h> which defines it.  This could lead to build failures,
      so let's add the missing includes.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a9dfd281
    • Kristen Carlson Accardi's avatar
      PCI: fix multiple definition of `queue_pushbutton_work' · e325e1f0
      Kristen Carlson Accardi authored
      Fix duplicate names in shpchp and pciehp.
      Signed-off-by: default avatarKristen Carlson Accardi <kristen.c.accardi@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      e325e1f0
    • Kenji Kaneshige's avatar
      pciehp: Adapt to device driver model · 92333526
      Kenji Kaneshige authored
      This patch adapts PCIEHP driver to PCI device driver model.
      Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: default avatarKristen Carlson Accardi <kristen.c.accardi@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      92333526
    • Kenji Kaneshige's avatar
      pciehp: Event handling rework · 5d386e1a
      Kenji Kaneshige authored
      The event handler of PCIEHP driver is unnecessarily very complex. In
      addition, current event handler can only a fixed number of events at
      the same time, and some of events would be lost if several number of
      events happened at the same time.
      
      This patch simplify the event handler using 'work queue', and it also
      fix the above-mentioned issue.
      Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: default avatarKristen Carlson Accardi <kristen.c.accardi@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5d386e1a
    • Brian King's avatar
      pci: New PCI-E reset API · f7bdd12d
      Brian King authored
      Adds a new API which can be used to issue various types
      of PCI-E reset, including PCI-E warm reset and PCI-E hot reset.
      This is needed for an ipr PCI-E adapter which does not properly
      implement BIST. Running BIST on this adapter results in PCI-E
      errors. The only reliable reset mechanism that exists on this
      hardware is PCI Fundamental reset (warm reset). Since driving
      this type of reset is architecture unique, this provides the
      necessary hooks for architectures to add this support.
      Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Acked-by: default avatarLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f7bdd12d
    • Mitch Williams's avatar
      PCI: Flush MSI-X table writes · 988cbb15
      Mitch Williams authored
      This patch fixes a kernel bug which is triggered when using the
      irqbalance daemon with MSI-X hardware.
      
      Because both MSI-X interrupt messages and MSI-X table writes are posted,
      it's possible for them to cross while in-flight.  This results in
      interrupts being received long after the kernel thinks they're disabled,
      and in interrupts being sent to stale vectors after rebalancing.
      
      This patch performs a read flush after writes to the MSI-X table for
      mask and unmask operations.  Since the SMP affinity is set while
      the interrupt is masked, and since it's unmasked immediately after,
      no additional flushes are required in the various affinity setting
      routines.
      
      This patch has been validated with (unreleased) network hardware which
      uses MSI-X.
      
      Revised with input from Eric Biederman.
      Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
      Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      988cbb15
  2. 01 May, 2007 1 commit
    • Linus Torvalds's avatar
      libata: honour host controllers that want just one host · dc87c398
      Linus Torvalds authored
      The Marvell IDE interface on my machine would hit a BUG_ON() in
      lib/iomem.c because it was calling ata_pci_init_one() specifying just a
      single port on the host, but that would actually end up trying to
      initialize two ports, the second one with bogus information.
      
      This fixes "ata_pci_init_one()" so that it actually passes down the
      n_ports variable that it got from the low-level driver to the host
      allocation routine ("ata_host_alloc_pinfo()"), which results in the ATA
      layer actually having the correct port number information.
      
      And in order to make it all work, I also needed to fix a few places that
      had incorrectly hard-coded the fact that a host always had exactly two
      ports (both ata_pci_init_bmdma() and ata_request_legacy_irqs() would
      just always iterate over both ports).
      Acked-by: default avatarJeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dc87c398
  3. 30 Apr, 2007 27 commits