Commit 6ebb017d authored by Andrew Lunn's avatar Andrew Lunn Committed by Greg Kroah-Hartman
Browse files

printk: Fix alignment of buf causing crash on ARM EABI

Commit 7ff9554b

, printk: convert
byte-buffer to variable-length record buffer, causes systems using
EABI to crash very early in the boot cycle. The first entry in struct
log is a u64, which for EABI must be 8 byte aligned.

Make use of __alignof__() so the compiler to decide the alignment, but
allow it to be overridden using CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS,
for systems which can perform unaligned access and want to save
a few bytes of space.

Tested on Orion5x and Kirkwood.
Signed-off-by: default avatarAndrew Lunn <>
Tested-by: Stephen Warren's avatarStephen Warren <>
Acked-by: Stephen Warren's avatarStephen Warren <>
Acked-by: default avatarKay Sievers <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent bcc2c9c3
......@@ -227,10 +227,10 @@ static u32 clear_idx;
#define LOG_LINE_MAX 1024
/* record buffer */
#define LOG_ALIGN 4
#define LOG_ALIGN 8
#define LOG_ALIGN __alignof__(struct log)
static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment