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

i2c: i801: Save register SMBSLVCMD value only once

commit a086bb83 upstream.

Saving the original value of register SMBSLVCMD in
i801_enable_host_notify() doesn't work, because this function is
called not only at probe time but also at resume time. Do it in
i801_probe() instead, so that the saved value is not overwritten at
resume time.
Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
Fixes: 22e94bd6 ("i2c: i801: store and restore the SLVCMD register at load and unload")
Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: default avatarJason Andryuk <jandryuk@gmail.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Cc: stable@vger.kernel.org	# v4.10+
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fbd45e29
...@@ -963,8 +963,6 @@ static int i801_enable_host_notify(struct i2c_adapter *adapter) ...@@ -963,8 +963,6 @@ static int i801_enable_host_notify(struct i2c_adapter *adapter)
if (!priv->host_notify) if (!priv->host_notify)
return -ENOMEM; return -ENOMEM;
priv->original_slvcmd = inb_p(SMBSLVCMD(priv));
if (!(SMBSLVCMD_HST_NTFY_INTREN & priv->original_slvcmd)) if (!(SMBSLVCMD_HST_NTFY_INTREN & priv->original_slvcmd))
outb_p(SMBSLVCMD_HST_NTFY_INTREN | priv->original_slvcmd, outb_p(SMBSLVCMD_HST_NTFY_INTREN | priv->original_slvcmd,
SMBSLVCMD(priv)); SMBSLVCMD(priv));
...@@ -1603,6 +1601,10 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -1603,6 +1601,10 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
outb_p(inb_p(SMBAUXCTL(priv)) & outb_p(inb_p(SMBAUXCTL(priv)) &
~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), SMBAUXCTL(priv)); ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), SMBAUXCTL(priv));
/* Remember original Host Notify setting */
if (priv->features & FEATURE_HOST_NOTIFY)
priv->original_slvcmd = inb_p(SMBSLVCMD(priv));
/* Default timeout in interrupt mode: 200 ms */ /* Default timeout in interrupt mode: 200 ms */
priv->adapter.timeout = HZ / 5; priv->adapter.timeout = HZ / 5;
......
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