Received: by 10.192.165.148 with SMTP id m20csp2427888imm; Sun, 22 Apr 2018 06:58:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/NrWEnF04fUlrOIQHvuliS6EOjgJURDZAR9FVFrBy0oWmsiKFxQugHypRINoPNPenu4oHc X-Received: by 10.99.106.4 with SMTP id f4mr13659744pgc.225.1524405493745; Sun, 22 Apr 2018 06:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524405493; cv=none; d=google.com; s=arc-20160816; b=LyPyrt6dIXe8cfEsNgOWriv5sOeOOmNq4JsP08MMI2Xh8L4S/FdMLUdLZT0dTXwyH/ t0Gkr9tp06gHg/9Ojjg/npnYo/qQNPKLDo+7N2l7smMVyKib5rtrTGojKgLQuntdh9A2 M5+LkIcKPcWI+czSlHhfDmStE7Na+S6zs4wgX/LdyO8stZsIPwSgdC6rEBmtWBFGqi6Z 4mhK/C96x0uAbPMRWNlp8zT3Yeuyx/GbIENQZx98zbrMErEWrfjUfiSDSpkpNano+OPo PX/5jMntKhWuke7qPhrYcAYvrbUDFS9YNTQ1kglLNlrzb9F9v8eeBFlcAKqWJM1p99Xe l4gA== 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=4J4Ne2YKCfvKzEupCinaEz/oSYn5aNLBcDgzBYtJtYI=; b=QmvTnc43RJrC62veUkCpeUsFT0VhCxi+jyktUtUOV2i+BPUvS1XXA4RTaYCT4Cvw53 dap/xkYXmlKtQLQf+YoxRIJTgsPoylHJKC9d8qiv1V147qOBG/izABL3tdPJh+2MoiBu GeOlsxGQZnIPBRoWZ0eptMh5IymY0Im4lLQCUStBX9IxrKfdKZwzoCNDn24lhlsMX36a wScIppGusB3yMKZXNjaU86k2GPjGhQ65KlaSbGY2sLr6gU5ZUCqMxhTQqcXszGRTK/26 z/GIkXmIFcqrXElDYr/k4V9rXG8mMSWYOD8b9iZwZCdgzuciXr/cpXbPUeJzsHfU6IJm yqsA== 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 t134si8173835pgc.519.2018.04.22.06.57.59; Sun, 22 Apr 2018 06:58: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 S1753830AbeDVN4m (ORCPT + 99 others); Sun, 22 Apr 2018 09:56:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45258 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753794AbeDVN4h (ORCPT ); Sun, 22 Apr 2018 09:56:37 -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 B4A60CCA; Sun, 22 Apr 2018 13:56:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jean Delvare , Benjamin Tissoires , Jason Andryuk , Wolfram Sang Subject: [PATCH 4.16 052/196] i2c: i801: Save register SMBSLVCMD value only once Date: Sun, 22 Apr 2018 15:51:12 +0200 Message-Id: <20180422135106.789178651@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 a086bb8317303dd74725dca933b9b29575159382 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: Jean Delvare Fixes: 22e94bd6779e ("i2c: i801: store and restore the SLVCMD register at load and unload") Reviewed-by: Benjamin Tissoires Tested-by: Jason Andryuk Signed-off-by: Wolfram Sang Cc: stable@vger.kernel.org # v4.10+ Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-i801.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -966,8 +966,6 @@ static void i801_enable_host_notify(stru if (!(priv->features & FEATURE_HOST_NOTIFY)) return; - priv->original_slvcmd = inb_p(SMBSLVCMD(priv)); - if (!(SMBSLVCMD_HST_NTFY_INTREN & priv->original_slvcmd)) outb_p(SMBSLVCMD_HST_NTFY_INTREN | priv->original_slvcmd, SMBSLVCMD(priv)); @@ -1615,6 +1613,10 @@ static int i801_probe(struct pci_dev *de outb_p(inb_p(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 */ priv->adapter.timeout = HZ / 5;