[1/1] sbefifo: Always use ADU for memory access
diff mbox series

Message ID 20190820053818.18834-2-amitay@ozlabs.org
State Superseded
Headers show
Series
  • Always use ADU for sbefifo memory access
Related show

Checks

Context Check Description
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Amitay Isaacs Aug. 20, 2019, 5:38 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 libpdbg/sbefifo.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Patch
diff mbox series

diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c
index 249f115..a28897f 100644
--- a/libpdbg/sbefifo.c
+++ b/libpdbg/sbefifo.c
@@ -48,7 +48,7 @@  static int sbefifo_op_getmem(struct sbefifo *sbefifo,
 	uint16_t flags;
 	int rc;
 
-	align = ci ? 8 : 128;
+	align = 8;
 
 	start_addr = addr & (~(uint64_t)(align-1));
 	end_addr = (addr + size + (align-1)) & (~(uint64_t)(align-1));
@@ -64,10 +64,9 @@  static int sbefifo_op_getmem(struct sbefifo *sbefifo,
 	PR_NOTICE("sbefifo: getmem addr=0x%016" PRIx64 ", len=%u\n",
 		  start_addr, len);
 
+	flags = SBEFIFO_MEMORY_FLAG_PROC;
 	if (ci)
-		flags = SBEFIFO_MEMORY_FLAG_PROC | SBEFIFO_MEMORY_FLAG_CI;
-	else
-		flags = SBEFIFO_MEMORY_FLAG_PBA;
+		flags |= SBEFIFO_MEMORY_FLAG_CI;
 
 	rc = sbefifo_mem_get(sbefifo->sf_ctx, start_addr, len, flags, &out);
 
@@ -90,7 +89,7 @@  static int sbefifo_op_putmem(struct sbefifo *sbefifo,
 	uint16_t flags;
 	int rc;
 
-	align = ci ? 8 : 128;
+	align = 8;
 
 	if (addr & (align-1)) {
 		PR_ERROR("sbefifo: Address must be aligned to %d bytes\n", align);
@@ -111,10 +110,9 @@  static int sbefifo_op_putmem(struct sbefifo *sbefifo,
 
 	PR_NOTICE("sbefifo: putmem addr=0x%016"PRIx64", len=%u\n", addr, len);
 
+	flags = SBEFIFO_MEMORY_FLAG_PROC;
 	if (ci)
-		flags = SBEFIFO_MEMORY_FLAG_PROC | SBEFIFO_MEMORY_FLAG_CI;
-	else
-		flags = SBEFIFO_MEMORY_FLAG_PBA;
+		flags |= SBEFIFO_MEMORY_FLAG_CI;
 
 	rc = sbefifo_mem_put(sbefifo->sf_ctx, addr, data, len, flags);