Received: by 10.192.165.148 with SMTP id m20csp839301imm; Fri, 27 Apr 2018 08:19:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqk3X8E0rb0vmKbuD8Qp0y2jsEKSPl/n27mju2CUtYhS/PLRuDI14Yzr+TCycvfvhfaCsM8 X-Received: by 10.98.215.81 with SMTP id v17mr2570761pfl.39.1524842343532; Fri, 27 Apr 2018 08:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524842343; cv=none; d=google.com; s=arc-20160816; b=M5fqkBp+N/ktN03VJn3FXWWYD2slUqQM8u7CZ/i47Hyx88fm+UkLtVD23WKXospX4X mMek+JLwNNAFjvmloI7H9hjLDpz1tyh0WFDayifleKKltu8HHOqgtE886cUS4OO1vkSG pU/J+gqlORT+9MpheZml7auWSUF3frykv9+4xrtYvu78ir3dY2KfkLizh/nKO8fCpMvo DwohfAILkhKVHc6FfgssfyzQ1OWd6rjaNsA1sIs3IGZmf7JMWks8I7gQSJxhii2U+gcc HMJKJ9O2iUuzhkJBdXkkppXJ4h3S+b2/tBFP29D78WxeZxOzmaPKCQXeU0f8Zehf2FWH YJfg== 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:dmarc-filter :arc-authentication-results; bh=xqyIOYdG/ITJ3FSz8tj8dfHUkCi+YwJMqYHyGCmhSaU=; b=SQMBiFAjIeYT6eXtAVzpebMOWa5h4xyqQFqBVcNhZiHX8YAHynHzdk9ulGHNaY4OEZ dG/x09Vu41UGX0uLsoERUDAySdZZd3LEJhfZDJoh9Qk6ELLlvdHBwm76ZvUo9BANbLKw uH+q7IF2ow+JjxUCN7d8uaXxY72oSt5Cdijy+VJsZUO/jJvGXolCV82VTx2q49MO+a3e gYveG4O24TggjGZyhY9n5SNUnevf7+LFEXEqyK2k/ZEwT5sUlsHsS7tWm/CvyoPy2F68 6mexTHKs9o5Et2EttqhJB4Fx8cLAb7ouLCpTSaucZX5R3Tkbp2nBrRn7/5OnqPUe+ixS MM2Q== 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 i64-v6si1367655pgc.323.2018.04.27.08.18.49; Fri, 27 Apr 2018 08:19:03 -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 S933590AbeD0PRp (ORCPT + 99 others); Fri, 27 Apr 2018 11:17:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:49744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932845AbeD0ODI (ORCPT ); Fri, 27 Apr 2018 10:03:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 73F2F218A2; Fri, 27 Apr 2018 14:03:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73F2F218A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org 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.9 07/74] i2c: i801: Restore configuration at shutdown Date: Fri, 27 Apr 2018 15:57:57 +0200 Message-Id: <20180427135710.201572728@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135709.899303463@linuxfoundation.org> References: <20180427135709.899303463@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.9-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 @@ -1696,6 +1696,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) { @@ -1728,6 +1737,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, },