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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1656072327-13628-13-git-send-email-manikanta.guntupalli@xilinx.com>
Date:   Fri, 24 Jun 2022 17:35:27 +0530
From:   Manikanta Guntupalli <manikanta.guntupalli@...inx.com>
To:     <michal.simek@...inx.com>, <michal.simek@....com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <git@....com>
CC:     Srinivas Goud <srinivas.goud@...inx.com>,
        Manikanta Guntupalli <manikanta.guntupalli@...inx.com>
Subject: [PATCH 12/12] i2c: xiic: Correct the BNB interrupt enable sequence

From: Srinivas Goud <srinivas.goud@...inx.com>

With updated AXI IIC IP core(v2.1)there is change in IP behavior
in dynamic mode, where controller initiate read transfer on IIC
bus only after getting the value for the number of bytes to receive.

In the existing xiic_start_recv function Bus Not Busy(BNB)
interrupt is enabled just after "slave address + start"
write to FIFO and before the "count + stop"write to FIFO.
Since IIC controller drives the start address of a transaction
on the bus only after it has received the byte count information
the above sequence can lead to spurious BNB interrupt in case
there is any delay after "slave address + start" write to FIFO.

This is fixed by ensuring that BNB interrupt is enabled only
after "count + stop" has been written to FIFO.

Signed-off-by: Srinivas Goud <srinivas.goud@...inx.com>
Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@...inx.com>
---
 drivers/i2c/busses/i2c-xiic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index f29acabba5e7..0a34daa9e372 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -851,13 +851,13 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
 				      i2c_8bit_addr_from_msg(msg) |
 				      XIIC_TX_DYN_START_MASK);
 
-		xiic_irq_clr_en(i2c, XIIC_INTR_BNB_MASK);
-
 		/* If last message, include dynamic stop bit with length */
 		val = (i2c->nmsgs == 1) ? XIIC_TX_DYN_STOP_MASK : 0;
 		val |= msg->len;
 
 		xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, val);
+
+		xiic_irq_clr_en(i2c, XIIC_INTR_BNB_MASK);
 	} else {
 		/*
 		 * If previous message is Tx, make sure that Tx FIFO is empty
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ