[lkml]   [2018]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[tip:locking/urgent] locking/qrwlock: include asm/byteorder.h as needed
Commit-ID:  ca66e797120fb09b8138623fb4b563e952586ef5
Author: Arnd Bergmann <>
AuthorDate: Fri, 2 Feb 2018 16:40:44 +0100
Committer: Ingo Molnar <>
CommitDate: Tue, 6 Feb 2018 10:28:58 +0100

locking/qrwlock: include asm/byteorder.h as needed

Moving the qrwlock struct definition into a header file introduced
a subtle bug on all little-endian machines, where some files in some
configurations would see the fields in an incorrect order. This was
found by building with an LTO enabled compiler that warns every time we
try to link together files with incompatible data structures.

A second patch changes linux/kconfig.h to always define the symbols,
but this seems to be the root cause of most of the issues, so I'd suggest
we do both.

On a current linux-next kernel, I verified that this header is
responsible for all type mismatches as a result from the endianess

Signed-off-by: Arnd Bergmann <>
Signed-off-by: Peter Zijlstra (Intel) <>
Cc: Andrew Morton <>
Cc: Babu Moger <>
Cc: Greg Kroah-Hartman <>
Cc: Linus Torvalds <>
Cc: Nicolas Pitre <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Cc: Will Deacon <>
Fixes: e0d02285f16e ("locking/qrwlock: Use 'struct qrwlock' instead of 'struct __qrwlock'")
Signed-off-by: Ingo Molnar <>
include/asm-generic/qrwlock_types.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/asm-generic/qrwlock_types.h b/include/asm-generic/qrwlock_types.h
index 137ecdd..c36f1d5 100644
--- a/include/asm-generic/qrwlock_types.h
+++ b/include/asm-generic/qrwlock_types.h
@@ -3,6 +3,7 @@

#include <linux/types.h>
+#include <asm/byteorder.h>
#include <asm/spinlock_types.h>

 \ /
  Last update: 2018-02-06 13:02    [W:0.067 / U:0.460 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site