]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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>
Sun, 18 May 2025 06:24:06 +0000 (08:24 +0200)
commit0f2b18c0760406d8f7cfa9fa2f7e07b02e95d2b5
treede7fc4b3feddac30bdc2ec0360c97d5aa5aee523
parentf4d6b9f413cb87a9833282066a7eb732a15a3442
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>
drivers/staging/axis-fifo/axis-fifo.c