Received: by 10.192.165.148 with SMTP id m20csp838970imm; Fri, 27 Apr 2018 08:18:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqcxyr1xTCNAlEx9OijT9LMaXE7IW0XsduNKU57t+A5qSg3pw3YuQ0O1BpjWGsPtTjsrnnD X-Received: by 2002:a17:902:9004:: with SMTP id a4-v6mr1644348plp.143.1524842325552; Fri, 27 Apr 2018 08:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524842325; cv=none; d=google.com; s=arc-20160816; b=iouhMepxvH+21k1ia/JB76SQWGGBnKP9XB7nu3URkpP+OAcyCZLeW1YotMRkBAQxcK yTzJ/Ow5Bo1f2hiAOndj/FTthmRLVIKqlQygk1FcONPNc37nfNO8TCBCLl+lmHbmiWeZ HrAH9HaDAKZJIxwaxnq/NZWD26C/5pGwAr0Vo4OgYRz25Z6W5fZTFCcX/CUtV2QCqTLo U5gyRiZJxx517ArRoSboQiaMgZJynC1f99QVEJcjn+j+GYu4ZfMcIN0jdxVFKEKwnIoU KGqAOjR5SvUyDjByd+SBIvI/7aMlK1lPGX5jn+lVNzEs0AS694rBynmoblC5aY4DIRBZ mqOw== 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=Dt+TvaoN/FvIC2XLnCz+0QzthkqDck3M8A88boPrsmo=; b=0smRc9NbklkhwALVmZ66EXDu0vSpp5rw6FC4Mt2H5ZnF0ezpg5ZlQDM8ZDI7RZJq2b ObUS8vEaRqGEmZ3S1HjSQ/kEHa7CcniK+4id6hjPmHEC7f9qGCmcU9+XCMe2W05rVqaY 4hNQ5OHAXM0qyuuzL0nq++B7k3JaXxtd9C/OdgYX2GZeiZwZ3UfigVg8zD/H6hjgE0Ol X+ng/Fj08LwSb0zqMsw/NtRg4oa695miLqhQHUlWIwgHkZtZu3UNnXyrvGeD92lq7Sdb E7NZTejOLdphJcNNlVlb3hF2510TcIIrMNMfpBedQ2/AMpYeoguNIb21Cip8BerSAFQ8 leDw== 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 e1-v6si1423332pld.69.2018.04.27.08.18.31; Fri, 27 Apr 2018 08:18:45 -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 S933462AbeD0ODJ (ORCPT + 99 others); Fri, 27 Apr 2018 10:03:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:49698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933430AbeD0ODG (ORCPT ); Fri, 27 Apr 2018 10:03:06 -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 DBB4B218A2; Fri, 27 Apr 2018 14:03:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBB4B218A2 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 , Benjamin Tissoires , Jason Andryuk , Wolfram Sang Subject: [PATCH 4.9 06/74] i2c: i801: Save register SMBSLVCMD value only once Date: Fri, 27 Apr 2018 15:57:56 +0200 Message-Id: <20180427135710.160649821@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 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 @@ -963,8 +963,6 @@ static int i801_enable_host_notify(struc if (!priv->host_notify) return -ENOMEM; - 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)); @@ -1603,6 +1601,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;