1. 18 1月, 2017 1 次提交
    • G
      powerpc/eeh: Enable IO path on permanent error · 387bbc97
      Gavin Shan 提交于
      We give up recovery on permanent error, simply shutdown the affected
      devices and remove them. If the devices can't be put into quiet state,
      they spew more traffic that is likely to cause another unexpected EEH
      error. This was observed on "p8dtu2u" machine:
      
         0002:00:00.0 PCI bridge: IBM Device 03dc
         0002:01:00.0 Ethernet controller: Intel Corporation \
                      Ethernet Controller X710/X557-AT 10GBASE-T (rev 02)
         0002:01:00.1 Ethernet controller: Intel Corporation \
                      Ethernet Controller X710/X557-AT 10GBASE-T (rev 02)
         0002:01:00.2 Ethernet controller: Intel Corporation \
                      Ethernet Controller X710/X557-AT 10GBASE-T (rev 02)
         0002:01:00.3 Ethernet controller: Intel Corporation \
                      Ethernet Controller X710/X557-AT 10GBASE-T (rev 02)
      
      On P8 PowerNV platform, the IO path is frozen when shutdowning the
      devices, meaning the memory registers are inaccessible. It is why
      the devices can't be put into quiet state before removing them.
      This fixes the issue by enabling IO path prior to putting the devices
      into quiet state.
      Reported-by: NPridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: NRussell Currey <ruscur@russell.cc>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      387bbc97
  2. 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
  3. 04 10月, 2016 1 次提交
  4. 29 9月, 2016 2 次提交
  5. 09 8月, 2016 1 次提交
  6. 12 5月, 2016 2 次提交
  7. 11 4月, 2016 1 次提交
  8. 09 3月, 2016 5 次提交
  9. 08 2月, 2016 1 次提交
  10. 21 10月, 2015 1 次提交
  11. 15 10月, 2015 1 次提交
  12. 12 10月, 2015 1 次提交
    • A
      powerpc/mm: Differentiate between hugetlb and THP during page walk · 891121e6
      Aneesh Kumar K.V 提交于
      We need to properly identify whether a hugepage is an explicit or
      a transparent hugepage in follow_huge_addr(). We used to depend
      on hugepage shift argument to do that. But in some case that can
      result in wrong results. For ex:
      
      On finding a transparent hugepage we set hugepage shift to PMD_SHIFT.
      But we can end up clearing the thp pte, via pmdp_huge_get_and_clear.
      We do prevent reusing the pfn page via the usage of
      kick_all_cpus_sync(). But that happens after we updated the pte to 0.
      Hence in follow_huge_addr() we can find hugepage shift set, but transparent
      huge page check fail for a thp pte.
      
      NOTE: We fixed a variant of this race against thp split in commit
      691e95fd
      ("powerpc/mm/thp: Make page table walk safe against thp split/collapse")
      
      Without this patch, we may hit the BUG_ON(flags & FOLL_GET) in
      follow_page_mask occasionally.
      
      In the long term, we may want to switch ppc64 64k page size config to
      enable CONFIG_ARCH_WANT_GENERAL_HUGETLB
      Reported-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      891121e6
  13. 28 8月, 2015 1 次提交
    • G
      powerpc/eeh: Fix fenced PHB caused by eeh_slot_error_detail() · 25980013
      Gavin Shan 提交于
      The config space of some PCI devices can't be accessed when their
      PEs are in frozen state. Otherwise, fenced PHB might be seen.
      Those PEs are identified with flag EEH_PE_CFG_RESTRICTED, meaing
      EEH_PE_CFG_BLOCKED is set automatically when the PE is put to
      frozen state (EEH_PE_ISOLATED). eeh_slot_error_detail() restores
      PCI device BARs with eeh_pe_restore_bars(), which then calls
      eeh_ops->restore_config() to reinitialize the PCI device in
      (OPAL) firmware. eeh_ops->restore_config() produces PCI config
      access that causes fenced PHB. The problem was reported on below
      adapter:
      
         0001:01:00.0 0200: 14e4:168e (rev 10)
         0001:01:00.0 Ethernet controller: Broadcom Corporation \
                      NetXtreme II BCM57810 10 Gigabit Ethernet (rev 10)
      
      This fixes the issue by skipping eeh_pe_restore_bars() in
      eeh_slot_error_detail() when EEH_PE_CFG_BLOCKED is set for the PE.
      
      Fixes: b6541db1 ("powerpc/eeh: Block PCI config access upon frozen PE")
      Cc: stable@vger.kernel.org # v4.0+
      Reported-by: NManvanthara B. Puttashankar <mputtash@in.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      25980013
  14. 18 8月, 2015 1 次提交
    • G
      powerpc/eeh: Disable automatically blocked PCI config · 39bfd715
      Gavin Shan 提交于
      pcibios_set_pcie_reset_state() could be called to complete
      reset request when passing through PCI device, flag
      EEH_PE_ISOLATED is set before saving the PCI config sapce.
      On some Broadcom adapters, EEH_PE_CFG_BLOCKED is automatically
      set when the flag EEH_PE_ISOLATED is marked. It caused bogus
      data saved from the PCI config space, which will be restored
      to the PCI adapter after the reset. Eventually, the hardware
      can't work with corrupted data in PCI config space.
      
      The patch fixes the issue with eeh_pe_state_mark_no_cfg(), which
      doesn't set EEH_PE_CFG_BLOCKED when seeing EEH_PE_ISOLATED on the
      PE, in order to avoid the bogus data saved and restored to the PCI
      config space.
      Reported-by: NRajanikanth H. Adaveeshaiah <rajanikanth.ha@in.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      39bfd715
  15. 14 8月, 2015 1 次提交
    • D
      powerpc/eeh: Probe after unbalanced kref check · e642d11b
      Daniel Axtens 提交于
      In the complete hotplug case, EEH PEs are supposed to be released
      and set to NULL. Normally, this is done by eeh_remove_device(),
      which is called from pcibios_release_device().
      
      However, if something is holding a kref to the device, it will not
      be released, and the PE will remain. eeh_add_device_late() has
      a check for this which will explictly destroy the PE in this case.
      
      This check in eeh_add_device_late() occurs after a call to
      eeh_ops->probe(). On PowerNV, probe is a pointer to pnv_eeh_probe(),
      which will exit without probing if there is an existing PE.
      
      This means that on PowerNV, devices with outstanding krefs will not
      be rediscovered by EEH correctly after a complete hotplug. This is
      affecting CXL (CAPI) devices in the field.
      
      Put the probe after the kref check so that the PE is destroyed
      and affected devices are correctly rediscovered by EEH.
      
      Fixes: d91dafc0 ("powerpc/eeh: Delay probing EEH device during hotplug")
      Cc: stable@vger.kernel.org
      Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NDaniel Axtens <dja@axtens.net>
      Acked-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      e642d11b
  16. 11 6月, 2015 1 次提交
  17. 07 6月, 2015 1 次提交
  18. 13 5月, 2015 1 次提交
  19. 12 5月, 2015 1 次提交
  20. 01 5月, 2015 2 次提交
  21. 17 4月, 2015 1 次提交
    • A
      powerpc/mm/thp: Make page table walk safe against thp split/collapse · 691e95fd
      Aneesh Kumar K.V 提交于
      We can disable a THP split or a hugepage collapse by disabling irq.
      We do send IPI to all the cpus in the early part of split/collapse,
      and disabling local irq ensure we don't make progress with
      split/collapse. If the THP is getting split we return NULL from
      find_linux_pte_or_hugepte(). For all the current callers it should be ok.
      We need to be careful if we want to use returned pte_t pointer outside
      the irq disabled region. W.r.t to THP split, the pfn remains the same,
      but then a hugepage collapse will result in a pfn change. There are
      few steps we can take to avoid a hugepage collapse.One way is to take page
      reference inside the irq disable region. Other option is to take
      mmap_sem so that a parallel collapse will not happen. We can also
      disable collapse by taking pmd_lock. Another method used by kvm
      subsystem is to check whether we had a mmu_notifer update in between
      using mmu_notifier_retry().
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      691e95fd
  22. 14 4月, 2015 1 次提交
  23. 24 3月, 2015 3 次提交
  24. 17 3月, 2015 1 次提交
    • G
      powerpc/eeh: Enhance pcibios_set_pcie_reset_state() · 28158cd1
      Gavin Shan 提交于
      Function pcibios_set_pcie_reset_state() is possibly called by
      pci_reset_function(), on which VFIO infrastructure depends to
      issue reset. pcibios_set_pcie_reset_state() is issuing reset
      on the parent PE of the indicated PCI device. The reset causes
      state lost on all PCI devices except the indicated one as the
      argument to pcibios_set_pcie_reset_state(). Also, sideband
      MMIO access from guest when issuing reset would cause unexpected
      EEH error.
      
      For above two issues, the patch applies following enhancements
      to pcibios_set_pcie_reset_state():
      
         * For all PCI devices except the indicated one, save their
           state prior to reset and restore state after that.
         * Explicitly freeze PE prior to reset and unfreeze it after
           that, in order to avoid unexpected EEH error.
      Tested-by: NPriya M. A <priyama2@in.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      28158cd1
  25. 23 1月, 2015 1 次提交
  26. 02 12月, 2014 5 次提交