All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kernel] powerpc/ioda/npu2: Call hot reset skiboot hook when disabling NPU
@ 2018-06-07  7:06 Alexey Kardashevskiy
  2018-07-11  9:45 ` Alexey Kardashevskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2018-06-07  7:06 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Alexey Kardashevskiy, Benjamin Herrenschmidt, Russell Currey,
	Alistair Popple, Balbir Singh

This brings NPU2 in a safe mode when it does not throw HMI if GPU
coherent memory is gone.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---

The main aim for this is nvlink2 pass through, helps a lot.


---
 arch/powerpc/platforms/powernv/pci-ioda.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 66c2804..29f798c 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -3797,6 +3797,16 @@ static void pnv_pci_release_device(struct pci_dev *pdev)
 		pnv_ioda_release_pe(pe);
 }
 
+void pnv_npu_disable_device(struct pci_dev *pdev)
+{
+	struct eeh_dev *edev = pci_dev_to_eeh_dev(pdev);
+	struct eeh_pe *eehpe = edev ? edev->pe : NULL;
+
+	if (eehpe && eeh_ops && eeh_ops->reset) {
+		eeh_ops->reset(eehpe, EEH_RESET_HOT);
+	}
+}
+
 static void pnv_pci_ioda_shutdown(struct pci_controller *hose)
 {
 	struct pnv_phb *phb = hose->private_data;
@@ -3841,6 +3851,7 @@ static const struct pci_controller_ops pnv_npu_ioda_controller_ops = {
 	.reset_secondary_bus	= pnv_pci_reset_secondary_bus,
 	.dma_set_mask		= pnv_npu_dma_set_mask,
 	.shutdown		= pnv_pci_ioda_shutdown,
+	.disable_device		= pnv_npu_disable_device,
 };
 
 static const struct pci_controller_ops pnv_npu_ocapi_ioda_controller_ops = {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-14 11:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-07  7:06 [PATCH kernel] powerpc/ioda/npu2: Call hot reset skiboot hook when disabling NPU Alexey Kardashevskiy
2018-07-11  9:45 ` Alexey Kardashevskiy
2018-07-12  1:38   ` Alistair Popple
2018-07-14 11:34     ` Alexey Kardashevskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.