1. 01 5月, 2012 5 次提交
  2. 17 4月, 2012 1 次提交
    • R
      PCI: Retry BARs restoration for Type 0 headers only · a6cb9ee7
      Rafael J. Wysocki 提交于
      Some shortcomings introduced into pci_restore_state() by commit
      26f41062 ("PCI: check for pci bar restore completion and retry")
      have been fixed by recent commit ebfc5b80 ("PCI: Fix regression in
      pci_restore_state(), v3"), but that commit treats all PCI devices as
      those with Type 0 configuration headers.
      
      That is not entirely correct, because Type 1 and Type 2 headers have
      different layouts.  In particular, the area occupied by BARs in Type 0
      config headers contains the secondary status register in Type 1 ones and
      it doesn't make sense to retry the restoration of that register even if
      the value read back from it after a write is not the same as the written
      one (it very well may be different).
      
      For this reason, make pci_restore_state() only retry the restoration
      of BARs for Type 0 config headers.  This effectively makes it behave
      as before commit 26f41062 for all header types except for Type 0.
      Tested-by: NMikko Vinni <mmvinni@yahoo.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a6cb9ee7
  3. 16 4月, 2012 1 次提交
    • R
      PCI: Fix regression in pci_restore_state(), v3 · ebfc5b80
      Rafael J. Wysocki 提交于
      Commit 26f41062 ("PCI: check for pci bar restore completion and
      retry") attempted to address problems with PCI BAR restoration on
      systems where FLR had not been completed before pci_restore_state() was
      called, but it did that in an utterly wrong way.
      
      First off, instead of retrying the writes for the BAR registers only, it
      did that for all of the PCI config space of the device, including the
      status register (whose value after the write quite obviously need not be
      the same as the written one).  Second, it added arbitrary delay to
      pci_restore_state() even for systems where the PCI config space
      restoration was successful at first attempt.  Finally, the mdelay(10) it
      added to every iteration of the writing loop was way too much of a delay
      for any reasonable device.
      
      All of this actually caused resume failures for some devices on Mikko's
      system.
      
      To fix the regression, make pci_restore_state() only retry the writes
      for BAR registers and only wait if the first read from the register
      doesn't return the written value.  Additionaly, make it wait for 1 ms,
      instead of 10 ms, after every failing attempt to write into config
      space.
      Reported-by: NMikko Vinni <mmvinni@yahoo.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ebfc5b80
  4. 07 4月, 2012 1 次提交
  5. 01 4月, 2012 1 次提交
    • M
      ASPM: Fix pcie devices with non-pcie children · c9651e70
      Matthew Garrett 提交于
      Since 3.2.12 and 3.3, some systems are failing to boot with a BUG_ON.
      Some other systems using the pata_jmicron driver fail to boot because no
      disks are detected.  Passing pcie_aspm=force on the kernel command line
      works around it.
      
      The cause: commit 4949be16 ("PCI: ignore pre-1.1 ASPM quirking when
      ASPM is disabled") changed the behaviour of pcie_aspm_sanity_check() to
      always return 0 if aspm is disabled, in order to avoid cases where we
      changed ASPM state on pre-PCIe 1.1 devices.
      
      This skipped the secondary function of pcie_aspm_sanity_check which was
      to avoid us enabling ASPM on devices that had non-PCIe children, causing
      trouble later on.  Move the aspm_disabled check so we continue to honour
      that scenario.
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=42979 and
                http://bugs.debian.org/665420
      
      Reported-by: Romain Francoise <romain@orebokech.com> # kernel panic
      Reported-by: Chris Holland <bandidoirlandes@gmail.com> # disk detection trouble
      Signed-off-by: NMatthew Garrett <mjg@redhat.com>
      Cc: stable@vger.kernel.org
      Tested-by: Hatem Masmoudi <hatem.masmoudi@gmail.com> # Dell Latitude E5520
      Tested-by: janek <jan0x6c@gmail.com> # pata_jmicron with JMB362/JMB363
      [jn: with more symptoms in log message]
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c9651e70
  6. 30 3月, 2012 1 次提交
  7. 21 3月, 2012 1 次提交
  8. 08 3月, 2012 1 次提交
  9. 05 3月, 2012 1 次提交
  10. 02 3月, 2012 1 次提交
    • R
      PCI / PCIe: Introduce command line option to disable ARI · 6748dcc2
      Rafael J. Wysocki 提交于
      There are PCIe devices on the market that report ARI support but
      then fail to initialize correctly when ARI is actually used.  This
      leads to situations in which kernels 2.6.34 and newer fail to handle
      systems where the previous kernels worked without any apparent
      problems.  Unfortunately, it is currently unknown how many such
      devices are there.
      
      For this reason, introduce a new kernel command line option,
      pci=noari, allowing users to disable PCIe ARI altogether if they
      see problems with PCIe device initialization.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      6748dcc2
  11. 28 2月, 2012 4 次提交
  12. 25 2月, 2012 13 次提交
  13. 24 2月, 2012 9 次提交
    • B
      PCI: collapse pcibios_resource_to_bus · fb127cb9
      Bjorn Helgaas 提交于
      Everybody uses the generic pcibios_resource_to_bus() supplied by the core
      now, so remove the ARCH_HAS_GENERIC_PCI_OFFSETS used during conversion.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      fb127cb9
    • B
      PCI: add generic pcibios_resource_to_bus() · 36a66cd6
      Bjorn Helgaas 提交于
      This replaces the generic versions of pcibios_resource_to_bus() and
      pcibios_bus_to_resource() in asm-generic/pci.h with versions that use
      pci_resource_to_bus() and pci_bus_to_resource().
      
      The replacements are equivalent except that they can apply host
      bridge window offsets when the arch has supplied them by using
      pci_add_resource_offset().
      
      Each arch can convert to using pci_add_resource_offset() individually by
      removing its device resource fixups from pcibios_fixup_bus() and supplying
      ARCH_HAS_GENERIC_PCI_OFFSETS.  ARCH_HAS_GENERIC_PCI_OFFSETS can be removed
      after all have converted.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      36a66cd6
    • B
      PCI: convert bus addresses to resource when reading BARs · 5bfa14ed
      Bjorn Helgaas 提交于
      Some PCI host bridges translate CPU addresses to PCI bus addresses.
      Previously, we initialized pci_dev resources with PCI bus addresses,
      then converted them to CPU addresses later in arch-specific code
      (pcibios_fixup_resources()), which leaves a window of time where the
      pci_dev resources are incorrect.
      
      This patch adds support in the core for this address translation.
      When the arch creates the root bus, it can supply the host bridge
      address translation information, and the core can use it to set the
      pci_dev resources correctly from the beginning.
      
      This gives us a way to fix the problem that quirks that run between device
      discovery and pcibios_fixup_resources() fail because they use pci_dev
      resources that haven't been converted.  The reference below is to one
      such problem that affected ARM and ia64.
      
      Note that this patch has no effect until an arch starts using
      pci_add_resource_offset() with a non-zero offset: before that, all
      all host bridge windows have a zero offset and pci_bus_to_resource()
      copies the pci_bus_region directly to the struct resource.
      
      Reference: https://lkml.org/lkml/2009/10/12/405Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      5bfa14ed
    • B
      PCI: add struct pci_host_bridge_window with CPU/bus address offset · 0efd5aab
      Bjorn Helgaas 提交于
      Some PCI host bridges apply an address offset, so bus addresses on PCI are
      different from CPU addresses.  This patch adds a way for architectures to
      tell the PCI core about this offset.  For example:
      
          LIST_HEAD(resources);
          pci_add_resource_offset(&resources, host->io_space, host->io_offset);
          pci_add_resource_offset(&resources, host->mem_space, host->mem_offset);
          pci_scan_root_bus(parent, bus, ops, sysdata, &resources);
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      0efd5aab
    • B
      PCI: add struct pci_host_bridge and a list of all bridges found · 5a21d70d
      Bjorn Helgaas 提交于
      This adds a list of all PCI host bridges we find and a way to look up
      the host bridge from a pci_dev.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      5a21d70d
    • B
      PCI: don't publish new root bus until it's fully initialized · a5390aa6
      Bjorn Helgaas 提交于
      When pci_create_root_bus() adds the new struct pci_bus to the global
      pci_root_buses list, the bus becomes visible to other parts of the
      kernel, so it should be fully initialized.
      
      This patch delays adding the bus to the pci_root_buses list until after
      all the struct pci_bus initialization is finished.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      a5390aa6
    • B
      PCI: make pci_flags non-weak · 844393f4
      Bjorn Helgaas 提交于
      No architecture defines its own pci_flags, so the core symbol does not
      need to be weak.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      844393f4
    • B
      PCI: make pci_flags always available · 47087700
      Bjorn Helgaas 提交于
      If we move resource assignment functions into the core, we'll still
      need a way for architectures to prevent reassignment, e.g., the
      "pci_probe_only" functionality, and we'll need a generic, always
      available way the core can test for that.  The "pci_flags"
      arrangement used by several architectures seems like a convenient
      way to do this.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      47087700
    • M
      PCI: Add pcie_hp=nomsi to disable MSI/MSI-X for pciehp driver · 7570a333
      MUNEDA Takahiro 提交于
      Add a parameter to avoid using MSI/MSI-X for PCIe native hotplug; it's
      known to be buggy on some platforms.
      
      In my environment, while shutting down, following stack trace is shown
      sometimes.
      
        irq 16: nobody cared (try booting with the "irqpoll" option)
        Pid: 1081, comm: reboot Not tainted 3.2.0 #1
        Call Trace:
         <IRQ>  [<ffffffff810cec1d>] __report_bad_irq+0x3d/0xe0
         [<ffffffff810cee1c>] note_interrupt+0x15c/0x210
         [<ffffffff810cc485>] handle_irq_event_percpu+0xb5/0x210
         [<ffffffff810cc621>] handle_irq_event+0x41/0x70
         [<ffffffff810cf675>] handle_fasteoi_irq+0x55/0xc0
         [<ffffffff81015356>] handle_irq+0x46/0xb0
         [<ffffffff814fbe9d>] do_IRQ+0x5d/0xe0
         [<ffffffff814f146e>] common_interrupt+0x6e/0x6e
         [<ffffffff8106b040>] ? __do_softirq+0x60/0x210
         [<ffffffff8108aeb1>] ? hrtimer_interrupt+0x151/0x240
         [<ffffffff814fb5ec>] call_softirq+0x1c/0x30
         [<ffffffff810152d5>] do_softirq+0x65/0xa0
         [<ffffffff8106ae9d>] irq_exit+0xbd/0xe0
         [<ffffffff814fbf8e>] smp_apic_timer_interrupt+0x6e/0x99
         [<ffffffff814f9e5e>] apic_timer_interrupt+0x6e/0x80
         <EOI>  [<ffffffff814f0fb1>] ? _raw_spin_unlock_irqrestore+0x11/0x20
         [<ffffffff812629fc>] pci_bus_write_config_word+0x6c/0x80
         [<ffffffff81266fc2>] pci_intx+0x52/0xa0
         [<ffffffff8127de3d>] pci_intx_for_msi+0x1d/0x30
        [<ffffffff8127e4fb>] pci_msi_shutdown+0x7b/0x110
         [<ffffffff81269d34>] pci_device_shutdown+0x34/0x50
         [<ffffffff81326c4f>] device_shutdown+0x2f/0x140
         [<ffffffff8107b981>] kernel_restart_prepare+0x31/0x40
         [<ffffffff8107b9e6>] kernel_restart+0x16/0x60
         [<ffffffff8107bbfd>] sys_reboot+0x1ad/0x220
         [<ffffffff814f4b90>] ? do_page_fault+0x1e0/0x460
         [<ffffffff811942d0>] ? __sync_filesystem+0x90/0x90
         [<ffffffff8105c9aa>] ? __cond_resched+0x2a/0x40
         [<ffffffff814ef090>] ? _cond_resched+0x30/0x40
         [<ffffffff81169e17>] ? iterate_supers+0xb7/0xd0
         [<ffffffff814f9382>] system_call_fastpath+0x16/0x1b
        handlers:
        [<ffffffff8138a0f0>] usb_hcd_irq
        [<ffffffff8138a0f0>] usb_hcd_irq
        [<ffffffff8138a0f0>] usb_hcd_irq
        Disabling IRQ #16
      
      An un-wanted interrupt is generated when PCI driver switches from
      MSI/MSI-X to INTx while shutting down the device.  The interrupt does
      not happen if MSI/MSI-X is not used on the device.
      I confirmed that this problem does not happen if pcie_hp=nomsi was
      specified and hotplug operation worked fine as usual.
      
      v2: Automatically disable MSI/MSI-X against following device:
          PCI bridge: Integrated Device Technology, Inc. Device 807f (rev 02)
      v3: Based on the review comment, combile the if statements.
      v4: Removed module parameter.
          Move some code to build pciehp as a module.
          Move device specific code to driver/pci/quirks.c.
      v5: Drop a device specific code until getting a vendor statement.
      Reviewed-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NMUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      7570a333