]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.16.4/i2c-i801-restore-configuration-at-shutdown.patch
drop drm patch
[thirdparty/kernel/stable-queue.git] / releases / 4.16.4 / i2c-i801-restore-configuration-at-shutdown.patch
1 From f7f6d915a10f7f2bce17e3b1b7d3376562395a28 Mon Sep 17 00:00:00 2001
2 From: Jean Delvare <jdelvare@suse.de>
3 Date: Wed, 11 Apr 2018 18:05:34 +0200
4 Subject: i2c: i801: Restore configuration at shutdown
5
6 From: Jean Delvare <jdelvare@suse.de>
7
8 commit f7f6d915a10f7f2bce17e3b1b7d3376562395a28 upstream.
9
10 On some systems, the BIOS expects certain SMBus register values to
11 match the hardware defaults. Restore these configuration registers at
12 shutdown time to avoid confusing the BIOS. This avoids hard-locking
13 such systems upon reboot.
14
15 Signed-off-by: Jean Delvare <jdelvare@suse.de>
16 Tested-by: Jason Andryuk <jandryuk@gmail.com>
17 Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
18 Cc: stable@vger.kernel.org
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21 ---
22 drivers/i2c/busses/i2c-i801.c | 10 ++++++++++
23 1 file changed, 10 insertions(+)
24
25 --- a/drivers/i2c/busses/i2c-i801.c
26 +++ b/drivers/i2c/busses/i2c-i801.c
27 @@ -1701,6 +1701,15 @@ static void i801_remove(struct pci_dev *
28 */
29 }
30
31 +static void i801_shutdown(struct pci_dev *dev)
32 +{
33 + struct i801_priv *priv = pci_get_drvdata(dev);
34 +
35 + /* Restore config registers to avoid hard hang on some systems */
36 + i801_disable_host_notify(priv);
37 + pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg);
38 +}
39 +
40 #ifdef CONFIG_PM
41 static int i801_suspend(struct device *dev)
42 {
43 @@ -1730,6 +1739,7 @@ static struct pci_driver i801_driver = {
44 .id_table = i801_ids,
45 .probe = i801_probe,
46 .remove = i801_remove,
47 + .shutdown = i801_shutdown,
48 .driver = {
49 .pm = &i801_pm_ops,
50 },