[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250419012937.674924-1-gshahrouzi@gmail.com>
Date: Fri, 18 Apr 2025 21:29:37 -0400
From: Gabriel Shahrouzi <gshahrouzi@...il.com>
To: gregkh@...uxfoundation.org,
gshahrouzi@...il.com,
jacobsfeder@...il.com,
linux-kernel@...r.kernel.org,
linux-staging@...ts.linux.dev,
sergio.paracuellos@...il.com
Cc: skhan@...uxfoundation.org,
linux-kernel-mentees@...ts.linux.dev,
stable@...r.kernel.org
Subject: [PATCH] staging: axis-fifo: Correct handling of tx_fifo_depth for size validation
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@...r.kernel.org
Signed-off-by: Gabriel Shahrouzi <gshahrouzi@...il.com>
---
drivers/staging/axis-fifo/axis-fifo.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 76db29e4d2828..351f983ef9149 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");
--
2.43.0
Powered by blists - more mailing lists