summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2018-04-11 12:05:34 -0400
committerWolfram Sang <wsa@the-dreams.de>2018-04-11 17:08:13 -0400
commitf7f6d915a10f7f2bce17e3b1b7d3376562395a28 (patch)
tree16fe45f9a16a4827353f515a50bbbceac1657d17
parenta086bb8317303dd74725dca933b9b29575159382 (diff)
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 <jdelvare@suse.de> Tested-by: Jason Andryuk <jandryuk@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@vger.kernel.org
-rw-r--r--drivers/i2c/busses/i2c-i801.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 17aa20a55642..e0d59e9ff3c6 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1701,6 +1701,15 @@ static void i801_remove(struct pci_dev *dev)
1701 */ 1701 */
1702} 1702}
1703 1703
1704static 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
1704#ifdef CONFIG_PM 1713#ifdef CONFIG_PM
1705static int i801_suspend(struct device *dev) 1714static int i801_suspend(struct device *dev)
1706{ 1715{
@@ -1730,6 +1739,7 @@ static struct pci_driver i801_driver = {
1730 .id_table = i801_ids, 1739 .id_table = i801_ids,
1731 .probe = i801_probe, 1740 .probe = i801_probe,
1732 .remove = i801_remove, 1741 .remove = i801_remove,
1742 .shutdown = i801_shutdown,
1733 .driver = { 1743 .driver = {
1734 .pm = &i801_pm_ops, 1744 .pm = &i801_pm_ops,
1735 }, 1745 },