1. 27 3月, 2018 1 次提交
  2. 21 2月, 2018 1 次提交
  3. 27 1月, 2018 1 次提交
  4. 11 12月, 2017 1 次提交
  5. 06 11月, 2017 1 次提交
  6. 06 10月, 2017 1 次提交
  7. 31 8月, 2017 1 次提交
  8. 02 5月, 2017 2 次提交
  9. 24 1月, 2017 1 次提交
    • G
      powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe() · f05fea5b
      Gavin Shan 提交于
      In __eeh_clear_pe_frozen_state(), we should pass the flag's value
      instead of its address to eeh_unfreeze_pe(). The isolated flag is
      cleared if no error returned from __eeh_clear_pe_frozen_state(). We
      never observed the error from the function. So the isolated flag should
      have been always cleared, no real issue is caused because of the misused
      @flag.
      
      This fixes the code by passing the value of @flag to eeh_unfreeze_pe().
      
      Fixes: 5cfb20b9 ("powerpc/eeh: Emulate EEH recovery for VFIO devices")
      Cc: stable@vger.kernel.org # v3.18+
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      f05fea5b
  10. 01 12月, 2016 1 次提交
  11. 22 11月, 2016 2 次提交
    • R
      powerpc/eeh: Refactor EEH PE reset functions · 6654c936
      Russell Currey 提交于
      eeh_pe_reset and eeh_reset_pe are two different functions in the same
      file which do mostly the same thing.  Not only is this confusing, but
      potentially causes disrepancies in functionality, notably eeh_reset_pe
      as it does not check return values for failure.
      
      Refactor this into the following:
      
       - eeh_pe_reset(): stays as is, performs a single operation, exported
       - eeh_pe_reset_full(): new, full reset process that calls eeh_pe_reset()
       - eeh_reset_pe(): removed and replaced by eeh_pe_reset_full()
       - eeh_reset_pe_once(): removed
      Signed-off-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      6654c936
    • R
      powerpc/pci: Always print PHB and PE numbers as hexadecimal · 1f52f176
      Russell Currey 提交于
      PHB, PE (and by association MVE) numbers are printed as a mix of decimal
      and hexadecimal throughout the kernel.  This can be misleading, so make
      them all hexadecimal.
      
      Standardising on hex instead of dec because:
      
       - PHB numbers are presented in hex in sysfs/debugfs (and lspci, etc)
       - PE numbers are presented as hex in sysfs and parsed in hex in debugfs
      
      The only place I think this could cause confusing are the messages during
      boot, i.e.
      
      	pci 000a:01     : [PE# 000] Secondary bus 1 associated with PE#0
      
      which can be a quick way to check PE numbers.  pe_level_printk() will
      only print two characters instead of three, so the above would be
      
      	pci 000a:01     : [PE# 00] Secondary bus 1 associated with PE#0
      
      which gives a hint it's in hex.
      Signed-off-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      1f52f176
  12. 23 9月, 2016 2 次提交
  13. 28 6月, 2016 1 次提交
  14. 17 6月, 2016 1 次提交
    • G
      powerpc/eeh: Fix invalid cached PE primary bus · a3aa256b
      Gavin Shan 提交于
      The PE primary bus cannot be got from its child devices when having
      full hotplug in error recovery. The PE primary bus is cached, which
      is done in commit <05ba75f8> ("powerpc/eeh: Fix stale cached primary
      bus"). In eeh_reset_device(), the flag (EEH_PE_PRI_BUS) is cleared
      before the PCI hot remove. eeh_pe_bus_get() then returns NULL as the
      PE primary bus in pnv_eeh_reset() and it crashes the kernel eventually.
      
      This fixes the issue by clearing the flag (EEH_PE_PRI_BUS) before the
      PCI hot add. With it, the PowerNV EEH reset backend (pnv_eeh_reset())
      can get valid PE primary bus through eeh_pe_bus_get().
      
      Fixes: 67086e32 ("powerpc/eeh: powerpc/eeh: Support error recovery for VF PE")
      Reported-by: NPridhiviraj Paidipeddi <ppaiddipe@in.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      a3aa256b
  15. 14 6月, 2016 1 次提交
  16. 12 5月, 2016 3 次提交
    • G
      powerpc/eeh: Ignore handlers in eeh_pe_reset_and_recover() · 2efc771f
      Gavin Shan 提交于
      The function eeh_pe_reset_and_recover() is used to recover EEH
      error when the passthrough device are transferred to guest and
      backwards, meaning the device's driver is vfio-pci or none. In
      both cases, the handlers triggered by eeh_report_reset() and
      eeh_report_resume() shouldn't be called.
      
      This ignores the error handlers from eeh_report_reset() and
      eeh_report_resume().
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Reviewed-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      2efc771f
    • G
      powerpc/eeh: Restore initial state in eeh_pe_reset_and_recover() · 5a0cdbfd
      Gavin Shan 提交于
      The function eeh_pe_reset_and_recover() is used to recover EEH
      error when the passthrou device are transferred to guest and
      backwards. The content in the device's config space will be lost
      on PE reset issued in the middle of the recovery. The function
      saves/restores it before/after the reset. However, config access
      to some adapters like Broadcom BCM5719 at this point will causes
      fenced PHB. The config space is always blocked and we save 0xFF's
      that are restored at late point. The memory BARs are totally
      corrupted, causing another EEH error upon access to one of the
      memory BARs.
      
      This restores the config space on those adapters like BCM5719
      from the content saved to the EEH device when it's populated,
      to resolve above issue.
      
      Fixes: 5cfb20b9 ("powerpc/eeh: Emulate EEH recovery for VFIO devices")
      Cc: stable@vger.kernel.org #v3.18+
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Reviewed-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5a0cdbfd
    • G
      powerpc/eeh: Don't report error in eeh_pe_reset_and_recover() · affeb0f2
      Gavin Shan 提交于
      The function eeh_pe_reset_and_recover() is used to recover EEH
      error when the passthrough device are transferred to guest and
      backwards, meaning the device's driver is vfio-pci or none.
      When the driver is vfio-pci that provides error_detected() error
      handler only, the handler simply stops the guest and it's not
      expected behaviour. On the other hand, no error handlers will
      be called if we don't have a bound driver.
      
      This ignores the error handler in eeh_pe_reset_and_recover()
      that reports the error to device driver to avoid the exceptional
      behaviour.
      
      Fixes: 5cfb20b9 ("powerpc/eeh: Emulate EEH recovery for VFIO devices")
      Cc: stable@vger.kernel.org #v3.18+
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Reviewed-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      affeb0f2
  17. 11 5月, 2016 1 次提交
  18. 09 3月, 2016 3 次提交
  19. 22 2月, 2016 1 次提交
    • G
      powerpc/eeh: Fix partial hotplug criterion · f6bf0fa1
      Gavin Shan 提交于
      During error recovery, the device could be removed as part of the
      partial hotplug. The criterion used to come with partial hotplug
      is: if the device driver provides error_detected(), slot_reset()
      and resume() callbacks, it's immune from hotplug. Otherwise,
      it's going to experience partial hotplug during EEH recovery. But
      the criterion isn't correct enough: mlx4_core driver for Mellanox
      adapters provides error_detected(), slot_reset() callbacks, but
      resume() isn't there. Those Mellanox adapters won't be to involved
      in the partial hotplug.
      
      This fixes the criterion to a practical one: adpater with driver
      that provides error_detected(), slot_reset() will be immune from
      partial hotplug. resume() isn't mandatory.
      
      Fixes: f2da4ccf ("powerpc/eeh: More relaxed hotplug criterion")
      Cc: stable@vger.kernel.org #v4.4+
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      f6bf0fa1
  20. 15 2月, 2016 1 次提交
  21. 11 12月, 2015 1 次提交
    • B
      PCI: Check for PCI_HEADER_TYPE_BRIDGE equality, not bitmask · 93de6901
      Bjorn Helgaas 提交于
      Bit 7 of the "Header Type" register indicates a multi-function device when
      set.  Bits 0-6 contain encoded values, where 0x1 indicates a PCI-PCI
      bridge.  It is incorrect to test this as though it were a mask.
      
      For example, while the PCI 3.0 spec only defines values 0x0, 0x1, and 0x2,
      it's conceivable that a future spec could define 0x3 to mean something
      else; then tests for "(hdr_type & 0x7f) & PCI_HEADER_TYPE_BRIDGE" would
      incorrectly succeed for this new 0x3 header type.
      
      Test bits 0-6 of the Header Type for equality with PCI_HEADER_TYPE_BRIDGE.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      93de6901
  22. 09 12月, 2015 1 次提交
    • A
      Revert "powerpc/eeh: Don't unfreeze PHB PE after reset" · dc9c41bd
      Andrew Donnellan 提交于
      This reverts commit 527d10ef.
      
      The reverted commit breaks cxlflash devices following an EEH reset (and
      possibly other cxl devices, however this has not been tested).
      
      The reverted commit changed the behaviour of eeh_reset_device() so that PHB
      PEs are not unfrozen following the completion of the reset. This should not
      be problematic, as no device resources should have been associated with the
      PHB PE.
      
      However, when attempting to load the cxlflash driver after a reset, the
      driver attempts to read Vital Product Data through a call to
      pci_read_vpd() (which is called on the physical cxl device, not on the
      virtual AFU device). pci_read_vpd() in turn attempts to read from the cxl
      device's config space. This fails, as the PE it's trying to read from is
      still frozen. In turn, the driver gets an -ENODEV and fails to initialise.
      
      It appears this issue only affects some parts of the VPD area, as "lspci
      -vvv", which only reads a subset of the VPD bytes, is not broken by the
      original patch.
      
      At this stage, we don't fully understand why we're trying to read a frozen
      PE, and we don't know how this affects other cxl devices. It is possible
      that there is an underlying bug in the cxl driver or the powerpc CAPI
      support code, or alternatively a bug in the PCI resource allocation/mapping
      code that is incorrectly mapping resources to PE#0.
      
      As such, this fix is incomplete, however it is necessary to prevent a
      serious regression in CAPI support.
      
      In the meantime, revert the commit, especially as it was intended to be a
      non-functional change.
      
      Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      Cc: Daniel Axtens <dja@axtens.net>
      Signed-off-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      dc9c41bd
  23. 21 10月, 2015 3 次提交
    • G
      powerpc/eeh: Force reset on fenced PHB · 8234fced
      Gavin Shan 提交于
      On fenced PHB, the error handlers in the drivers of its subordinate
      devices could return PCI_ERS_RESULT_CAN_RECOVER, indicating no reset
      will be issued during the recovery. It's conflicting with the fact
      that fenced PHB won't be recovered without reset.
      
      This limits the return value from the error handlers in the drivers
      of the fenced PHB's subordinate devices to PCI_ERS_RESULT_NEED_NONE
      or PCI_ERS_RESULT_NEED_RESET, to ensure reset will be issued during
      recovery.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Reviewed-by: NDaniel Axtens <dja@axtens.net>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      8234fced
    • G
      powerpc/eeh: More relaxed hotplug criterion · f2da4ccf
      Gavin Shan 提交于
      Currently, we rely on the existence of struct pci_driver::err_handler
      to decide if the corresponding PCI device should be unplugged during
      EEH recovery (partially hotplug case). However that check is not
      sufficient. Some device drivers implement only some of the EEH error
      handlers to collect diag-data. That means the driver still expects a
      hotplug to recover from the EEH error.
      
      This makes the hotplug criterion more relaxed: if the device driver
      doesn't provide all necessary EEH error handlers, it will experience
      hotplug during EEH recovery.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      [mpe: Minor change log rewording]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      f2da4ccf
    • G
      powerpc/eeh: Don't unfreeze PHB PE after reset · 527d10ef
      Gavin Shan 提交于
      On PowerNV platform, the PE is kept in frozen state until the PE
      reset is completed to avoid recursive EEH error caused by MMIO
      access during the period of EEH reset. The PE's frozen state is
      cleared after BARs of PCI device included in the PE are restored
      and enabled. However, we needn't clear the frozen state for PHB PE
      explicitly at this point as there is no real PE for PHB PE. As the
      PHB PE is always binding with PE#0, we actually clear PE#0, which
      is wrong. It doesn't incur any problem though.
      
      This checks if the PE is PHB PE and doesn't clear the frozen state
      if it is.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      527d10ef
  24. 13 5月, 2015 1 次提交
  25. 24 3月, 2015 1 次提交
  26. 23 1月, 2015 2 次提交
  27. 02 12月, 2014 1 次提交
  28. 15 10月, 2014 1 次提交
  29. 30 9月, 2014 2 次提交
    • G
      powerpc/eeh: Emulate EEH recovery for VFIO devices · 5cfb20b9
      Gavin Shan 提交于
      When enabling EEH functionality on passed through devices (PE)
      with VFIO, the devices in the PE would be removed permanently
      from guest side. In that case, the PE remains frozen state.
      When returning PE to host, or restarting the guest again, we
      had mechanism unfreezing the PE by clearing PESTA/B frozen
      bits. However, that's not enough for some adapters, which are
      indicated as following "lspci" shows. Those adapters require
      hot reset on the parent bus to bring their firmware back to
      workable state. Otherwise, those adaptrs won't be operative
      and the host (for returning case) or the guest will fail to
      load the drivers for those adapters without exception.
      
      0000:01:00.0 Ethernet controller: Emulex Corporation OneConnect \
                   10Gb NIC (be3) (rev 02)
      0000:01:00.0 0200: 19a2:0710 (rev 02)
      0001:03:00.0 Ethernet controller: Emulex Corporation OneConnect \
                   NIC (Lancer) (rev 10)
      0001:03:00.0 0200: 10df:e220 (rev 10)
      
      The patch adds mechanism to emulate EEH recovery (for hot reset
      on parent PCI bus) on 3 gates to fix the issue: open/release one
      adapter of the PE, enable EEH functionality on one adapter of the
      PE.
      Reported-by: NMurilo Fossa Vicentini <muvic@br.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5cfb20b9
    • G
      powerpc/eeh: Use eeh_unfreeze_pe() · c9dd0143
      Gavin Shan 提交于
      The patch uses eeh_unfreeze_pe() to replace the logic clearing
      frozen IO and DMA, in order to simplify the code.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      c9dd0143