Skip to content

Commit 409dd7d

Browse files
oohalmpe
authored andcommitted
powerpc/papr_scm: Remove endian conversions
The return values of a h-call are returned in the CPU registers and written to the provided buffer by the plpar_hcall() wrapper. As a result the values written to memory are always in the native endian and should not be byte swapped. The inital implementation of the H-Call interface was done in qemu and the returned values were byte swapped unnecessarily in both the hypervisor and in the driver so this was only noticed when bringing up the PowerVM implementation. Fixes: b5beae5 ("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>
1 parent 683ec0e commit 409dd7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/powerpc/platforms/pseries/papr_scm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static int drc_pmem_bind(struct papr_scm_priv *p)
5555
do {
5656
rc = plpar_hcall(H_SCM_BIND_MEM, ret, p->drc_index, 0,
5757
p->blocks, BIND_ANY_ADDR, token);
58-
token = be64_to_cpu(ret[0]);
58+
token = ret[0];
5959
cond_resched();
6060
} while (rc == H_BUSY);
6161

@@ -64,7 +64,7 @@ static int drc_pmem_bind(struct papr_scm_priv *p)
6464
return -ENXIO;
6565
}
6666

67-
p->bound_addr = be64_to_cpu(ret[1]);
67+
p->bound_addr = ret[1];
6868

6969
dev_dbg(&p->pdev->dev, "bound drc %x to %pR\n", p->drc_index, &p->res);
7070

@@ -82,7 +82,7 @@ static int drc_pmem_unbind(struct papr_scm_priv *p)
8282
do {
8383
rc = plpar_hcall(H_SCM_UNBIND_MEM, ret, p->drc_index,
8484
p->bound_addr, p->blocks, token);
85-
token = be64_to_cpu(ret);
85+
token = ret[0];
8686
cond_resched();
8787
} while (rc == H_BUSY);
8888

0 commit comments

Comments
 (0)