)]}'
{
  "commit": "452d6fa37ae9b021f4f6d397dbae077f7296f6f4",
  "tree": "95fc24ae2a7b74bc12739d1322f58b3b8a446f6e",
  "parents": [
    "9a9254c4a2a3ca2b3da16d173f3b0dd01f397ff6"
  ],
  "author": {
    "name": "Viken Dadhaniya",
    "email": "viken.dadhaniya@oss.qualcomm.com",
    "time": "Wed May 06 10:15:21 2026 +0530"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Mon May 11 17:19:00 2026 +0200"
  },
  "message": "serial: qcom_geni: fix kfifo underflow when flush precedes DMA completion IRQ\n\nWhen uart_flush_buffer() runs before the DMA completion IRQ is delivered,\nthe following race can occur (all steps serialized by uart_port_lock):\n\n  1. DMA starts: tx_remaining \u003d N, kfifo contains N bytes\n  2. DMA completes in hardware; IRQ is pending but not yet delivered\n  3. uart_flush_buffer() acquires the port lock and calls kfifo_reset(),\n     making kfifo_len() \u003d 0 while tx_remaining remains N\n  4. uart_flush_buffer() releases the port lock\n  5. DMA IRQ fires; handle_tx_dma() acquires the port lock and calls\n     uart_xmit_advance(uport, tx_remaining) on an empty kfifo\n\nuart_xmit_advance() increments kfifo-\u003eout by tx_remaining. Since\nkfifo_reset() already set both in and out to 0, out wraps past in,\ncausing kfifo_len() to return UART_XMIT_SIZE - tx_remaining. The next\nstart_tx_dma() call then submits a DMA transfer of stale buffer data.\n\nFix this by snapshotting kfifo_len() at the start of handle_tx_dma()\nand skipping uart_xmit_advance() when fifo_len \u003c tx_remaining, which\nindicates the kfifo was reset by a preceding flush.\n\nFixes: 2aaa43c70778 (\"tty: serial: qcom-geni-serial: add support for serial engine DMA\")\nCc: stable \u003cstable@kernel.org\u003e\nSigned-off-by: Viken Dadhaniya \u003cviken.dadhaniya@oss.qualcomm.com\u003e\nReviewed-by: Bartosz Golaszewski \u003cbartosz.golaszewski@oss.qualcomm.com\u003e\nLink: https://patch.msgid.link/20260506-serial-dma-stale-tx-buf-v1-1-e3ccb360d719@oss.qualcomm.com\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5139a9d21b2b272eaaaf3152d4b2d2dd5acdb5ac",
      "old_mode": 33188,
      "old_path": "drivers/tty/serial/qcom_geni_serial.c",
      "new_id": "17da115b1e78b5392581d004d749adde835a835c",
      "new_mode": 33188,
      "new_path": "drivers/tty/serial/qcom_geni_serial.c"
    }
  ]
}
