From patchwork Fri Aug 19 13:27:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 660877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3sG3mY6cPKz9t1G for ; Fri, 19 Aug 2016 23:32:29 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754529AbcHSN3m (ORCPT ); Fri, 19 Aug 2016 09:29:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38062 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754976AbcHSN27 (ORCPT ); Fri, 19 Aug 2016 09:28:59 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8A8D85546; Fri, 19 Aug 2016 13:28:01 +0000 (UTC) Received: from plouf.banquise.eu.com (ovpn-116-62.ams2.redhat.com [10.36.116.62]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7JDRi1e027543; Fri, 19 Aug 2016 09:28:00 -0400 From: Benjamin Tissoires To: Jean Delvare , Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 10/10] i2c: i801: remove SMBNTFDDAT reads as they always seem to return 0 Date: Fri, 19 Aug 2016 15:27:42 +0200 Message-Id: <1471613262-20682-11-git-send-email-benjamin.tissoires@redhat.com> In-Reply-To: <1471613262-20682-1-git-send-email-benjamin.tissoires@redhat.com> References: <1471613262-20682-1-git-send-email-benjamin.tissoires@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 19 Aug 2016 13:28:01 +0000 (UTC) Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On the platform tested, reading SMBNTFDDAT always returns 0 (using 1 read of a word or 2 of 2 bytes). Given that we are not sure why and that we don't need to rely on the data parameter in the current users of Host Notify, remove this part of the code. If someone wants to re-enable it, just revert this commit and data should be available. Signed-off-by: Benjamin Tissoires --- new in v2 --- drivers/i2c/busses/i2c-i801.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index c5ed44c..2ffebe6 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -117,7 +117,6 @@ #define SMBSLVSTS(p) (16 + (p)->smba) /* ICH3 and later */ #define SMBSLVCMD(p) (17 + (p)->smba) /* ICH3 and later */ #define SMBNTFDADD(p) (20 + (p)->smba) /* ICH3 and later */ -#define SMBNTFDDAT(p) (22 + (p)->smba) /* ICH3 and later */ /* PCI Address Constants */ #define SMBBAR 4 @@ -578,16 +577,19 @@ static void i801_isr_byte_done(struct i801_priv *priv) static irqreturn_t i801_host_notify_isr(struct i801_priv *priv) { unsigned short addr; - unsigned int data; int ret; if (unlikely(!priv->host_notify)) goto out; addr = inb_p(SMBNTFDADD(priv)) >> 1; - data = inw_p(SMBNTFDDAT(priv)); - ret = i2c_handle_smbus_host_notify(priv->host_notify, addr, data); + /* + * With the tested platforms, reading SMBNTFDDAT (22 + (p)->smba) + * always returns 0 and is safe to read. + * We just use 0 given we have no use of the data right now. + */ + ret = i2c_handle_smbus_host_notify(priv->host_notify, addr, 0); if (ret < 0) dev_warn(&priv->pci_dev->dev, "Host Notify handling failed: %d\n", ret);