1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
From b43bdeb5f3aa297549655e67f0e6a5db5f592e34 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Thu, 11 Jul 2019 14:04:39 -0700
Subject: [PATCH] i2c: aspeed: add SLAVE_ADDR_RECEIVED_PENDING interrupt
handling
If a peer master sends messages too quickly before it processes
previous slave DMA data handling, this indicator will be set. It's
just a indicator and driver can't recover this case so just ignore
it.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
drivers/i2c/busses/i2c-aspeed.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index 830b3d2cabad..a308d5896632 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -87,6 +87,7 @@
* These share bit definitions, so use the same values for the enable &
* status bits.
*/
+#define ASPEED_I2CD_INTR_SLAVE_ADDR_RECEIVED_PENDING BIT(30)
#define ASPEED_I2CD_INTR_SLAVE_INACTIVE_TIMEOUT BIT(15)
#define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT BIT(14)
#define ASPEED_I2CD_INTR_BUS_RECOVER_DONE BIT(13)
@@ -468,6 +469,18 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
dev_dbg(bus->dev, "slave irq status 0x%08x, cmd 0x%08x\n",
irq_status, command);
+ /*
+ * If a peer master sends messages too quickly before it processes
+ * previous slave DMA data handling, this indicator will be set. It's
+ * just a indicator and driver can't recover this case so just ignore
+ * it.
+ */
+ if (unlikely(irq_status &
+ ASPEED_I2CD_INTR_SLAVE_ADDR_RECEIVED_PENDING)) {
+ dev_dbg(bus->dev, "A slave addr match interrupt is pending.\n");
+ irq_handled |= ASPEED_I2CD_INTR_SLAVE_ADDR_RECEIVED_PENDING;
+ }
+
/* Slave was sent something. */
if (irq_status & ASPEED_I2CD_INTR_RX_DONE) {
aspeed_i2c_slave_handle_rx_done(bus, irq_status, &value);
--
2.7.4
|