]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: nvec: apply udelay only after the first byte has been sent
authorMarc Dietrich <marvin24@gmx.de>
Sat, 3 Jan 2026 10:14:39 +0000 (11:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Jan 2026 12:53:56 +0000 (13:53 +0100)
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 <marvin24@gmx.de>
Link: https://patch.msgid.link/20260103101439.14863-1-marvin24@gmx.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/nvec/nvec.c

index 263774e6a78cae913ebd74af5d16ed0dc6ee86ad..e9af66a0844834b499e4c0e4cd5f90558d040e78 100644 (file)
@@ -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;