All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: i801: Fix resetting of SMBHSTCNT_PEC_EN
@ 2021-10-27 14:21 Jean Delvare
  0 siblings, 0 replies; only message in thread
From: Jean Delvare @ 2021-10-27 14:21 UTC (permalink / raw)
  To: Linux I2C; +Cc: Heiner Kallweit, Wolfram Sang, Jarkko Nikula, Andy Shevchenko

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-27 14:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 14:21 [PATCH] i2c: i801: Fix resetting of SMBHSTCNT_PEC_EN Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.