]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: mlx-platform: Add IO access verification callbacks
authorVadim Pasternak <vadimp@mellanox.com>
Fri, 26 Jan 2018 19:03:44 +0000 (19:03 +0000)
committerDarren Hart (VMware) <dvhart@infradead.org>
Wed, 31 Jan 2018 18:36:50 +0000 (10:36 -0800)
commit20f71a692753a62ef04fe563a6e3b89f5ff46480
treef63dd82547741f175738cddeb00119e4955b54d2
parentc573c5b71cef760186ecb0c958cfab1ca54184b1
platform/x86: mlx-platform: Add IO access verification callbacks

Add definitions for hotplug device masks and events offsets, in order to
specify explicitly all hardware registers allowed for IO operations for
all the drivers sharing register map with mlx-platform.

Extend register map configuration with the sets of writable, readable and
volatile registers to allow verification prior to the access. It prevents
unexpected access to hardware registers by the drivers, sharing register
map with mlx-platform.

Extend register map configuration with cache type field in order to have
ability to cache hardware register value, where possible. Use simple flat
array type for register lookups, which is most suitable in case when the
number of the registers is not too large.

Add at the end of probing routine calls to regcache_mark_dirty and
regcache_sync in order to sync register cache with hardware values. The
first routine indicate that hardware registers value required sync, the
second performs sync.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/mlx-platform.c