io: Open /dev/mem with O_SYNC for uncached access 9549/head
authorHauke Mehrtens <hauke.mehrtens@intel.com>
Mon, 22 Jul 2019 13:03:57 +0000 (15:03 +0200)
committerHauke Mehrtens <hauke.mehrtens@intel.com>
Wed, 24 Jul 2019 11:57:09 +0000 (13:57 +0200)
commit90df0f3e241dc233c3121dfc5e1be937c6c987bc
tree69d9333e6aa0610f600989b7a239130396ae53d9
parente7faabcf119a8543e0633e47e2da7300d0116a43
io: Open /dev/mem with O_SYNC for uncached access

Only when /dev/mem is opened with O_SYNC the write and *read* is done
uncached. We saw wrong values read out from the hardware without setting
O_SYNC, the busybox devmem tool showed different values, when O_SYNC is
also set for the io tool, it reads out the same values as devmem.
When looking at the drivers/char/mem.c file in the kernel it is behaving
differently based on the O_DSYNC flag.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
utils/io/Makefile
utils/io/src/io.c