lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240913101532.16571-1-kfting@nuvoton.com>
Date: Fri, 13 Sep 2024 18:15:32 +0800
From: Tyrone Ting <warp5tw@...il.com>
To: avifishman70@...il.com,
	tmaimon77@...il.com,
	tali.perry1@...il.com,
	venture@...gle.com,
	yuenn@...gle.com,
	benjaminfair@...gle.com,
	andi.shyti@...nel.org,
	andriy.shevchenko@...ux.intel.com,
	wsa@...nel.org,
	rand.sec96@...il.com,
	wsa+renesas@...g-engineering.com,
	warp5tw@...il.com,
	tali.perry@...oton.com,
	Avi.Fishman@...oton.com,
	tomer.maimon@...oton.com,
	KWLIU@...oton.com,
	JJLIU0@...oton.com,
	kfting@...oton.com
Cc: openbmc@...ts.ozlabs.org,
	linux-i2c@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Charles Boyer <Charles.Boyer@...-usa.com>,
	Vivekanand Veeracholan <vveerach@...gle.com>
Subject: [PATCH v3 6/6] i2c: npcm: Enable slave in eob interrupt

From: Charles Boyer <Charles.Boyer@...-usa.com>

Nuvoton slave enable was in user space API call master_xfer, so it is
subject to delays from the OS scheduler. If the BMC is not enabled for
slave mode in time for master to send response, then it will NAK the
address match. Then the PLDM request timeout occurs.

If the slave enable is moved to the EOB interrupt service routine, then
the BMC can be ready in slave mode by the time it needs to receive a
response.

Signed-off-by: Charles Boyer <Charles.Boyer@...-usa.com>
Signed-off-by: Vivekanand Veeracholan <vveerach@...gle.com>
Signed-off-by: Tyrone Ting <kfting@...oton.com>
Reviewed-by: Tali Perry <tali.perry1@...il.com>
---
 drivers/i2c/busses/i2c-npcm7xx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
index 03de1353ad6e..bb4586563c0c 100644
--- a/drivers/i2c/busses/i2c-npcm7xx.c
+++ b/drivers/i2c/busses/i2c-npcm7xx.c
@@ -1781,6 +1781,12 @@ static int npcm_i2c_int_master_handler(struct npcm_i2c *bus)
 	    (FIELD_GET(NPCM_I2CCST3_EO_BUSY,
 		       ioread8(bus->reg + NPCM_I2CCST3)))) {
 		npcm_i2c_irq_handle_eob(bus);
+#if IS_ENABLED(CONFIG_I2C_SLAVE)
+		/* reenable slave if it was enabled */
+		if (bus->slave)
+			iowrite8((bus->slave->addr & 0x7F) | NPCM_I2CADDR_SAEN,
+				 bus->reg + NPCM_I2CADDR1);
+#endif
 		return 0;
 	}
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ