8250_omap: incorrect handling of dma->rx_running flag

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Linux Core SDK
    • LCPD-37838
    • 09.01.00
    • 11.00
    • Hide
      am335x-evm
      am62xx_sk-fs
      Show
      am335x-evm am62xx_sk-fs

      The dma->rx_running flag in 8250_omap UART driver could be incorrectly set in omap_8250_shutdown().

      In omap_8250_shutdown() when UART DMA is enabled, omap_8250_tx_dma_flash() calls __dma_rx_do_complete() to set dma->rx_running = 0.

      However, right after it, pm_runtime_get_sync() is called, which could trigger omap8250_runtime_resume() which calls omap_8250_rx_dma() which set dma->rx_running back to 1. This causes the UART port fails to open next time.

      Please see the customer report for details.

      https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1319384/processor-sdk-am335x-possible-bug-in-8250_omap-uart-driver

      The following patch could fix the issue:

      diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
      index adc85e250822..8ae32c63d5eb 100644
      --- a/drivers/tty/serial/8250/8250_omap.c
      +++ b/drivers/tty/serial/8250/8250_omap.c
      @@ -731,12 +731,12 @@ static void omap_8250_shutdown(struct uart_port *port)
              struct uart_8250_port *up = up_to_u8250p(port);
              struct omap8250_priv *priv = port->private_data;
       
      +       pm_runtime_get_sync(port->dev);
      +
              flush_work(&priv->qos_work);
              if (up->dma)
                      omap_8250_rx_dma_flush(up);
       
      -       pm_runtime_get_sync(port->dev);
      -
              serial_out(up, UART_OMAP_WER, 0);
              if (priv->habit & UART_HAS_EFR2)
                      serial_out(up, UART_OMAP_EFR2, 0x0); 

      fix:
      in 11.x: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/?h=ti-linux-6.12.y&id=ac0e4f5f7690088c9ec5e7d822cd0dda12a722a1

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-4949 - 8250_omap: incorrect handling of dm...
                SYNCHRONIZED
                • Last Sync Date: