Skip to content
Commit 17ba1e87 authored by Jan Dabros's avatar Jan Dabros Committed by Wolfram Sang
Browse files

i2c: designware: Fix improper usage of readl



Kernel test robot reported incorrect type in argument 1 of readl(), but
more importantly it brought attention that MMIO accessor shouldn't be
used in this case, since req->hdr.status is part of a command-response
buffer in system memory.

Since its value may be altered by PSP outside of the scope of current
thread (somehow similar to IRQ handler case), we need to use
READ_ONCE() to ensure compiler won't optimize this call.

Fix also 'status' variable type to reflect that corresponding field in
command-response buffer is platform-independent u32.

Fixes: 78d5e9e2 ("i2c: designware: Add AMD PSP I2C bus support")
Signed-off-by: default avatarJan Dabros <jsd@semihalf.com>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent d8703554
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment