]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dma-debug: allow poisoning nonzero allocations
authorRobin Murphy <robin.murphy@arm.com>
Wed, 21 Oct 2015 22:04:01 +0000 (09:04 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:04:01 +0000 (09:04 +1100)
commit1a057fdb3c6d0d0b102fb9cead2eeb3d450e2bc9
treef56716f6d1fbc0cc621fbdb28aef589450687bbb
parentfc4f8eeaf6409830ef3426aaba425a1dcb14c681
dma-debug: allow poisoning nonzero allocations

Since some dma_alloc_coherent implementations return a zeroed buffer
regardless of whether __GFP_ZERO is passed, there exist drivers which are
implicitly dependent on this and pass otherwise uninitialised buffers to
hardware.  This can lead to subtle and awkward-to-debug issues using those
drivers on different platforms, where nonzero uninitialised junk may for
instance occasionally look like a valid command which causes the hardware
to start misbehaving.  To help with debugging such issues, add the option
to make uninitialised buffers much more obvious.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/asm-generic/dma-mapping-common.h
include/linux/dma-debug.h
include/linux/poison.h
lib/Kconfig.debug
lib/dma-debug.c