]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
cxl: Disable SPAP register when freeing SPA
authorIan Munsie <imunsie@au1.ibm.com>
Mon, 8 Dec 2014 08:18:00 +0000 (19:18 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 29 Dec 2014 04:45:44 +0000 (15:45 +1100)
When we deactivate the AFU directed mode we free the scheduled process
area, but did not clear the register in the hardware that has a pointer
to it.

This should be fine since we will have already cleared out every context
and we won't do anything that would cause the hardware to access it
until after we have allocated a new one, but just to be safe this patch
clears out the register when we free the page.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/cxl/native.c

index f2b37b41a0da6e0b41fc7cbc8d1b02471ecf7fe7..0f24fa5b0de38f9f147d00eb4424154e7ed54266 100644 (file)
@@ -185,6 +185,7 @@ static int alloc_spa(struct cxl_afu *afu)
 
 static void release_spa(struct cxl_afu *afu)
 {
+       cxl_p1n_write(afu, CXL_PSL_SPAP_An, 0);
        free_pages((unsigned long) afu->spa, afu->spa_order);
 }