From: Jean Delvare <jdelvare@suse.de>
To: Linux I2C <linux-i2c@vger.kernel.org>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Wolfram Sang <wsa@kernel.org>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH] i2c: i801: Fix resetting of SMBHSTCNT_PEC_EN
Date: Wed, 27 Oct 2021 16:21:52 +0200 [thread overview]
Message-ID: <20211027162152.285e75e1@endymion> (raw)
SMBHSTCNT_PEC_EN does not belong to register SMBHSTCFG, but - as its
name suggests - to register SMBHSTCNT. Therefore resetting this bit
in the former register is wrong and useless. Thankfully this bit is
marked as reserved there so no harm done.
Considering that the value of SMBHSTCNT is overwritten for every
transaction, clearing this bit in advance is actually not needed at
all, so we can simply skip this step.
Fixes: a6b8bb6a813a ("i2c: i801: Fix handling SMBHSTCNT_PEC_EN")
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Wolfram Sang <wsa@kernel.org>
---
drivers/i2c/busses/i2c-i801.c | 4 ----
1 file changed, 4 deletions(-)
--- linux-5.14.orig/drivers/i2c/busses/i2c-i801.c 2021-10-27 14:37:05.026069056 +0200
+++ linux-5.14/drivers/i2c/busses/i2c-i801.c 2021-10-27 15:20:12.915065673 +0200
@@ -175,7 +175,6 @@
#define SMBHSTCNT_KILL BIT(1)
#define SMBHSTCNT_LAST_BYTE BIT(5)
#define SMBHSTCNT_START BIT(6)
-#define SMBHSTCNT_PEC_EN BIT(7) /* ICH3 and later */
/* I801 Hosts Status register bits */
#define SMBHSTSTS_BYTE_DONE BIT(7)
@@ -496,8 +495,6 @@ static int i801_transaction(struct i801_
return i801_check_post(priv, result ? priv->status : -ETIMEDOUT);
}
- /* the current contents of SMBHSTCNT can be overwritten, since PEC,
- * SMBSCMD are passed in xact */
outb_p(xact | SMBHSTCNT_START, SMBHSTCNT(priv));
status = i801_wait_intr(priv);
@@ -1657,7 +1654,6 @@ static void i801_setup_hstcfg(struct i80
unsigned char hstcfg = priv->original_hstcfg;
hstcfg &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */
- hstcfg &= ~SMBHSTCNT_PEC_EN; /* Disable software PEC */
hstcfg |= SMBHSTCFG_HST_EN;
pci_write_config_byte(priv->pci_dev, SMBHSTCFG, hstcfg);
}
--
Jean Delvare
SUSE L3 Support
reply other threads:[~2021-10-27 14:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211027162152.285e75e1@endymion \
--to=jdelvare@suse.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hkallweit1@gmail.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).