Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bba1009 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "kernel/lib: add additional debug capabilities for data corruption"

parents 3517076e 8af9942b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -76,4 +76,9 @@ static inline __must_check bool check_data_corruption(bool v) { return v; }
		corruption;						 \
	}))

#ifdef CONFIG_PANIC_ON_DATA_CORRUPTION
#define PANIC_CORRUPTION 1
#else
#define PANIC_CORRUPTION 0
#endif  /* CONFIG_PANIC_ON_DATA_CORRUPTION */
#endif	/* _LINUX_BUG_H */
+7 −0
Original line number Diff line number Diff line
@@ -2065,6 +2065,13 @@ config BUG_ON_DATA_CORRUPTION

	  If unsure, say N.

config PANIC_ON_DATA_CORRUPTION
	bool "Cause a Kernel Panic When Data Corruption is detected"
	help
	 Select this option to upgrade warnings for potentially
	 recoverable data corruption scenarios to system-halting panics,
	 for easier detection and debug.

source "samples/Kconfig"

source "lib/Kconfig.kgdb"
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ static void check_poison_mem(unsigned char *mem, size_t bytes)

	print_hex_dump(KERN_ERR, "", DUMP_PREFIX_ADDRESS, 16, 1, start,
			end - start + 1, 1);
	BUG_ON(PANIC_CORRUPTION);
	dump_stack();
}