Commit bd8505f3 authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

i2c: i801: Restore configuration at shutdown

commit f7f6d915 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: default avatarJean Delvare <jdelvare@suse.de>
Tested-by: default avatarJason Andryuk <jandryuk@gmail.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 53defab7
...@@ -1696,6 +1696,15 @@ static void i801_remove(struct pci_dev *dev) ...@@ -1696,6 +1696,15 @@ static void i801_remove(struct pci_dev *dev)
*/ */
} }
static void i801_shutdown(struct pci_dev *dev)
{
struct i801_priv *priv = pci_get_drvdata(dev);
/* Restore config registers to avoid hard hang on some systems */
i801_disable_host_notify(priv);
pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg);
}
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int i801_suspend(struct device *dev) static int i801_suspend(struct device *dev)
{ {
...@@ -1728,6 +1737,7 @@ static struct pci_driver i801_driver = { ...@@ -1728,6 +1737,7 @@ static struct pci_driver i801_driver = {
.id_table = i801_ids, .id_table = i801_ids,
.probe = i801_probe, .probe = i801_probe,
.remove = i801_remove, .remove = i801_remove,
.shutdown = i801_shutdown,
.driver = { .driver = {
.pm = &i801_pm_ops, .pm = &i801_pm_ops,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment