]> git.ipfire.org Git - thirdparty/kernel/stable.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)
commit0b78b1c2f43511cac53c5ab12b2235c31e3d41e5
treef63dd82547741f175738cddeb00119e4955b54d2
parentb4d3dbc472bb59fe3cdbbcce47a365641791e6fb
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