1. 21 4月, 2008 23 次提交
    • T
      PCI: Hotplug: fakephp: Return success, not ENODEV, when bus rescan is triggered · ca99eb8c
      Trent Piepho 提交于
      The 'power' attribute of the fakephp driver originally only let one turn a
      slot off.  If one tried to turn a slot on (echo 1 > .../power), it would
      return ENODEV, as fakephp did not support this function.
      
      An old (pre-git) patch changed this:
      2004/11/11 16:33:31-08:00 jdittmer
      [PATCH] fakephp: add pci bus rescan ability
      http://article.gmane.org/gmane.linux.kernel/251183
      
      Now writing "1" to the power attribute has the effect of triggering a bus
      rescan, but it still returns ENODEV, probably an oversight in the above
      patch.
      
      Using the BusyBox echo will not produce an error message, but will
      trigger *two* bus rescans (and return an exit code of 1):
      ~ # strace echo -n 1 > /sys/bus/pci/slots/0000:00:00.0/power
      ...
      write(1, "1", 1)                        = -1 ENODEV (No such device)
      write(1, "1", 1)                        = -1 ENODEV (No such device)
      exit(1)                                 = ?
      
      Using cp gives a write error, even though the write did happen and a rescan
      was triggered:
      ~ # echo -n 1 > tmp ; cp tmp /sys/bus/pci/slots/0000:00:00.0/power
      cp: Write Error: No such device
      
      It seems much better to return success instead of failure.  The actual
      status of the bus rescan is hard to return.  It happens asynchronously in a
      work thread, so the sysfs store functions returns before any status is
      ready (the whole point of the work queue).  And even if it didn't do this,
      the rescan doesn't have any clear status to return.
      Signed-off-by: NTrent Piepho <tpiepho@freescale.com>
      CC: Jan Dittmer <jdittmer@ppp0.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ca99eb8c
    • J
      PCI: Hotplug: Fix leaks in IBM Hot Plug Controller Driver - ibmphp_init_devno() · 029c3c13
      Jesper Juhl 提交于
      In drivers/pci/hotplug/ibmphp_core.c::ibmphp_init_devno() we allocate
      space dynamically for a PCI irq routing table by calling
      pcibios_get_irq_routing_table(), but we never free the allocated space.
      
      This patch frees the allocated space at the function exit points.
      
      Spotted by the Coverity checker. Compile tested only.
      
      Please consider applying.
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      029c3c13
    • I
      PCI: clean up resource alignment management · 88452565
      Ivan Kokshaysky 提交于
      Done per Linus' request and suggestions. Linus has explained that
      better than I'll be able to explain:
      
      On Thu, Mar 27, 2008 at 10:12:10AM -0700, Linus Torvalds wrote:
      > Actually, before we go any further, there might be a less intrusive
      > alternative: add just a couple of flags to the resource flags field (we
      > still have something like 8 unused bits on 32-bit), and use those to
      > implement a generic "resource_alignment()" routine.
      >
      > Two flags would do it:
      >
      >  - IORESOURCE_SIZEALIGN: size indicates alignment (regular PCI device
      >    resources)
      >
      >  - IORESOURCE_STARTALIGN: start field is alignment (PCI bus resources
      >    during probing)
      >
      > and then the case of both flags zero (or both bits set) would actually be
      > "invalid", and we would also clear the IORESOURCE_STARTALIGN flag when we
      > actually allocate the resource (so that we don't use the "start" field as
      > alignment incorrectly when it no longer indicates alignment).
      >
      > That wouldn't be totally generic, but it would have the nice property of
      > automatically at least add sanity checking for that whole "res->start has
      > the odd meaning of 'alignment' during probing" and remove the need for a
      > new field, and it would allow us to have a generic "resource_alignment()"
      > routine that just gets a resource pointer.
      
      Besides, I removed IORESOURCE_BUS_HAS_VGA flag which was unused for ages.
      Signed-off-by: NIvan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Gary Hade <garyhade@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      88452565
    • A
      PCI: aerdrv_acpi.c: remove unneeded NULL check · d75b3052
      Adrian Bunk 提交于
      There's no reason for checking pdev->bus for being NULL here (and we'd
      anyway Oops 3 lines below if it was).
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d75b3052
    • T
      PCI: Update VIA CX700 quirk · bc043274
      Tim Yamin 提交于
      This follows up 53a9bf42. Some newer
      CX700 BIOSes from our vendor have PCI Bus Parking disabled but PCI
      Master read caching enabled. This creates problems such as system
      freezing when both the network controller and the USB controller are
      active and one of them is pretty busy (e.g. heavy network traffic).
      
      This patch separates the checks and both the bus parking and the read
      caching are disabled independently if either is enabled by the BIOS.
      Signed-off-by: NTim Yamin <tim.yamin@zonbu.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bc043274
    • B
      PCI: Expose PCI VPD through sysfs · 94e61088
      Ben Hutchings 提交于
      Vital Product Data (VPD) may be exposed by PCI devices in several
      ways.  It is generally unsafe to read this information through the
      existing interfaces to user-land because of stateful interfaces.
      
      This adds:
      - abstract operations for VPD access (struct pci_vpd_ops)
      - VPD state information in struct pci_dev (struct pci_vpd)
      - an implementation of the VPD access method specified in PCI 2.2
        (in access.c)
      - a 'vpd' binary file in sysfs directories for PCI devices with VPD
        operations defined
      
      It adds a probe for PCI 2.2 VPD in pci_scan_device() and release of
      VPD state in pci_release_dev().
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      94e61088
    • M
      PCI: iommu: iotlb flushing · 5e0d2a6f
      mark gross 提交于
      This patch is for batching up the flushing of the IOTLB for the DMAR
      implementation found in the Intel VT-d hardware.  It works by building a list
      of to be flushed IOTLB entries and a bitmap list of which DMAR engine they are
      from.
      
      After either a high water mark (250 accessible via debugfs) or 10ms the list
      of iova's will be reclaimed and the DMAR engines associated are IOTLB-flushed.
      
      This approach recovers 15 to 20% of the performance lost when using the IOMMU
      for my netperf udp stream benchmark with small packets.  It can be disabled
      with a kernel boot parameter "intel_iommu=strict".
      
      Its use does weaken the IOMMU protections a bit.
      Signed-off-by: NMark Gross <mgross@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5e0d2a6f
    • B
      PCI: simplify quirk debug output · 0255f543
      Bjorn Helgaas 提交于
      print_fn_descriptor_symbol() prints the address if we don't have a symbol,
      so no need to print both.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0255f543
    • M
      PCI: iova RB tree setup tweak · ddf02886
      mark gross 提交于
      The following patch merges two functions into one allowing for a 3%
      reduction in overhead in locating, allocating and inserting pages for
      use in IOMMU operations.
      
      Its a bit of a eye-crosser so I welcome any RB-tree / MM experts to take
      a look.  It works by re-using some of the information gathered in the
      search for the pages to use in setting up the IOTLB's in the insertion
      of the iova structure into the RB tree.
      
      Signed-off-by: <mgross@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ddf02886
    • B
      PCI: add generic pci_enable_resources() · 842de40d
      Bjorn Helgaas 提交于
      Each architecture has its own pcibios_enable_resources() implementation.
      These differ in many minor ways that have nothing to do with actual
      architectural differences.  Follow-on patches will make most arches
      use this generic version instead.
      
      This version is based on powerpc, which seemed most up-to-date.  The only
      functional difference from the x86 version is that this uses "!r->parent"
      to check for resource collisions instead of "!r->start && r->end".
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      842de40d
    • S
      PCI: add PCI Express ASPM support · 7d715a6c
      Shaohua Li 提交于
      PCI Express ASPM defines a protocol for PCI Express components in the D0
      state to reduce Link power by placing their Links into a low power state
      and instructing the other end of the Link to do likewise. This
      capability allows hardware-autonomous, dynamic Link power reduction
      beyond what is achievable by software-only controlled power management.
      However, The device should be configured by software appropriately.
      Enabling ASPM will save power, but will introduce device latency.
      
      This patch adds ASPM support in Linux. It introduces a global policy for
      ASPM, a sysfs file /sys/module/pcie_aspm/parameters/policy can control
      it. The interface can be used as a boot option too. Currently we have
      below setting:
              -default, BIOS default setting
              -powersave, highest power saving mode, enable all available ASPM
      state and clock power management
              -performance, highest performance, disable ASPM and clock power
      management
      By default, the 'default' policy is used currently.
      
      In my test, power difference between powersave mode and performance mode
      is about 1.3w in a system with 3 PCIE links.
      
      Note: some devices might not work well with aspm, either because chipset
      issue or device issue. The patch provide API (pci_disable_link_state),
      driver can disable ASPM for specific device.
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7d715a6c
    • G
      PCI: Include PCI domain in PCI bus names on x86/x86_64 · cb3576fa
      Gary Hade 提交于
      The PCI bus names included in /proc/iomem and /proc/ioports are
      of the form 'PCI Bus #XX' where XX is the bus number.  This patch
      changes the naming to 'PCI Bus XXXX:YY' where XXXX is the domain
      number and YY is the bus number.  For example, PCI bus 14 in
      domain 0 will show as 'PCI Bus 0000:14' instead of 'PCI Bus #14'.
      This change makes the naming consistent with other architectures
      such as ia64 where multiple PCI domain support has been around
      longer.
      Signed-off-by: NGary Hade <garyhade@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cb3576fa
    • A
      PCI: #if 0 pci_cleanup_aer_correct_error_status() · 21c68474
      Adrian Bunk 提交于
      #if 0 the no longer used pci_cleanup_aer_correct_error_status().
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      21c68474
    • Y
      PCI: pcie AER: don't check _OSC when acpi is disabled · 4c44bac8
      Yinghai Lu 提交于
      [PATCH] pcie AER: don't check _OSC when acpi is disabled
      
      when acpi=off or pci=noacpi, get warning
      
      AER service couldn't init device 0000:00:0a.0:pcie01 - no _OSC support
      AER service couldn't init device 0000:00:0e.0:pcie01 - no _OSC support
      AER service couldn't init device 0000:00:0f.0:pcie01 - no _OSC support
      AER service couldn't init device 0000:80:0b.0:pcie01 - no _OSC support
      AER service couldn't init device 0000:80:0e.0:pcie01 - no _OSC support
      AER service couldn't init device 0000:80:0f.0:pcie01 - no _OSC support
      
      so don't check _OSC in aer_osc_setup
      Signed-off-by: NYinghai Lu <yinghai.lu@sun.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4c44bac8
    • G
      PCI: remove global list of PCI devices · 5ff580c1
      Greg Kroah-Hartman 提交于
      This patch finally removes the global list of PCI devices.  We are
      relying entirely on the list held in the driver core now, and do not
      need a separate "shadow" list as no one uses it.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5ff580c1
    • G
      PCI: add is_added flag to struct pci_dev · 8a1bc901
      Greg Kroah-Hartman 提交于
      This lets us check if the device is really added to the driver core or
      not, which is what we need when walking some of the bus lists.  The flag
      is there in anticipation of getting rid of the other PCI device list,
      which is what we used to check in this situation.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8a1bc901
    • G
      PCI: make no_pci_devices() use the pci_bus_type list · 70308923
      Greg Kroah-Hartman 提交于
      no_pci_devices() should use the driver core list of PCI devices, not our
      "separate" one.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      70308923
    • G
      PCI Hotplug: the ibm driver is not dependant on PCI_LEGACY · 3b57eff0
      Greg Kroah-Hartman 提交于
      This was marked incorrectly for some reason.  Allow the ibmphp driver to
      be built even if PCI_LEGACY is not enabled.
      
      Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3b57eff0
    • G
      PCI Hotplug: make cpcihp driver use modern apis · 33ae6ef2
      Greg Kroah-Hartman 提交于
      This removes the depandancy of the cpcihp driver from the PCI_LEGACY
      config option by removing its usage of the pci_find_bus() function.
      
      
      Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
      Signed-off-by: NScott Murray <scottm@somanetworks.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      33ae6ef2
    • G
      PCI: clean up search.c a lot · 95247b57
      Greg Kroah-Hartman 提交于
      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: NGreg Kroah-Hartman <gregkh@suse.de>
      95247b57
    • G
      PCI: remove pci_get_device_reverse · 34220909
      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: NGreg Kroah-Hartman <gregkh@suse.de>
      34220909
    • G
      PCI: remove pci_find_present · 448432c4
      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: NGreg Kroah-Hartman <gregkh@suse.de>
      448432c4
    • A
      PCI: #if 0 pci_assign_resource_fixed() · 2baad5f9
      Adrian Bunk 提交于
      An unused function that bloated the kernel only when CONFIG_EMBEDDED was
      enabled...
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2baad5f9
  2. 29 3月, 2008 1 次提交
  3. 27 3月, 2008 1 次提交
  4. 25 3月, 2008 2 次提交
  5. 18 3月, 2008 1 次提交
    • M
      pciehp: don't enable slot unless forced · 9e585824
      Mark Lord 提交于
      This fixes a 2.6.25 regression reported by Alex Chiang.
      
      Invoke pciehp_enable_slot() at startup only when pciehp_force=1.
      Some HP equipment apparently cannot cope with it otherwise.
      
      This restores the (previously working) 2.6.24 behaviour here,
      while allowing machines that need a kick to use pciehp_force=1.
      
      This was the original design back in October 2007,
      but Kristen suggested we try without it first:
      
         Kristen Carlson Accardi wrote:
         >I think it would be ok to try allowing the slot to be enabled when not
         >using pciehp_force mode.  We can wrap it later if it proves to break things
      
      This ended up breaking one of Alex's setups,
      so it's time to put the wrapper back in now.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Acked-by: NAlex Chiang <achiang@hp.com>
      Acked-by: NKristen Carlson Accardi <kristen.c.accardi@intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9e585824
  6. 14 3月, 2008 1 次提交
    • G
      PCI: fix issue with busses registering multiple times in sysfs · cc74d96f
      Greg Kroah-Hartman 提交于
      PCI busses can be registered multiple times, so we need to detect if we
      have registered our bus structure in sysfs already.  If so, don't do it
      again.
      
      Thanks to Guennadi Liakhovetski <g.liakhovetski@gmx.de> for reporting
      the problem, and to Linus for poking me to get me to believe that it was
      a real problem.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cc74d96f
  7. 11 3月, 2008 1 次提交
    • J
      PCI Hotplug: Fix small mem leak in IBM Hot Plug Controller Driver · b91aac29
      Jesper Juhl 提交于
      In drivers/pci/hotplug/ibmphp_ebda.c::ebda_rsrc_controller(), storage is
      allocated with kzalloc() and assigned to 'tmp_slot'.  Then lots of
      stuff, like ->flag, ->supported_speed etc is set in tmp_slot.  A bit
      further down there's then this test :
      
        if (!bus_info_ptr1) {
          rc = -ENODEV;
          goto error;
        }
      
      At this point, tmp_slot has not been assigned to anything, so when
      erroring-out we want to free it, but nothing at the 'error:' label
      free's 'tmp_slot' - and we can't really free 'tmp_slot' at 'error:'
      since we may jump to that label later when 'tmp_slot' *has* been used
      and we do not want it freed. So, the only sane option left seems to be
      to kfree(tmp_slot) just before jumping to the 'error:' label in the one
      place where this is what actually makes sense. The following patch does
      just that and thus kills off a tiny potential memory leak.
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b91aac29
  8. 05 3月, 2008 5 次提交
  9. 04 3月, 2008 1 次提交
  10. 24 2月, 2008 2 次提交
  11. 23 2月, 2008 1 次提交
  12. 22 2月, 2008 1 次提交
    • K
      PCI: Fix wrong reference counter check for proc_dir_entry · 79df4c60
      Kenji Kaneshige 提交于
      Fix wrong counter check for proc_dir_entry in pci_proc_detach_device().
      
      The pci_proc_detach_device() returns with -EBUSY before calling
      remove_proc_entry() if the reference counter of proc_dir_entry is not
      0. But this check is wrong and pci_proc_detach_device() always fails
      because the reference counter of proc_dir_entry is initialized with 1
      at creating time and decremented in remove_proc_entry(). This bug
      cause strange behaviour as followings:
      
      - Accessing /proc/bus/pci/XXXX/YY file after hot-removing pci adapter
        card causes kernel panic.
      
      - Repeating hot-add/hot-remove of pci adapter card increases files
        with the same name under /proc/bus/pci/XXXX/ directory. For example:
      
          # pwd
          /proc/bus/pci/0002:09
          # ls
          01.0
          # for i in `seq 5`
          > do
          > echo 0 > /sys/bus/pci/slots/0009_0032/power
          > echo 1 > /sys/bus/pci/slots/0009_0032/power
          > done
          # ls
          01.0  01.0  01.0  01.0  01.0  01.0
      
      The pci_proc_detach_device() should check if the reference counter is
      not larger than 1 instead.
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      79df4c60