i2c: i801: Ensure that SMBHSTSTS_INUSE_STS is cleared when leaving i801_access
PATCH v2 1/1 i2c: i801: Ensure that SMBHSTSTS_INUSE_STS is cleared when leaving i801_access
As explained in [0] currently we may leave SMBHSTSTS_INUSE_STS set, thus potentially breaking ACPI/BIOS usage of the SMBUS device.
Seems patch [0] needs a little bit more of review effort, therefore I'd suggest to apply a part of it as quick win. Just clearing SMBHSTSTS_INUSE_STS when leaving i801_access() should fix the referenced issue and leaves more time for discussing a more sophisticated locking handling.
[0] https://www.spinics.net/lists/linux-i2c/msg51558.html
---
v2:
- add proper stable tag
--- drivers/i2c/busses/i2c-i801.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/i2c/busses/i2c-i801.c +3 -0
@@ -948,6 +948,9 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr, } out: +/* Unlock the SMBus device for use by BIOS/ACPI */ +outb_p (SMBHSTSTS_INUSE_STS ,SMBHSTSTS (priv)); +pm_runtime_mark_last_busy (&priv->pci_dev->dev);pm_runtime_put_autosuspend (&priv->pci_dev->dev);mutex_unlock (&priv->acpi_lock);
Signature · 1 line
2.31.1
Quoted 10 lines · Heiner Kallweit
As explained in [0] currently we may leave
SMBHSTSTS_INUSE_STSset, thus potentially breaking ACPI/BIOS usage of the SMBUS device.Seems patch [0] needs a little bit more of review effort, therefore I'd suggest to apply a part of it as quick win. Just clearing
SMBHSTSTS_INUSE_STSwhen leavingi801_access()should fix the referenced issue and leaves more time for discussing a more sophisticated locking handling.out:
drivers/i2c/busses/i2c-i801.c static s32 i801_access(struct i2c_adapter *adap, u16 addr, · line 954
Quoted 4 lines
drivers/i2c/busses/i2c-i801.c +3
-0+/* Unlock the SMBus device for use by BIOS/ACPI */ +outb_p (SMBHSTSTS_INUSE_STS ,SMBHSTSTS (priv)); +pm_runtime_mark_last_busy (&priv->pci_dev->dev);
Yup, I was thinking of suggesting just this part if the rest of the patch were deemed more controversial. Thanks :)
Signature · 2 lines
Hector Martin ([email protected]) Public Key: https://mrcn.st/pub
Hi Heiner, Hector,
Quoted 27 lines · Heiner Kallweit
As explained in [0] currently we may leave
SMBHSTSTS_INUSE_STSset, thus potentially breaking ACPI/BIOS usage of the SMBUS device.Seems patch [0] needs a little bit more of review effort, therefore I'd suggest to apply a part of it as quick win. Just clearing
SMBHSTSTS_INUSE_STSwhen leavingi801_access()should fix the referenced issue and leaves more time for discussing a more sophisticated locking handling.[0] https://www.spinics.net/lists/linux-i2c/msg51558.html
Fixes 01590f361e94 ("i2c: i801: Instantiate SPD EEPROMs automatically")Suggested-by Hector Martin <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>---
v2:
- add proper stable tag--- drivers/i2c/busses/i2c-i801.c | 3 +++ 1 file changed, 3 insertions(+)drivers/i2c/busses/i2c-i801.c +0
-0
drivers/i2c/busses/i2c-i801.c static s32 i801_access(struct i2c_adapter *adap, u16 addr, · line 956
Quoted 9 lines
drivers/i2c/busses/i2c-i801.c +3
-0@@ -948,6 +948,9 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr, } out: +/* Unlock the SMBus device for use by BIOS/ACPI */ +outb_p (SMBHSTSTS_INUSE_STS ,SMBHSTSTS (priv)); +pm_runtime_mark_last_busy (&priv->pci_dev->dev);pm_runtime_put_autosuspend (&priv->pci_dev->dev);mutex_unlock (&priv->acpi_lock);
Good idea.
Hector, can you please rebase your patch on top of this one? I'll review it later when I have more time to allocate to the task.
Thanks,
Signature · 2 lines
Jean Delvare SUSE L3 Support
Wolfram Sang
AppliedQuoted 9 lines · Heiner Kallweit
As explained in [0] currently we may leave
SMBHSTSTS_INUSE_STSset, thus potentially breaking ACPI/BIOS usage of the SMBUS device.Seems patch [0] needs a little bit more of review effort, therefore I'd suggest to apply a part of it as quick win. Just clearing
SMBHSTSTS_INUSE_STSwhen leavingi801_access()should fix the referenced issue and leaves more time for discussing a more sophisticated locking handling.
Quoted 6 lines
[0] https://www.spinics.net/lists/linux-i2c/msg51558.html
Fixes 01590f361e94 ("i2c: i801: Instantiate SPD EEPROMs automatically")Suggested-by Hector Martin <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>
Applied to for-current, thanks!