i2c: i801: Use PCI bus rescan mutex to protect P2SB access
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 5 Sep 2021 15:59:42 +0000 (17:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:59 +0000 (19:16 +0100)
commitc31b0fe8e116354cbfbea52e49a29095f42ec9bd
treebc14c1cb89c6e188ddbbcf2abb5a1a8ff481e9e6
parentaad5b030fa2e59cf6115e1bb43d621ac87592737
i2c: i801: Use PCI bus rescan mutex to protect P2SB access

[ Upstream commit 7d6b61c394a42b8385858bb9e306d48a0112823c ]

As pointed out by Andy in [0] using a local mutex here isn't strictly
wrong but not sufficient. We should hold the PCI rescan lock for P2SB
operations.

[0] https://www.spinics.net/lists/linux-i2c/msg52717.html

Fixes: 1a987c69ce2c ("i2c: i801: make p2sb_spinlock a mutex")
Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-i801.c