From db9b736bce3dd897fe4602c8279f9811112fd82a Mon Sep 17 00:00:00 2001 From: Marc Dietrich Date: Sat, 3 Jan 2026 11:14:39 +0100 Subject: [PATCH] staging: nvec: apply udelay only after the first byte has been sent Due to a HW bug in the Tegra20 SoC a udelay needs to be added after the first byte has been sent to the EC (I2C master). Move it to the correct position and add a comment that it should not be replaced by usleep_range. Signed-off-by: Marc Dietrich Link: https://patch.msgid.link/20260103101439.14863-1-marvin24@gmx.de Signed-off-by: Greg Kroah-Hartman --- drivers/staging/nvec/nvec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 263774e6a78ca..e9af66a084483 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -648,7 +648,6 @@ static irqreturn_t nvec_interrupt(int irq, void *dev) break; case 2: /* first byte after command */ if (status == (I2C_SL_IRQ | RNW | RCVD)) { - udelay(33); if (nvec->rx->data[0] != 0x01) { dev_err(nvec->dev, "Read without prior read command\n"); @@ -660,6 +659,9 @@ static irqreturn_t nvec_interrupt(int irq, void *dev) nvec_tx_set(nvec); to_send = nvec->tx->data[0]; nvec->tx->pos = 1; + /* delay ACK due to AP20 HW Bug + do not replace by usleep_range */ + udelay(33); } else if (status == (I2C_SL_IRQ)) { nvec->rx->data[1] = received; nvec->rx->pos = 2; -- 2.47.3