diff mbox series

i2c: i801: Fix resetting of SMBHSTCNT_PEC_EN

Message ID 20211027162152.285e75e1@endymion
State Handled Elsewhere
Headers show
Series i2c: i801: Fix resetting of SMBHSTCNT_PEC_EN | expand

Commit Message

Jean Delvare Oct. 27, 2021, 2:21 p.m. UTC
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(-)
diff mbox series

Patch

--- 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);
 }