All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: Fix corrupted PE allocation bitmap on releasing PE
@ 2016-09-06  4:17 Gavin Shan
  2016-09-08  9:47 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Gavin Shan @ 2016-09-06  4:17 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, Gavin Shan

In pnv_ioda_free_pe(), the PE object (including the associated PE
number) is cleared before resetting the corresponding bit in the
PE allocation bitmap. It means PE#0 is always released to the bitmap
wrongly.

This fixes above issue by caching the PE number before the PE object
is cleared.

Fixes: 1e9167726c41 ("powerpc/powernv: Use PE instead of number during setup and release"
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 18f6fd1..c16d790 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -162,11 +162,12 @@ static struct pnv_ioda_pe *pnv_ioda_alloc_pe(struct pnv_phb *phb)
 static void pnv_ioda_free_pe(struct pnv_ioda_pe *pe)
 {
 	struct pnv_phb *phb = pe->phb;
+	unsigned int pe_num = pe->pe_number;
 
 	WARN_ON(pe->pdev);
 
 	memset(pe, 0, sizeof(struct pnv_ioda_pe));
-	clear_bit(pe->pe_number, phb->ioda.pe_alloc);
+	clear_bit(pe_num, phb->ioda.pe_alloc);
 }
 
 /* The default M64 BAR is shared by all PEs */
-- 
2.1.0

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

* Re: powerpc/powernv: Fix corrupted PE allocation bitmap on releasing PE
  2016-09-06  4:17 [PATCH] powerpc/powernv: Fix corrupted PE allocation bitmap on releasing PE Gavin Shan
@ 2016-09-08  9:47 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2016-09-08  9:47 UTC (permalink / raw)
  To: Gavin Shan, linuxppc-dev; +Cc: Gavin Shan

On Tue, 2016-06-09 at 04:17:18 UTC, Gavin Shan wrote:
> In pnv_ioda_free_pe(), the PE object (including the associated PE
> number) is cleared before resetting the corresponding bit in the
> PE allocation bitmap. It means PE#0 is always released to the bitmap
> wrongly.
> 
> This fixes above issue by caching the PE number before the PE object
> is cleared.
> 
> Fixes: 1e9167726c41 ("powerpc/powernv: Use PE instead of number during setup and release"
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/caa58f808834fca9a4443233fd

I added:
    Cc: stable@vger.kernel.org # v4.7+

cheers

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

end of thread, other threads:[~2016-09-08  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06  4:17 [PATCH] powerpc/powernv: Fix corrupted PE allocation bitmap on releasing PE Gavin Shan
2016-09-08  9:47 ` Michael Ellerman

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.