Skip to content

Commit f7f6d91

Browse files
jdelvareWolfram Sang
authored andcommitted
i2c: i801: Restore configuration at shutdown
On some systems, the BIOS expects certain SMBus register values to match the hardware defaults. Restore these configuration registers at shutdown time to avoid confusing the BIOS. This avoids hard-locking such systems upon reboot. Signed-off-by: Jean Delvare <[email protected]> Tested-by: Jason Andryuk <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Cc: [email protected]
1 parent a086bb8 commit f7f6d91

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/i2c/busses/i2c-i801.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,15 @@ static void i801_remove(struct pci_dev *dev)
17011701
*/
17021702
}
17031703

1704+
static void i801_shutdown(struct pci_dev *dev)
1705+
{
1706+
struct i801_priv *priv = pci_get_drvdata(dev);
1707+
1708+
/* Restore config registers to avoid hard hang on some systems */
1709+
i801_disable_host_notify(priv);
1710+
pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg);
1711+
}
1712+
17041713
#ifdef CONFIG_PM
17051714
static int i801_suspend(struct device *dev)
17061715
{
@@ -1730,6 +1739,7 @@ static struct pci_driver i801_driver = {
17301739
.id_table = i801_ids,
17311740
.probe = i801_probe,
17321741
.remove = i801_remove,
1742+
.shutdown = i801_shutdown,
17331743
.driver = {
17341744
.pm = &i801_pm_ops,
17351745
},

0 commit comments

Comments
 (0)