diff options
author | Alistair Popple <alistair@popple.id.au> | 2017-05-19 16:56:35 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-05-25 09:07:39 -0400 |
commit | 415ba3c157b9de7edc59468d19d48c1d15972a75 (patch) | |
tree | 0e6178a5670f6860b9cfea74ce34617b298d0da8 | |
parent | fe06fe860250a4f01d0eaf70a2563b1997174a74 (diff) |
powerpc/powernv/npu-dma.c: Fix opal_npu_destroy_context() call
opal_npu_destroy_context() should be called with the NPU PHB, not the
PCIe PHB.
Fixes: 1ab66d1fbada ("powerpc/powernv: Introduce address translation services for Nvlink2")
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/platforms/powernv/npu-dma.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c index 067defeea691..78fa9395b8c5 100644 --- a/arch/powerpc/platforms/powernv/npu-dma.c +++ b/arch/powerpc/platforms/powernv/npu-dma.c | |||
@@ -714,7 +714,7 @@ static void pnv_npu2_release_context(struct kref *kref) | |||
714 | void pnv_npu2_destroy_context(struct npu_context *npu_context, | 714 | void pnv_npu2_destroy_context(struct npu_context *npu_context, |
715 | struct pci_dev *gpdev) | 715 | struct pci_dev *gpdev) |
716 | { | 716 | { |
717 | struct pnv_phb *nphb, *phb; | 717 | struct pnv_phb *nphb; |
718 | struct npu *npu; | 718 | struct npu *npu; |
719 | struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0); | 719 | struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0); |
720 | struct device_node *nvlink_dn; | 720 | struct device_node *nvlink_dn; |
@@ -728,13 +728,12 @@ void pnv_npu2_destroy_context(struct npu_context *npu_context, | |||
728 | 728 | ||
729 | nphb = pci_bus_to_host(npdev->bus)->private_data; | 729 | nphb = pci_bus_to_host(npdev->bus)->private_data; |
730 | npu = &nphb->npu; | 730 | npu = &nphb->npu; |
731 | phb = pci_bus_to_host(gpdev->bus)->private_data; | ||
732 | nvlink_dn = of_parse_phandle(npdev->dev.of_node, "ibm,nvlink", 0); | 731 | nvlink_dn = of_parse_phandle(npdev->dev.of_node, "ibm,nvlink", 0); |
733 | if (WARN_ON(of_property_read_u32(nvlink_dn, "ibm,npu-link-index", | 732 | if (WARN_ON(of_property_read_u32(nvlink_dn, "ibm,npu-link-index", |
734 | &nvlink_index))) | 733 | &nvlink_index))) |
735 | return; | 734 | return; |
736 | npu_context->npdev[npu->index][nvlink_index] = NULL; | 735 | npu_context->npdev[npu->index][nvlink_index] = NULL; |
737 | opal_npu_destroy_context(phb->opal_id, npu_context->mm->context.id, | 736 | opal_npu_destroy_context(nphb->opal_id, npu_context->mm->context.id, |
738 | PCI_DEVID(gpdev->bus->number, gpdev->devfn)); | 737 | PCI_DEVID(gpdev->bus->number, gpdev->devfn)); |
739 | kref_put(&npu_context->kref, pnv_npu2_release_context); | 738 | kref_put(&npu_context->kref, pnv_npu2_release_context); |
740 | } | 739 | } |