hwmon: (smsc47m1) Use request_muxed_region for Super-IO accesses
authorGuenter Roeck <linux@roeck-us.net>
Thu, 4 Apr 2019 18:28:37 +0000 (11:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:48:24 +0000 (06:48 -0700)
commitac713a6f1379c1c34e206fce9222edd25436769a
treeb30150fc6491ea69adb1a42f0de1c8c3370331da
parentf418d00bc5c3527d6ffed0a4073be77f000252c1
hwmon: (smsc47m1) Use request_muxed_region for Super-IO accesses

[ Upstream commit d6410408ad2a798c4cc685252c1baa713be0ad69 ]

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: 8d5d45fb1468 ("I2C: Move hwmon drivers (2/3)")
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/smsc47m1.c