1. 20 11月, 2009 1 次提交
    • D
      Fix handling of the HP/Acer 'DMAR at zero' BIOS error for machines with <4GiB RAM. · 5854d9c8
      David Woodhouse 提交于
      Commit 86cf898e ("intel-iommu: Check for
      'DMAR at zero' BIOS error earlier.") was supposed to work by pretending
      not to detect an IOMMU if it was actually being reported by the BIOS at
      physical address zero.
      
      However, the intel_iommu_init() function is called unconditionally, as
      are the corresponding functions for other IOMMU hardware.
      
      So the patch only worked if you have RAM above the 4GiB boundary. It
      caused swiotlb to be initialised when no IOMMU was detected during early
      boot, and thus the later IOMMU init would refuse to run.
      
      But if you have less RAM than that, swiotlb wouldn't get set up and the
      IOMMU _would_ still end up being initialised, even though we never
      claimed to detect it.
      
      This patch also sets the dmar_disabled flag when the error is detected
      during the initial detection phase -- so that the later call to
      intel_iommu_init() will return without doing anything, regardless of
      whether swiotlb is used or not.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5854d9c8
  2. 12 11月, 2009 2 次提交
    • F
      intel-iommu: Support PCIe hot-plug · 99dcaded
      Fenghua Yu 提交于
      To support PCIe hot plug in IOMMU, we register a notifier to respond to device
      change action.
      
      When the notifier gets BUS_NOTIFY_UNBOUND_DRIVER, it removes the device
      from its DMAR domain.
      
      A hot added device will be added into an IOMMU domain when it first does IOMMU
      op. So there is no need to add more code for hot add.
      
      Without the patch, after a hot-remove, a hot-added device on the same
      slot will not work.
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Tested-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      99dcaded
    • A
      intel-iommu: Obey coherent_dma_mask for alloc_coherent on passthrough · e8bb910d
      Alex Williamson 提交于
      The model for IOMMU passthrough is that decent devices that can cope
      with DMA to all of memory get passthrough; crappy devices with a limited
      dma_mask don't -- they get to use the IOMMU anyway.
      
      This is done on the basis that IOMMU passthrough is usually wanted for
      performance reasons, and it's only the decent PCI devices that you
      really care about performance for, while the crappy 32-bit ones like
      your USB controller can just use the IOMMU and you won't really care.
      
      Unfortunately, the check for this was only looking at dev->dma_mask, not
      at dev->coherent_dma_mask. And some devices have a 32-bit
      coherent_dma_mask even though they have a full 64-bit dma_mask.
      
      Even more unfortunately, fixing that simple oversight would upset
      certain broken HP devices. Not only do they have a 32-bit
      coherent_dma_mask, but they also have a tendency to do stray DMA to
      unmapped addresses. And then they die when they take the DMA fault they
      so richly deserve.
      
      So if we do the 'correct' fix, it'll mean that affected users have to
      disable IOMMU support completely on "a large percentage of servers from
      a major vendor."
      
      Personally, I have little sympathy -- given that this is the _same_
      'major vendor' who is shipping machines which claim to have IOMMU
      support but have obviously never _once_ booted a VT-d capable OS to do
      any form of QA. But strictly speaking, it _would_ be a regression even
      though it only ever worked by fluke.
      
      For 2.6.33, we'll come up with a quirk which gives swiotlb support
      for this particular device, and other devices with an inadequate
      coherent_dma_mask will just get normal IOMMU mapping.
      
      The simplest fix for 2.6.32, though, is just to jump through some hoops
      to try to allocate coherent DMA memory for such devices in a place that
      they can reach. We'd use dma_generic_alloc_coherent() for this if it
      existed on IA64.
      Signed-off-by: NAlex Williamson <alex.williamson@hp.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      e8bb910d
  3. 10 11月, 2009 1 次提交
    • D
      intel-iommu: Check for 'DMAR at zero' BIOS error earlier. · 86cf898e
      David Woodhouse 提交于
      Chris Wright has some patches which let us fall back to swiotlb nicely
      if IOMMU initialisation fails. But those are a bit much for 2.6.32.
      
      Instead, let's shift the check for the biggest problem, the HP and Acer
      BIOS bug which reports a DMAR at physical address zero. That one can
      actually be checked much earlier -- before we even admit to having
      detected an IOMMU in the first place. So the swiotlb init goes ahead as
      we want.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      86cf898e
  4. 07 11月, 2009 1 次提交
    • K
      PCI ASPM: fix oops on root port removal · 761434a3
      Kenji Kaneshige 提交于
      Fix the following BUG_ON() problem reported by Alex Chiang.
      
      This problem happened when removing PCIe root port using PCI logical
      hotplug operation.
      
      The immediate cause of this problem is that the pointer to invalid
      data structure is passed to pcie_update_aspm_capable() by
      pcie_aspm_exit_link_state(). When pcie_aspm_exit_link_state() received
      a pointer to root port link, it unconfigures the root port link and
      frees its data structure at first. At this point, there are not links
      to configure under the root port and the data structure for root port
      link is already freed. So pcie_aspm_exit_link_state() must not call
      pcie_update_aspm_capable() and pcie_config_aspm_path().
      
      This patch fixes the problem by changing pcie_aspm_exit_link_state()
      not to call pcie_update_aspm_capable() and pcie_config_aspm_path() if
      the specified link is root port link.
      
      ------------[ cut here ]------------
      kernel BUG at drivers/pci/pcie/aspm.c:606!
      invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
      last sysfs file: /sys/devices/pci0000:40/0000:40:13.0/remove
      CPU 1
      Modules linked in: shpchp
      Pid: 9345, comm: sysfsd Not tainted 2.6.32-rc5 #98 ProLiant DL785 G6
      RIP: 0010:[<ffffffff811df69b>]  [<ffffffff811df69b>] pcie_update_aspm_capable+0x15/0xbe
      RSP: 0018:ffff88082a2f5ca0  EFLAGS: 00010202
      RAX: 0000000000000e77 RBX: ffff88182cc3e000 RCX: ffff88082a33d006
      RDX: 0000000000000001 RSI: ffffffff811dff4a RDI: ffff88182cc3e000
      RBP: ffff88082a2f5cc0 R08: ffff88182cc3e000 R09: 0000000000000000
      R10: ffff88182fc00180 R11: ffff88182fc00198 R12: ffff88182cc3e000
      R13: 0000000000000000 R14: ffff88182cc3e000 R15: ffff88082a2f5e20
      FS:  00007f259a64b6f0(0000) GS:ffff880864600000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
      CR2: 00007feb53f73da0 CR3: 000000102cc94000 CR4: 00000000000006e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process sysfsd (pid: 9345, threadinfo ffff88082a2f4000, task ffff88082a33cf00)
      Stack:
       ffff88182cc3e000 ffff88182cc3e000 0000000000000000 ffff88082a33cf00
      <0> ffff88082a2f5cf0 ffffffff811dff52 ffff88082a2f5cf0 ffff88082c525168
      <0> ffff88402c9fd2f8 ffff88402c9fd2f8 ffff88082a2f5d20 ffffffff811d7db2
      Call Trace:
       [<ffffffff811dff52>] pcie_aspm_exit_link_state+0xf5/0x11e
       [<ffffffff811d7db2>] pci_stop_bus_device+0x76/0x7e
       [<ffffffff811d7d67>] pci_stop_bus_device+0x2b/0x7e
       [<ffffffff811d7e4f>] pci_remove_bus_device+0x15/0xb9
       [<ffffffff811dcb8c>] remove_callback+0x29/0x3a
       [<ffffffff81135aeb>] sysfs_schedule_callback_work+0x15/0x6d
       [<ffffffff81072790>] worker_thread+0x19d/0x298
       [<ffffffff8107273b>] ? worker_thread+0x148/0x298
       [<ffffffff81135ad6>] ? sysfs_schedule_callback_work+0x0/0x6d
       [<ffffffff810765c0>] ? autoremove_wake_function+0x0/0x38
       [<ffffffff810725f3>] ? worker_thread+0x0/0x298
       [<ffffffff8107629e>] kthread+0x7d/0x85
       [<ffffffff8102eafa>] child_rip+0xa/0x20
       [<ffffffff8102e4bc>] ? restore_args+0x0/0x30
       [<ffffffff81076221>] ? kthread+0x0/0x85
       [<ffffffff8102eaf0>] ? child_rip+0x0/0x20
      Code: 89 e5 8a 50 48 31 c0 c0 ea 03 83 e2 07 e8 b2 de fe ff c9 48 98 c3 55 48 89 e5 41 56 49 89 fe 41 55 41 54 53 48 83 7f 10 00 74 04 <0f> 0b eb fe 48 8b 05 da 7d 63 00 4c 8d 60 e8 4c 89 e1 eb 24 4c
      RIP  [<ffffffff811df69b>] pcie_update_aspm_capable+0x15/0xbe
       RSP <ffff88082a2f5ca0>
      ---[ end trace 6ae0f65bdeab8555 ]---
      Reported-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Tested-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      761434a3
  5. 28 10月, 2009 1 次提交
  6. 16 10月, 2009 1 次提交
  7. 14 10月, 2009 1 次提交
  8. 12 10月, 2009 4 次提交
  9. 08 10月, 2009 4 次提交
    • K
      PCI: Prevent AER driver from being loaded on non-root port PCIE devices · 30fc24b5
      Kenji Kaneshige 提交于
      A bug was seen on boards using a PLX 8518 switch device which advertises
      AER on each of it's transparent bridges. The AER driver was loaded for
      each bridge and this driver tried to access the AER source ID register
      whenever an interrupt occured on the shared PCI INTX lines. The source
      ID register does not exist on non root port PCIE device's  which
      advertise AER and trying to access this register causes a unsupported
      request error on the bridge. Thus, when the next interrupt occurs,
      another error is found and the non existent source ID register is
      accessed again, and so it goes on.
      
      The result is a spammed dmesg with unsupported request PCI express
      errors on the bridge device that the AER driver is loaded against.
      Reported-by: NMalcolm Crossley <malcolm.crossley2@gefanuc.com>
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Tested-by: NMalcolm Crossley <malcolm.crossley2@gefanuc.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      30fc24b5
    • Y
      PCI: get larger bridge ranges when space is available · 308cf8e1
      Yinghai Lu 提交于
      Found one system:
      [   71.120590] pci 0000:40:05.0: scanning behind bridge, config 4f4a40, pass 0
      [   71.138283] PCI: Scanning bus 0000:4a
      [   71.140341] pci 0000:4a:00.0: found [15b3:6278] class 000c06 header type 00
      [   71.157173] pci 0000:4a:00.0: reg 10 64bit mmio: [0x000000-0x0fffff]
      [   71.161697] pci 0000:4a:00.0: reg 18 64bit mmio pref: [0x000000-0x7fffff]
      [   71.179403] pci 0000:4a:00.0: reg 20 64bit mmio pref: [0x000000-0xfffffff]
      [   71.185366] pci 0000:4a:00.0: calling quirk_resource_alignment+0x0/0x1dd
      [   71.200846] pci 0000:4a:00.0: disabling ASPM on pre-1.1 PCIe device.  You can enable it with 'pcie_aspm=force'
      [   71.219623] PCI: Fixups for bus 0000:4a
      [   71.222194] pci 0000:40:05.0: bridge 32bit mmio: [0xcf000000-0xcf0fffff]
      [   71.238662] pci 0000:40:05.0: bridge 64bit mmio pref: [0xcd800000-0xcdffffff]
      [   71.255793] PCI: Bus scan for 0000:4a returning with max=4a
      
      Device needs a big pref mmio, but BIOS doesn't allocate mmio to it aside
      from a small MMIO range.  Later, the kernel will not allocate resources to
      that to the device:
      [   99.574030] pci 0000:4a:00.0: BAR 4: can't allocate mem resource [0xd0000000-0xcdffffff]
      [   99.580102] pci 0000:4a:00.0: BAR 2: got res [0xcd800000-0xcdffffff] bus [0xcd800000-0xcdffffff] flags 0x12120c
      [   99.602307] pci 0000:4a:00.0: BAR 2: moved to bus [0xcd800000-0xcdffffff] flags 0x12120c
      [   99.615991] pci 0000:4a:00.0: BAR 0: got res [0xcf000000-0xcf0fffff] bus [0xcf000000-0xcf0fffff] flags 0x120204
      [   99.634499] pci 0000:4a:00.0: BAR 0: moved to bus [0xcf000000-0xcf0fffff] flags 0x120204
      [   99.654318] pci 0000:40:05.0: PCI bridge, secondary bus 0000:4a
      [   99.658766] pci 0000:40:05.0:   IO window: disabled
      [   99.675478] pci 0000:40:05.0:   MEM window: 0xcf000000-0xcf0fffff
      [   99.681663] pci 0000:40:05.0:   PREFETCH window: 0x000000cd800000-0x000000cdffffff
      
      So try to get a big range in the pci bridge if there is no child using
      that range.  With the patch we get:
      [   99.104525] pci 0000:4a:00.0: BAR 4: got res [0xfc080000000-0xfc08fffffff] bus [0xfc080000000-0xfc08fffffff] flags 0x12120c
      [   99.123624] pci 0000:4a:00.0: BAR 4: moved to bus [0xfc080000000-0xfc08fffffff] flags 0x12120c
      [   99.131977] pci 0000:4a:00.0: BAR 2: got res [0xfc090000000-0xfc0907fffff] bus [0xfc090000000-0xfc0907fffff] flags 0x12120c
      [   99.149788] pci 0000:4a:00.0: BAR 2: moved to bus [0xfc090000000-0xfc0907fffff] flags 0x12120c
      [   99.169248] pci 0000:4a:00.0: BAR 0: got res [0xc0200000-0xc02fffff] bus [0xc0200000-0xc02fffff] flags 0x120204
      [   99.189508] pci 0000:4a:00.0: BAR 0: moved to bus [0xc0200000-0xc02fffff] flags 0x120204
      [   99.206402] pci 0000:40:05.0: PCI bridge, secondary bus 0000:4a
      [   99.210637] pci 0000:40:05.0:   IO window: disabled
      [   99.224856] pci 0000:40:05.0:   MEM window: 0xc0200000-0xc03fffff
      [   99.230019] pci 0000:40:05.0:   PREFETCH window: 0x000fc080000000-0x000fc097ffffff
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      308cf8e1
    • R
      PCI: pci.c: fix kernel-doc notation · 19eea630
      Randy Dunlap 提交于
      Fix kernel-doc notation (& warnings) in pci/pci.c.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      19eea630
    • G
      PCI quirk: TI XIO200a erroneously reports support for fast b2b transfers · 1f56f4a2
      Gabe Black 提交于
      This quirk will disable fast back to back transfer on the secondary bus
      segment of the TI Bridge.
      Signed-off-by: NGabe Black <gabe.black@ni.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      1f56f4a2
  10. 07 10月, 2009 3 次提交
  11. 01 10月, 2009 1 次提交
  12. 26 9月, 2009 1 次提交
  13. 25 9月, 2009 1 次提交
  14. 24 9月, 2009 1 次提交
  15. 20 9月, 2009 2 次提交
  16. 19 9月, 2009 3 次提交
  17. 18 9月, 2009 12 次提交