1. 23 2月, 2010 7 次提交
  2. 05 2月, 2010 1 次提交
    • A
      CS5536: apply pci quirk for BIOS SMBUS bug · 73d2eaac
      Andres Salomon 提交于
      The new cs5535-* drivers use PCI header config info rather than MSRs to
      determine the memory region to use for things like GPIOs and MFGPTs.  As
      anticipated, we've run into a buggy BIOS:
      
      [    0.081818] pci 0000:00:14.0: reg 10: [io  0x6000-0x7fff]
      [    0.081906] pci 0000:00:14.0: reg 14: [io  0x6100-0x61ff]
      [    0.082015] pci 0000:00:14.0: reg 18: [io  0x6200-0x63ff]
      [    0.082917] pci 0000:00:14.2: reg 20: [io  0xe000-0xe00f]
      [    0.083551] pci 0000:00:15.0: reg 10: [mem 0xa0010000-0xa0010fff]
      [    0.084436] pci 0000:00:15.1: reg 10: [mem 0xa0011000-0xa0011fff]
      [    0.088816] PCI: pci_cache_line_size set to 32 bytes
      [    0.088938] pci 0000:00:14.0: address space collision: [io 0x6100-0x61ff] already in use
      [    0.089052] pci 0000:00:14.0: can't reserve [io  0x6100-0x61ff]
      
      This is a Soekris board, and its BIOS sets the size of the PCI ISA bridge
      device's BAR0 to 8k.  In reality, it should be 8 bytes (BAR0 is used for
      SMBus stuff).  This quirk checks for an incorrect size, and resets it
      accordingly.
      Signed-off-by: NAndres Salomon <dilinger@collabora.co.uk>
      Tested-by: NLeigh Porter <leigh@leighporter.org>
      Tested-by: NJens Rottmann <JRottmann@LiPPERTEmbedded.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      73d2eaac
  3. 01 2月, 2010 1 次提交
  4. 29 1月, 2010 1 次提交
  5. 26 1月, 2010 1 次提交
  6. 05 1月, 2010 5 次提交
    • Y
      PCIe AER: prevent AER injection if hardware masks error reporting · b49bfd32
      Youquan,Song 提交于
      The Correcteable/Uncorrectable Error Mask Registers are used by PCIe AER
      driver which will controls the reporting of individual errors to PCIe RC
      via PCIe error messages.
      
      If hardware masks special error reporting to RC, the aer_inject driver
      should not inject aer error.
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NYouquan, Song <youquan.song@intel.com>
      Acked-by: NYing, Huang <ying.huang@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b49bfd32
    • R
      PCI/PM: Use per-device D3 delays · 1ae861e6
      Rafael J. Wysocki 提交于
      It turns out that some PCI devices require extra delays when changing
      power state from D3 to D0 (and the other way around).  Although this
      is against the PCI specification, we can handle it quite easily by
      allowing drivers to define arbitrary D3 delays for devices known to
      require extra time for switching power states.
      
      Introduce additional field d3_delay in struct pci_dev and use it to
      store the value of the device's D0->D3 delay, in miliseconds.  Make
      the PCI PM core code use the per-device d3_delay unless
      pci_pm_d3_delay is greater (in which case the latter is used).
      [This also allows the driver to specify d3_delay shorter than the
       10 ms required by the PCI standard if the device is known to be able
       to handle that.]
      
      Make the sky2 driver set d3_delay to 150 for devices handled by it.
      
      Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14730 which is a
      listed regression from 2.6.30.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      1ae861e6
    • D
      PCI: Check the node argument passed to cpumask_of_node · 6be954d1
      David John 提交于
      Commit e0cd5160 "PCI: derive nearby CPUs from device's instead of bus'
      NUMA information" causes an null pointer dereference when reading from
      the sysfs attributes local_cpu* on Intel machines with no ACPI NUMA
      proximity info, since dev->numa_node gets set to -1 for all PCI devices,
      which then gets passed to cpumask_of_node.
      
      Add a check to prevent this.
      Signed-off-by: NDavid John <davidjon@xenontk.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      6be954d1
    • Y
      PCI: AER: fix aer inject result in kernel oops · 46256f83
      Youquan,Song 提交于
      If the BIOS does not export _OSC to allow OS take over the PCIe AER, the
      pcie aer driver will not initialize the aer service. However, the
      aer_inject driver does not check this scenario, which results in a kernel
      oops when injecting an aer error into OS.  For example:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000350
      IP: [<ffffffff812e08f7>] _spin_lock_irqsave+0xc/0x23
      PGD 155c41067 PUD 157fe0067 PMD 0
      Oops: 0002 [#1] SMP
      Pid: 5119, comm: aer-inject Not tainted 2.6.32-rc8-mce #2
      RIP: 0010:[<ffffffff812e08f7>]  [<ffffffff812e08f7>] _spin_lock_irqsave+0xc/0x23
      RSP: 0018:ffff880157f81e28  EFLAGS: 00010096
      RAX: 0000000000000296 RBX: 0000000000000000 RCX: 0000000000000100
      RDX: 0000000000010000 RSI: 0000000000000246 RDI: 0000000000000350
      RBP: ffff880157f81e28 R08: 0000000000000004 R09: ffff880157f81dac
      R10: ffff88015a666f60 R11: ffff88015a666f40 R12: ffff88015758cc00
      R13: 0000000000000350 R14: 0000000000000000 R15: 0000000000000100
      FS:  00007f4d4a66e6f0(0000) GS:ffff8800282e0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 0000000000000350 CR3: 000000015661a000 CR4: 00000000000006e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process aer-inject (pid: 5119, threadinfo ffff880157f80000, task ffff8801585f4340)
      Stack:
       ffff880157f81e78 ffffffff811b1615 ffff880157f81e78 ffffffff81222823
      Call Trace:
       [<ffffffff811b1615>] aer_irq+0x38/0x117
       [<ffffffff81222823>] ? device_for_each_child+0x5f/0x6f
       [<ffffffffa00967bf>] aer_inject_write+0x409/0x45e [aer_inject]
       [<ffffffff810eb80e>] vfs_write+0xae/0x16a
       [<ffffffff810eb98e>] sys_write+0x47/0x6e
       [<ffffffff8100ba2b>] system_call_fastpath+0x16/0x1b
      RIP  [<ffffffff812e08f7>] _spin_lock_irqsave+0xc/0x23
       RSP <ffff880157f81e28>
      CR2: 0000000000000350
      
      So check the _OSC before assuming that AER is available to the OS.
      Signed-off-by: NYouquan, Song <youquan.song@intel.com>
      Acked-by: NYing, Huang <ying.huang@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      46256f83
    • H
      PCI: pcie portdrv: style cleanup · 40da4186
      Hidetoshi Seto 提交于
      No change in logic.
      
      Before:
        drivers/pci/pcie/portdrv_core.c:
          total: 7 errors, 2 warnings, 508 lines checked
        drivers/pci/pcie/portdrv_pci.c:
          total: 4 errors, 2 warnings, 300 lines checked
      
      After:
        drivers/pci/pcie/portdrv_core.c:
          total: 0 errors, 0 warnings, 506 lines checked
        drivers/pci/pcie/portdrv_pci.c:
          total: 0 errors, 0 warnings, 299 lines checked
      Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      40da4186
  7. 01 1月, 2010 2 次提交
  8. 17 12月, 2009 8 次提交
  9. 16 12月, 2009 1 次提交
  10. 08 12月, 2009 6 次提交
    • K
      Revert "Intel IOMMU: Avoid memory allocation failures in dma map api calls" · 354bb65e
      KOSAKI Motohiro 提交于
      commit eb3fa7cb said Intel IOMMU
      
          Intel IOMMU driver needs memory during DMA map calls to setup its
          internal page tables and for other data structures.  As we all know
          that these DMA map calls are mostly called in the interrupt context
          or with the spinlock held by the upper level drivers(network/storage
          drivers), so in order to avoid any memory allocation failure due to
          low memory issues, this patch makes memory allocation by temporarily
          setting PF_MEMALLOC flags for the current task before making memory
          allocation calls.
      
          We evaluated mempools as a backup when kmem_cache_alloc() fails
          and found that mempools are really not useful here because
           1) We don't know for sure how much to reserve in advance
           2) And mempools are not useful for GFP_ATOMIC case (as we call
              memory alloc functions with GFP_ATOMIC)
      
          (akpm: point 2 is wrong...)
      
      The above description doesn't justify to waste system emergency memory
      at all. Non MM subsystem must not use PF_MEMALLOC. Memory reclaim need
      few memory, anyone must not prevent it. Otherwise the system cause
      mysterious hang-up and/or OOM Killer invokation.
      
      Plus, akpm already pointed out what we should do.
      
      Then, this patch revert it.
      
      Cc: Keshavamurthy Anil S <anil.s.keshavamurthy@intel.com>
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      354bb65e
    • C
      intel-iommu: ignore page table validation in pass through mode · 1672af11
      Chris Wright 提交于
      We are seeing a bug when booting w/ iommu=pt with current upstream
      (bisect blames 19943b0e "intel-iommu:
      Unify hardware and software passthrough support).
      
      The issue is specific to this loop during identity map initialization
      of each device:
      
      domain_context_mapping_one(si_domain, ..., CONTEXT_TT_PASS_THROUGH)
      ...
      		/* Skip top levels of page tables for
      		* iommu which has less agaw than default.
      		*/
      		for (agaw = domain->agaw; agaw != iommu->agaw; agaw--) {
      			pgd = phys_to_virt(dma_pte_addr(pgd));
      			if (!dma_pte_present(pgd)) {      <------ failing here
      				spin_unlock_irqrestore(&iommu->lock, flags);
      			return -ENOMEM;
      		}
      
      This box has 2 iommu's in it.  The catchall iommu has MGAW == 48, and
      SAGAW == 4.  The other iommu has MGAW == 39, SAGAW == 2.
      
      The device that's failing the above pgd test is the only device connected
      to the non-catchall iommu, which has a smaller address width than the
      domain default.  This test is not necessary since the context is in PT
      mode and the ASR is ignored.
      
      Thanks to Don Dutile for discovering and debugging this one.
      
      Cc: stable@kernel.org
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      1672af11
    • D
      intel-iommu: Fix oops with intel_iommu=igfx_off · 44cd613c
      David Woodhouse 提交于
      The hotplug notifier will call find_domain() to see if the device in
      question has been assigned an IOMMU domain. However, this should never
      be called for devices with a "dummy" domain, such as graphics devices
      when intel_iommu=igfx_off is set and the corresponding IOMMU isn't even
      initialised. If you do that, it'll oops as it dereferences the (-1)
      pointer.
      
      The notifier function should check iommu_no_mapping() for the
      device before doing anything else.
      
      Cc: stable@kernel.org
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      44cd613c
    • D
      intel-iommu: Check for an RMRR which ends before it starts. · 5595b528
      David Woodhouse 提交于
      Some HP BIOSes report an RMRR region (a region which needs a 1:1 mapping
      in the IOMMU for a given device) which has an end address lower than its
      start address. Detect that and warn, rather than triggering the
      BUG() in dma_pte_clear_range().
      
      Cc: stable@kernel.org
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      5595b528
    • D
      intel-iommu: Apply BIOS sanity checks for interrupt remapping too. · 6ecbf01c
      David Woodhouse 提交于
      The BIOS errors where an IOMMU is reported either at zero or a bogus
      address are causing problems even when the IOMMU is disabled -- because
      interrupt remapping uses the same hardware. Ensure that the checks get
      applied for the interrupt remapping initialisation too.
      
      Cc: stable@kernel.org
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      6ecbf01c
    • C
      intel-iommu: Detect DMAR in hyperspace at probe time. · 2c992208
      Chris Wright 提交于
      Many BIOSes will lie to us about the existence of an IOMMU, and claim
      that there is one at an address which actually returns all 0xFF.
      
      We need to detect this early, so that we know we don't have a viable
      IOMMU and can set up swiotlb before it's too late.
      
      Cc: stable@kernel.org
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      2c992208
  11. 05 12月, 2009 7 次提交
    • K
      PCI: fix coding style issue in pci_save_state() · 9e0b5b2c
      Kleber Sacilotto de Souza 提交于
      Remove a stray space in pci_save_state().
      Signed-off-by: NKleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      9e0b5b2c
    • C
      PCI: add pci_request_acs · 5d990b62
      Chris Wright 提交于
      Commit ae21ee65 "PCI: acs p2p upsteram
      forwarding enabling" doesn't actually enable ACS.
      
      Add a function to pci core to allow an IOMMU to request that ACS
      be enabled.  The existing mechanism of using iommu_found() in the pci
      core to know when ACS should be enabled doesn't actually work due to
      initialization order;  iommu has only been detected not initialized.
      
      Have Intel and AMD IOMMUs request ACS, and Xen does as well during early
      init of dom0.
      
      Cc: Allen Kay <allen.m.kay@intel.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      5d990b62
    • K
      PCI: fix BUG_ON triggered by logical PCIe root port removal · b26a34aa
      Kenji Kaneshige 提交于
      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>
      Tested-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b26a34aa
    • A
      PCI: remove ifdefed pci_cleanup_aer_correct_error_status · 638bba08
      Andrew Patterson 提交于
      The pci_cleanup_aer_correct_error_status() function has been
      #if 0'd out since 2.6.25.  Time to remove the dead code.
      Signed-off-by: NAndrew Patterson <andrew.patterson@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      638bba08
    • A
      PCI: unconditionally clear AER uncorr status register during cleanup · 6cdfd995
      Andrew Patterson 提交于
      The current implementation of pci_cleanup_aer_uncorrect_error_status
      only clears either fatal or non-fatal error status bits depending
      on the state of the I/O channel. This implementation will then often
      leave some bits set after PCI error recovery completes.  The uncleared bit
      settings will then be falsely reported the next time an AER interrupt is
      generated for that hierarchy. An easy way to illustrate this issue is to
      use the aer-inject module to simultaneously inject both an uncorrectable
      non-fatal and uncorrectable fatal error.  One of the errors will not be
      cleared.
      
      This patch resolves this issue by unconditionally clearing all bits in
      the AER uncorrectable status register. All settings and corrective action
      strategies are saved and determined before
      pci_cleanup_aer_uncorrect_error_status is called, so this change should not
      affect errory handling functionality.
      Signed-off-by: NAndrew Patterson <andrew.patterson@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      6cdfd995
    • K
      PCI: portdrv: remove redundant definitions · f9f45604
      Kenji Kaneshige 提交于
      Remove unnecessary definitions from portdrv.h and use generic
      definitions instead.
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      f9f45604
    • K
      PCI: portdrv: remove unnecessary struct pcie_port_data · 694f88ef
      Kenji Kaneshige 提交于
      Remove 'port_type' field in struct pcie_port_data(), because we can
      get port type information from struct pci_dev. With this change, this
      patch also does followings:
      
       - Remove struct pcie_port_data because it no longer has any field.
       - Remove portdrv private definitions about port type (PCIE_RC_PORT,
         PCIE_SW_UPSTREAM_PORT and PCIE_SW_DOWNSTREAM_PORT), and use generic
         definitions instead.
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      694f88ef