Skip to content

Commit fd5cc02

Browse files
jdelvaregregkh
authored andcommitted
i2c: i801: Restore configuration at shutdown
commit f7f6d91 upstream. 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] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 44ff238 commit fd5cc02

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
@@ -1700,6 +1700,15 @@ static void i801_remove(struct pci_dev *dev)
17001700
*/
17011701
}
17021702

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

0 commit comments

Comments
 (0)