Received: by 10.192.165.148 with SMTP id m20csp2540820imm; Sun, 22 Apr 2018 09:10:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx489G/HsN7ARAwlGS+hoPCUXzLDb6XEC9wFfCaZPG6MA518WwktaPl0uESDz6GCTMtxu/ckH X-Received: by 10.99.150.18 with SMTP id c18mr14562910pge.361.1524413413387; Sun, 22 Apr 2018 09:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524413413; cv=none; d=google.com; s=arc-20160816; b=M3QnAadTWoN1e9VHJCrifEbcI/wVmnVnDNKOsgb8egsqq8fmvTpkoxPvdKWcxjEfi1 VpT0q3AYCQBgEr1knJ8M+3YagQHbvDcEcH2esNkrNlspQwtqI78ycTHS8ox8FInKzm1K GkH+TowUnGBj1sel/yy+IJuQ2XOFZJWRh7ZJbzdXJbtRXmKZaCg2M/skYJlaxKw8ZY8j crnAHgW04TrMNQz4x9NocGtmIkSX3W8YcBZK2PZAFZYslQeLaJa8sl1YvD5FpRRl+B5g IkRVh0G9khiTMBV2bTd7+F66mvZQ4wzqVbjfLoVUdSZPZ+OU/eJ+K1ZvgMJ11wbz7SyJ 1ddQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BFtS0v8XuSMskWdU1hMtdEG7sDdYMCOZDNCkFCzYkyA=; b=jQTWeQSQQxoA7zNA4TNDf3yKfJyHvxU2SC4FdAfF6fxOppo/uEp6MnHkogRvRnvqV5 iR3lvZVKve9l4/z528S4+OdrSxjuXfm/gCTqnZ5a88C7qk+Bqt9vHm4u9ggkQ9CiMw5X GNxYtHPL3Yk6Tpky9cJSyn9H2zcOr5VtA/AAPZEQ8yYeCY01qY+kroWqm4TsVu6CA9wP PR+0aOE0jhYttv4KFsAVg0qNM+/0vFa9zfBx1LIjtM7hiG1vKx9LMHtc8Bk83/OQnPAc zkuc6zpyLwcbh0TcMmheadGm5yT52Je6yCiJzDiRyzddBIS5YnG50Tu/hkJzQXcSubV6 QxNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si7419423pfm.226.2018.04.22.09.09.59; Sun, 22 Apr 2018 09:10:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753898AbeDVQJA (ORCPT + 99 others); Sun, 22 Apr 2018 12:09:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45282 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753824AbeDVN4k (ORCPT ); Sun, 22 Apr 2018 09:56:40 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8F490CC4; Sun, 22 Apr 2018 13:56:39 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jean Delvare , Jason Andryuk , Wolfram Sang Subject: [PATCH 4.16 053/196] i2c: i801: Restore configuration at shutdown Date: Sun, 22 Apr 2018 15:51:13 +0200 Message-Id: <20180422135106.851144563@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jean Delvare commit f7f6d915a10f7f2bce17e3b1b7d3376562395a28 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 Tested-by: Jason Andryuk Signed-off-by: Wolfram Sang Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-i801.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- 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 * */ } +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 static int i801_suspend(struct device *dev) { @@ -1730,6 +1739,7 @@ static struct pci_driver i801_driver = { .id_table = i801_ids, .probe = i801_probe, .remove = i801_remove, + .shutdown = i801_shutdown, .driver = { .pm = &i801_pm_ops, },