hwmon: (pc87427) Use request_muxed_region for Super-IO accesses
authorGuenter Roeck <linux@roeck-us.net>
Thu, 4 Apr 2019 18:16:20 +0000 (11:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:48:24 +0000 (06:48 -0700)
commit9e1261a92248c07c5df4b3bc694122ef0f9de255
tree558fdd2374c40e1853c7828edab90ac8befe5f97
parenta7f8e2d504b500d6eca7e0b4992d6b05ceb59de0
hwmon: (pc87427) Use request_muxed_region for Super-IO accesses

[ Upstream commit 755a9b0f8aaa5639ba5671ca50080852babb89ce ]

Super-IO accesses may fail on a system with no or unmapped LPC bus.

Also, other drivers may attempt to access the LPC bus at the same time,
resulting in undefined behavior.

Use request_muxed_region() to ensure that IO access on the requested
address space is supported, and to ensure that access by multiple drivers
is synchronized.

Fixes: ba224e2c4f0a7 ("hwmon: New PC87427 hardware monitoring driver")
Reported-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reported-by: John Garry <john.garry@huawei.com>
Cc: John Garry <john.garry@huawei.com>
Acked-by: John Garry <john.garry@huawei.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/pc87427.c