summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Shahrouzi <gshahrouzi@gmail.com>2025-04-18 21:29:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-18 08:24:51 +0200
commite8b1d65f0a931b1f367363f607e64bb46fe4e83d (patch)
tree5e905c7ed82d8637b852534730e28bf3e3f480d6
parent38a8982ca0b7c7bcfd6bfeba921cde21ca744025 (diff)
staging: axis-fifo: Correct handling of tx_fifo_depth for size validation
commit 2ca34b508774aaa590fc3698a54204706ecca4ba upstream. Remove erroneous subtraction of 4 from the total FIFO depth read from device tree. The stored depth is for checking against total capacity, not initial vacancy. This prevented writes near the FIFO's full size. The check performed just before data transfer, which uses live reads of the TDFV register to determine current vacancy, correctly handles the initial Depth - 4 hardware state and subsequent FIFO fullness. Fixes: 4a965c5f89de ("staging: add driver for Xilinx AXI-Stream FIFO v4.1 IP core") Cc: stable@vger.kernel.org Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com> Link: https://lore.kernel.org/r/20250419012937.674924-1-gshahrouzi@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/axis-fifo/axis-fifo.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 611fe0d6d5a8..6769f066b0b4 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -770,9 +770,6 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
goto end;
}
- /* IP sets TDFV to fifo depth - 4 so we will do the same */
- fifo->tx_fifo_depth -= 4;
-
ret = get_dts_property(fifo, "xlnx,use-rx-data", &fifo->has_rx_fifo);
if (ret) {
dev_err(fifo->dt_device, "missing xlnx,use-rx-data property\n");