From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE7922F7F11; Thu, 25 Jun 2026 13:11:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782393103; cv=none; b=A0o1u//eDCkU4ujTtDTCRorkba7iHLg5ZUNUBPJFdFM+USb6N9KRkK+NvLGjN4jl3c5rkcg2eANnEPe+rRulUolvD2C55ADym3W6NOCu51A8HR3HsKrqYa+OL3QGTqU1H2taM8E4QgDzHn4rWKDGu2sZtIrlw7pRU/41wRzYmj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782393103; c=relaxed/simple; bh=aXFzI+NBl+7RDEMEh2l/mXTZ0R037bBHEyy8SIKisv4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hL/8/6a+Bp6drJGFaF8I0sbTX4Z8NTJZHaV+Eb2oY7K44f1c+neLUqWGGMkN6a0W8PcNs607Gl5xB8y85uQAFJMZ19H9RTFgavMGUDO0jUUuCALKsZCKa4U3JbgxMGHgTg5/YbTfhEdvkvoMrDsTGkn9vd07cjQVMa5fkd69/m4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QGR0O+Gs; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QGR0O+Gs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECB601F000E9; Thu, 25 Jun 2026 13:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1782393100; bh=ypxRrCTob/EnM5lLRf4QvV778IP5HtId8L6PptjuwhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QGR0O+Gs0pT0hSn1AouSnZd0rHPT7QQBwmT5B7I3NYt8HQOE8nuFcV2+5xkGe7ePq NWiePI6O9omWxnwipHttnh1vTc5Twi588+EkQYiaDBXE9Fo7BIGQ1Pf/uraxCDJmX5 +5DHyzwmojcPG9djVna9fjvjCnQYLK6ciazVm/As= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bartosz Golaszewski , Viken Dadhaniya Subject: [PATCH 7.0 44/49] serial: qcom_geni: Fix RX DMA stall when SE_DMA_RX_LEN_IN is zero Date: Thu, 25 Jun 2026 14:03:56 +0100 Message-ID: <20260625125643.705630978@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260625125637.527552689@linuxfoundation.org> References: <20260625125637.527552689@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Viken Dadhaniya commit b93062b6d8a1b2d9bad235cac25558a909819026 upstream. In qcom_geni_serial_handle_rx_dma(), geni_se_rx_dma_unprep() clears port->rx_dma_addr before SE_DMA_RX_LEN_IN is read. If the register is zero, for example when the RX stale counter fires on an idle line, the handler returns without calling geni_se_rx_dma_prep(). The next RX DMA interrupt then hits the !port->rx_dma_addr guard and returns immediately, so the RX DMA buffer is never rearmed and later input is lost. Keep the handler on the rearm path when rx_in is zero. Warn about the unexpected zero-length DMA completion, skip received-data handling, and always call geni_se_rx_dma_prep(). Fixes: 2aaa43c70778 ("tty: serial: qcom-geni-serial: add support for serial engine DMA") Cc: stable@vger.kernel.org Reviewed-by: Bartosz Golaszewski Signed-off-by: Viken Dadhaniya Link: https://patch.msgid.link/20260528-serial-rx-0-byte-fix-v2-1-b4195cfe342f@oss.qualcomm.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/qcom_geni_serial.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -904,12 +904,9 @@ static void qcom_geni_serial_handle_rx_d port->rx_dma_addr = 0; rx_in = readl(uport->membase + SE_DMA_RX_LEN_IN); - if (!rx_in) { - dev_warn(uport->dev, "serial engine reports 0 RX bytes in!\n"); - return; - } - - if (!drop) + if (!rx_in) + dev_warn_ratelimited(uport->dev, "serial engine reports 0 RX bytes in!\n"); + else if (!drop) handle_rx_uart(uport, rx_in); ret = geni_se_rx_dma_prep(&port->se, port->rx_buf,