powerpc/papr_scm: Fix resource end address
authorOliver O'Halloran <oohall@gmail.com>
Thu, 6 Dec 2018 15:17:09 +0000 (02:17 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 7 Dec 2018 12:32:02 +0000 (23:32 +1100)
Fix an off-by-one error in the memory resource range. This resource is
used to determine the address range of the memory to be hot-plugged as
ZONE_DEVICE memory. The current end address results in the kernel
attempting to map an additional memblock and the hypervisor may reject
the mapping resulting in the entire hot-plug failing.

Fixes: b5beae5e224f ("powerpc/pseries: Add driver for PAPR SCM regions")
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/pseries/papr_scm.c

index ee9372b65ca5cf053762d34b0079276becd56779..390badd33547d7199c807492cc2fc856cfcb7436 100644 (file)
@@ -296,7 +296,7 @@ static int papr_scm_probe(struct platform_device *pdev)
 
        /* setup the resource for the newly bound range */
        p->res.start = p->bound_addr;
-       p->res.end   = p->bound_addr + p->blocks * p->block_size;
+       p->res.end   = p->bound_addr + p->blocks * p->block_size - 1;
        p->res.name  = pdev->name;
        p->res.flags = IORESOURCE_MEM;