1. 05 11月, 2009 5 次提交
    • B
      PCI: print resources consistently with %pRt · a369c791
      Bjorn Helgaas 提交于
      This uses %pRt to print additional resource information (type, size,
      prefetchability, etc.) consistently.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      a369c791
    • T
      PCI: pci_dfl_cache_line_size is __devinitdata · 98e724c7
      Tejun Heo 提交于
      pci_dfl_cache_line_size is marked as __initdata but referenced by
      pci_init() which is __devinit.  Make it __devinitdata instead of
      __initdata.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      98e724c7
    • T
      pccard: configure CLS on attach · 15ea76d4
      Tejun Heo 提交于
      For non hotplug PCI devices, the system firmware usually configures
      CLS correctly.  For pccard devices system firmware can't do it and
      Linux PCI layer doesn't do it either.  Unfortunately this leads to
      poor performance for certain devices (sata_sil).  Unless MWI, which
      requires separate configuration, is to be used, CLS doesn't affect
      correctness, so the configuration should be harmless.
      
      This patch makes pci_set_cacheline_size() always built and export it
      and make pccard call it during attach.
      
      Please note that some other PCI hotplug drivers (shpchp and pciehp)
      also configure CLS on hotplug.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Daniel Ritz <daniel.ritz@gmx.ch>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Greg KH <greg@kroah.com>
      Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Cc: Axel Birndt <towerlexa@gmx.de>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      15ea76d4
    • T
      sparc64/PCI: drop PCI_CACHE_LINE_BYTES · 4c0eec7a
      Tejun Heo 提交于
      sparc64 is now the only user of PCI_CACHE_LINE_BYTES.  Drop it and set
      pci_dfl_cache_line_size from pcibios_init() instead and drop
      PCI_CACHE_LINE_BYTES handling from generic pci code.
      
      Orignally-From: David Miller <davem@davemloft.net>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      4c0eec7a
    • J
      PCI: determine CLS more intelligently · ac1aa47b
      Jesse Barnes 提交于
      Till now, CLS has been determined either by arch code or as
      L1_CACHE_BYTES.  Only x86 and ia64 set CLS explicitly and x86 doesn't
      always get it right.  On most configurations, the chance is that
      firmware configures the correct value during boot.
      
      This patch makes pci_init() determine CLS by looking at what firmware
      has configured.  It scans all devices and if all non-zero values
      agree, the value is used.  If none is configured or there is a
      disagreement, pci_dfl_cache_line_size is used.  arch can set the dfl
      value (via PCI_CACHE_LINE_BYTES or pci_dfl_cache_line_size) or
      override the actual one.
      
      ia64, x86 and sparc64 updated to set the default cls instead of the
      actual one.
      
      While at it, declare pci_cache_line_size and pci_dfl_cache_line_size
      in pci.h and drop private declarations from arch code.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NDavid Miller <davem@davemloft.net>
      Acked-by: NGreg KH <gregkh@suse.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      ac1aa47b
  2. 12 10月, 2009 1 次提交
  3. 08 10月, 2009 1 次提交
  4. 07 10月, 2009 1 次提交
    • R
      PCI PM: Read device power state from register after updating it · e13cdbd7
      Rafael J. Wysocki 提交于
      After attempting to change the power state of a PCI device
      pci_raw_set_power_state() doesn't check if the value it wrote into
      the device's PCI_PM_CTRL register has been stored in there, but
      unconditionally modifies the device's current_state field to reflect
      the change.  This may cause problems to happen if the power state of
      the device hasn't been changed in fact, because it will make the PCI
      PM core make a wrong assumption.
      
      To prevent such situations from happening modify
      pci_raw_set_power_state() so that it reads the device's PCI_PM_CTRL
      register after writing into it and uses the value read from the
      register to update the device's current_state field.  Also make it
      print a message saying that the device refused to change its power
      state as requested (returning an error code in such cases would cause
      suspend regressions to appear on some systems, where device drivers'
      suspend routines return error codes if pci_set_power_state() fails).
      Reviewed-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      e13cdbd7
  5. 15 9月, 2009 1 次提交
    • R
      PCI: Clear saved_state after the state has been restored · 4b77b0a2
      Rafael J. Wysocki 提交于
      Some PCI devices fail if their standard configuration registers are
      restored twice in a row.  Prevent this from happening by making
      pci_restore_state() clear the saved_state flag of the device right
      after the device's standard configuration registers have been
      populated with the previously saved values.
      
      Simplify PCI PM callbacks by removing the direct clearing of
      state_saved from them, as it shouldn't be necessary any more (except
      in pci_pm_thaw(), where it has to be cleared, so that the values saved
      during the "freeze" phase of hibernation are not used later by mistake).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      4b77b0a2
  6. 10 9月, 2009 5 次提交
  7. 21 8月, 2009 1 次提交
  8. 02 7月, 2009 1 次提交
  9. 30 6月, 2009 1 次提交
  10. 17 6月, 2009 7 次提交
  11. 16 6月, 2009 1 次提交
  12. 12 6月, 2009 2 次提交
    • A
      PCI: Add support for turning PCIe ECRC on or off · 43c16408
      Andrew Patterson 提交于
      Adds support for PCI Express transaction layer end-to-end CRC checking
      (ECRC).  This patch will enable/disable ECRC checking by setting/clearing
      the ECRC Check Enable and/or ECRC Generation Enable bits for devices that
      support ECRC.
      
      The ECRC setting is controlled by the "pci=ecrc=<policy>" command-line
      option. If this option is not set or is set to 'bios", the enable and
      generation bits are left in whatever state that firmware/BIOS set them to.
      The "off" setting turns them off, and the "on" option turns them on (if the
      device supports it).
      
      Turning ECRC on or off can be a data integrity versus performance
      tradeoff.  In theory, turning it on will catch more data errors, turning
      it off means possibly better performance since CRC does not need to be
      calculated by the PCIe hardware and packet sizes are reduced.
      Signed-off-by: NAndrew Patterson <andrew.patterson@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      43c16408
    • R
      PCI PM: Follow PCI_PM_CTRL_NO_SOFT_RESET during transitions from D3 · f62795f1
      Rafael J. Wysocki 提交于
      According to the PCI PM specification (PCI Bus Power Management
      Interface Specification, Rev. 1.2, Section 5.4.1) we are supposed to
      reinitialize devices that have PCI_PM_CTRL_NO_SOFT_RESET clear during
      all transitions from PCI_D3hot to PCI_D0, but we only do it if the
      device's current_state field is equal to PCI_UNKNOWN.
      
      This may lead to problems if a device with PCI_PM_CTRL_NO_SOFT_RESET
      unset is put into PCI_D3hot at run time by its driver and
      pci_set_power_state() is used to put it back into PCI_D0, because in
      that case the device will remain uninitialized after
      pci_set_power_state() has returned.  Prevent that from happening by
      modifying pci_raw_set_power_state() to reinitialize devices with
      PCI_PM_CTRL_NO_SOFT_RESET unset during all transitions from D3 to D0.
      
      Cc: stable@kernel.org
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      f62795f1
  13. 20 5月, 2009 1 次提交
    • R
      PCI PM: Fix initialization and kexec breakage for some devices · b3bad72e
      Rafael J. Wysocki 提交于
      Recent PCI PM changes introduced a bug that causes some devices to be
      mishandled after kexec and during early initialization.  The failure
      scenario in the kexec case is the following:
      
      * Assume a PCI device is not power-manageable by the platform and has
        PCI_PM_CTRL_NO_SOFT_RESET set in PMCSR.
      * The device is put into D3 before kexec (using the native PCI PM).
      * After kexec, pci_setup_device() sets the device's power state to
        PCI_UNKNOWN.
      * pci_set_power_state(dev, PCI_D0) is called by the device's driver.
      * __pci_start_power_transition(dev, PCI_D0) is called and since the
        device is not power-manageable by the platform, it causes
        pci_update_current_state(dev, PCI_D0) to be called.  As a result
        the device's current_state field is updated to PCI_D3, in
        accordance with the contents of its PCI PM registers.
      * pci_raw_set_power_state() is called and it changes the device power
        state to D0.  *However*, it should also call pci_restore_bars() to
        reinitialize the device, but it doesn't, because the device's
        current_state field has been modified earlier.
      
      To prevent this from happening, modify pci_platform_power_transition()
      so that it doesn't use pci_update_current_state() to update the
      current_state field for devices that aren't power-manageable by the
      platform.  Instead, this field should be updated directly for devices
      that don't support the native PCI PM.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b3bad72e
  14. 23 4月, 2009 1 次提交
    • Y
      PCI: only save/restore existent registers in the PCIe capability · 1b6b8ce2
      Yu Zhao 提交于
      PCIe 1.1 base neither requires the endpoint to implement the entire
      PCIe capability structure nor specifies default values of registers
      that are not implemented by the device. So we only save and restore
      registers that must be implemented by different device types if the
      device PCIe capability version is 1.
      
      PCIe 1.1 Capability Structure Expansion ECN and PCIe 2.0 requires
      all registers in the PCIe capability to be either implemented or
      hardwired to 0. Their PCIe capability version is 2.
      Signed-off-by: NYu Zhao <yu.zhao@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      1b6b8ce2
  15. 07 4月, 2009 1 次提交
    • Y
      PCI: Setup disabled bridges even if buses are added · 296ccb08
      Yuji Shimada 提交于
      This patch sets up disabled bridges even if buses have already been
      added.
      
      pci_assign_unassigned_resources is called after buses are added.
      pci_assign_unassigned_resources calls pci_bus_assign_resources.
      pci_bus_assign_resources calls pci_setup_bridge to configure BARs of
      bridges.
      
      Currently pci_setup_bridge returns immediately if the bus have already
      been added. So pci_assign_unassigned_resources can't configure BARs of
      bridges that were added in a disabled state; this patch fixes the issue.
      
      On logical hot-add, we need to prevent the kernel from re-initializing
      bridges that have already been initialized. To achieve this,
      pci_setup_bridge returns immediately if the bridge have already been
      enabled.
      
      We don't need to check whether the specified bus is a root bus or not.
      pci_setup_bridge is not called on a root bus, because a root bus does
      not have a bridge.
      
      The patch adds a new helper function, pci_is_enabled. I made the
      function name similar to pci_is_managed. The codes which use
      enable_cnt directly are changed to use pci_is_enabled.
      Acked-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NYuji Shimada <shimada-yxb@necst.nec.co.jp>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      296ccb08
  16. 31 3月, 2009 5 次提交
  17. 30 3月, 2009 1 次提交
  18. 27 3月, 2009 1 次提交
  19. 21 3月, 2009 3 次提交