]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: axis-fifo: Correct handling of tx_fifo_depth for size validation
authorGabriel Shahrouzi <gshahrouzi@gmail.com>
Sat, 19 Apr 2025 01:29:37 +0000 (21:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 14:14:15 +0000 (16:14 +0200)
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>
drivers/staging/axis-fifo/axis-fifo.c

index 7540c20090c78b817c1fb825a2fe340912e4b9a4..04b3dc3cfe7c840c328cc286113c66dfe6c0dbc8 100644 (file)
@@ -775,9 +775,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");