OSDN Git Service

powerpc/pseries: Fix DTL buffer registration
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Thu, 27 Sep 2018 08:10:57 +0000 (13:40 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Nov 2019 13:44:16 +0000 (14:44 +0100)
commit1f7bc2d3b8495f158aaa7c062968cd12076977a7
tree2dbedae88778c9d612fb1b5f346aaf32381552fe
parentedeb2114377095330e75151c7bae34f15145c4d1
powerpc/pseries: Fix DTL buffer registration

[ Upstream commit db787af1b8a6b4be428ee2ea7d409dafcaa4a43c ]

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>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/pseries/dtl.c