diff mbox

[Zesty] SAUCE: powernv/npu-dma.c: Fix opal_npu_destroy_context call

Message ID 1495472760-15937-1-git-send-email-leitao@debian.org
State New
Headers show

Commit Message

Breno Leitao May 22, 2017, 5:06 p.m. UTC
From: Alistair Popple <alistair@popple.id.au>

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1692580

opal_npu_destroy_context() should be called with the NPU PHB, not the
PCIe PHB.

(This patch depends on the following patchset: "[PATCH 1/4] [Zesty]
powerpc/powernv: Require MMU_NOTIFIER to fix NPU build")


Signed-off-by: Alistair Popple <alistair@popple.id.au>

Upstream submission: http://patchwork.ozlabs.org/patch/764857/
Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
---
 arch/powerpc/platforms/powernv/npu-dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Colin Ian King May 23, 2017, 8:09 a.m. UTC | #1
On 22/05/17 18:06, Breno Leitao wrote:
> From: Alistair Popple <alistair@popple.id.au>
> 
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1692580
> 
> opal_npu_destroy_context() should be called with the NPU PHB, not the
> PCIe PHB.
> 
> (This patch depends on the following patchset: "[PATCH 1/4] [Zesty]
> powerpc/powernv: Require MMU_NOTIFIER to fix NPU build")
> 
> 
> Signed-off-by: Alistair Popple <alistair@popple.id.au>
> 
> Upstream submission: http://patchwork.ozlabs.org/patch/764857/
> Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
> ---
>  arch/powerpc/platforms/powernv/npu-dma.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
> index 27a2520c99ef..3184c9e265fb 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)
>  void pnv_npu2_destroy_context(struct npu_context *npu_context,
>  			struct pci_dev *gpdev)
>  {
> -	struct pnv_phb *nphb, *phb;
> +	struct pnv_phb *nphb;
>  	struct npu *npu;
>  	struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0);
>  	struct device_node *nvlink_dn;
> @@ -728,13 +728,12 @@ void pnv_npu2_destroy_context(struct npu_context *npu_context,
>  
>  	nphb = pci_bus_to_host(npdev->bus)->private_data;
>  	npu = &nphb->npu;
> -	phb = pci_bus_to_host(gpdev->bus)->private_data;
>  	nvlink_dn = of_parse_phandle(npdev->dev.of_node, "ibm,nvlink", 0);
>  	if (WARN_ON(of_property_read_u32(nvlink_dn, "ibm,npu-link-index",
>  							&nvlink_index)))
>  		return;
>  	npu_context->npdev[npu->index][nvlink_index] = NULL;
> -	opal_npu_destroy_context(phb->opal_id, npu_context->mm->context.id,
> +	opal_npu_destroy_context(nphb->opal_id, npu_context->mm->context.id,
>  				PCI_DEVID(gpdev->bus->number, gpdev->devfn));
>  	kref_put(&npu_context->kref, pnv_npu2_release_context);
>  }
> 

This will be a Stable Release Update which technically requires some
more details in the bug report such as test case and a regression
potential section to help us review the fix. See
https://wiki.ubuntu.com/StableReleaseUpdates

Thanks
Stefan Bader May 23, 2017, 9:24 a.m. UTC | #2
Looks to be fixing a set of changes which are upstream and were submitted for
SRU in Zesty already. But not yet applied. I agree with Colin, that having a bit
more info in the bug report would be reasonable (including a reference to the
bug report which asked for the other patches:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1690412.

But when applying the 4 it sounds reasonable to pick this one as well.

-Stefan
Thadeu Lima de Souza Cascardo May 30, 2017, 5:15 p.m. UTC | #3
On Mon, May 22, 2017 at 02:06:00PM -0300, Breno Leitao wrote:
> From: Alistair Popple <alistair@popple.id.au>
> 
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1692580
> 
> opal_npu_destroy_context() should be called with the NPU PHB, not the
> PCIe PHB.
> 
> (This patch depends on the following patchset: "[PATCH 1/4] [Zesty]
> powerpc/powernv: Require MMU_NOTIFIER to fix NPU build")
> 
> 
> Signed-off-by: Alistair Popple <alistair@popple.id.au>
> 
> Upstream submission: http://patchwork.ozlabs.org/patch/764857/
> Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
> ---
>  arch/powerpc/platforms/powernv/npu-dma.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
> index 27a2520c99ef..3184c9e265fb 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)
>  void pnv_npu2_destroy_context(struct npu_context *npu_context,
>  			struct pci_dev *gpdev)
>  {
> -	struct pnv_phb *nphb, *phb;
> +	struct pnv_phb *nphb;
>  	struct npu *npu;
>  	struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0);
>  	struct device_node *nvlink_dn;
> @@ -728,13 +728,12 @@ void pnv_npu2_destroy_context(struct npu_context *npu_context,
>  
>  	nphb = pci_bus_to_host(npdev->bus)->private_data;
>  	npu = &nphb->npu;
> -	phb = pci_bus_to_host(gpdev->bus)->private_data;
>  	nvlink_dn = of_parse_phandle(npdev->dev.of_node, "ibm,nvlink", 0);
>  	if (WARN_ON(of_property_read_u32(nvlink_dn, "ibm,npu-link-index",
>  							&nvlink_index)))
>  		return;
>  	npu_context->npdev[npu->index][nvlink_index] = NULL;
> -	opal_npu_destroy_context(phb->opal_id, npu_context->mm->context.id,
> +	opal_npu_destroy_context(nphb->opal_id, npu_context->mm->context.id,
>  				PCI_DEVID(gpdev->bus->number, gpdev->devfn));
>  	kref_put(&npu_context->kref, pnv_npu2_release_context);
>  }
> -- 
> 2.11.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Reasonable fix, affects only powernv, already applied upstream, fixes
the other ACKed SRU.

Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thadeu Lima de Souza Cascardo May 30, 2017, 5:51 p.m. UTC | #4
Applied as a cherry-pick from upstream to zesty master-next branch.

Thanks.
Cascardo.
Seth Forshee June 1, 2017, 7:51 p.m. UTC | #5
On Tue, May 30, 2017 at 02:51:46PM -0300, Thadeu Lima de Souza Cascardo wrote:
> Applied as a cherry-pick from upstream to zesty master-next branch.

Also applied Thadeu's cherry pick to artful/master-next.
diff mbox

Patch

diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
index 27a2520c99ef..3184c9e265fb 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)
 void pnv_npu2_destroy_context(struct npu_context *npu_context,
 			struct pci_dev *gpdev)
 {
-	struct pnv_phb *nphb, *phb;
+	struct pnv_phb *nphb;
 	struct npu *npu;
 	struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0);
 	struct device_node *nvlink_dn;
@@ -728,13 +728,12 @@  void pnv_npu2_destroy_context(struct npu_context *npu_context,
 
 	nphb = pci_bus_to_host(npdev->bus)->private_data;
 	npu = &nphb->npu;
-	phb = pci_bus_to_host(gpdev->bus)->private_data;
 	nvlink_dn = of_parse_phandle(npdev->dev.of_node, "ibm,nvlink", 0);
 	if (WARN_ON(of_property_read_u32(nvlink_dn, "ibm,npu-link-index",
 							&nvlink_index)))
 		return;
 	npu_context->npdev[npu->index][nvlink_index] = NULL;
-	opal_npu_destroy_context(phb->opal_id, npu_context->mm->context.id,
+	opal_npu_destroy_context(nphb->opal_id, npu_context->mm->context.id,
 				PCI_DEVID(gpdev->bus->number, gpdev->devfn));
 	kref_put(&npu_context->kref, pnv_npu2_release_context);
 }