Skip to content

Commit 2ca34b5

Browse files
gShahrgregkh
authored andcommitted
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: 4a965c5 ("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>
1 parent 98698ca commit 2ca34b5

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/staging/axis-fifo/axis-fifo.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,6 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
775775
goto end;
776776
}
777777

778-
/* IP sets TDFV to fifo depth - 4 so we will do the same */
779-
fifo->tx_fifo_depth -= 4;
780-
781778
ret = get_dts_property(fifo, "xlnx,use-rx-data", &fifo->has_rx_fifo);
782779
if (ret) {
783780
dev_err(fifo->dt_device, "missing xlnx,use-rx-data property\n");

0 commit comments

Comments
 (0)