diff mbox series

[1/2] powerpc/pseries: Fix DTL buffer registration

Message ID d0f92a8bcbf03087c7aa7a98d9865d5ab91a9b39.1538035689.git.naveen.n.rao@linux.vnet.ibm.com (mailing list archive)
State Accepted
Commit db787af1b8a6b4be428ee2ea7d409dafcaa4a43c
Headers show
Series A few fixes to DTL buffer access over debugfs | expand

Commit Message

Naveen N. Rao Sept. 27, 2018, 8:10 a.m. UTC
When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we register the DTL
buffer for a cpu when the associated file under powerpc/dtl in debugfs
is opened. When doing so, we need to set the size of the buffer being
registered in the second u32 word of the buffer. This needs to be in big
endian, but we are not doing the conversion resulting in the below error
showing up in dmesg:

	dtl_start: DTL registration for cpu 0 (hw 0) failed with -4

Fix this in the obvious manner.

Fixes: 7c105b63bd98 ("powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.")
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/pseries/dtl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Ellerman Oct. 4, 2018, 6:14 a.m. UTC | #1
On Thu, 2018-09-27 at 08:10:57 UTC, "Naveen N. Rao" wrote:
> When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we register the DTL
> buffer for a cpu when the associated file under powerpc/dtl in debugfs
> is opened. When doing so, we need to set the size of the buffer being
> registered in the second u32 word of the buffer. This needs to be in big
> endian, but we are not doing the conversion resulting in the below error
> showing up in dmesg:
> 
> 	dtl_start: DTL registration for cpu 0 (hw 0) failed with -4
> 
> Fix this in the obvious manner.
> 
> Fixes: 7c105b63bd98 ("powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.")
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Series applied to powerpc next, thanks.

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

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c
index 18014cdeb590..c762689e0eb3 100644
--- a/arch/powerpc/platforms/pseries/dtl.c
+++ b/arch/powerpc/platforms/pseries/dtl.c
@@ -149,7 +149,7 @@  static int dtl_start(struct dtl *dtl)
 
 	/* Register our dtl buffer with the hypervisor. The HV expects the
 	 * buffer size to be passed in the second word of the buffer */
-	((u32 *)dtl->buf)[1] = DISPATCH_LOG_BYTES;
+	((u32 *)dtl->buf)[1] = cpu_to_be32(DISPATCH_LOG_BYTES);
 
 	hwcpu = get_hard_smp_processor_id(dtl->cpu);
 	addr = __pa(dtl->buf);