From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1251254863; Mon, 12 May 2025 17:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747072504; cv=none; b=M9jDf81wGDyZ35YrjJ4ny/WKZrI6dbgTfjnMLKeLAMBSgxEH2CsnRJZ71iCwv0Rc65AAKn0eJlFr2ffZqmF88Cn5vg7wJOaJlPacGjmqXj5Gy32Gd6TEApQKLe/HMrqygBePpEAVMSdL/rHTbHGPjSkoAKO0naliQTsPe6LKevA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747072504; c=relaxed/simple; bh=z2YuMkXhV4+T/vurvL3WO5b5HnpTMzYXXIu++uJPasg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BVL/EJlZLcMF1WBTbq8MxB13fIdkds1RUhRLtqG4t5MsQhSZGapj2c3hucr9/0N10GXDEsN1cXkfKbLsXPaRlxZu8UUtIRGaKETQUDREcLFz0Pmvi2AF6WKl9jn2VuLshA4s2kn+ki8eGtIMgqEFADrE8bDGbL2lUPnCF5xpFOY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LLHrSQDG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="LLHrSQDG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A3B7C4CEE7; Mon, 12 May 2025 17:55:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747072504; bh=z2YuMkXhV4+T/vurvL3WO5b5HnpTMzYXXIu++uJPasg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LLHrSQDGT205ynLQTZKAgY9dvQonjPL9GelU9Y8EGOZyT4mM+Bh/Ow8h5vo3uCOaK iJTdavMgvArSeDy1UBzWlqDd9CBSGAoh9oQM0OcyvOsYmvbwHkujo9BhCp6jsgkdSI HQFKaGZsJJEmP15lb3kDwzucWf9MgrQCK0yxS78g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gabriel Shahrouzi Subject: [PATCH 6.1 31/92] staging: axis-fifo: Correct handling of tx_fifo_depth for size validation Date: Mon, 12 May 2025 19:45:06 +0200 Message-ID: <20250512172024.402856348@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250512172023.126467649@linuxfoundation.org> References: <20250512172023.126467649@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gabriel Shahrouzi 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 Link: https://lore.kernel.org/r/20250419012937.674924-1-gshahrouzi@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/axis-fifo/axis-fifo.c | 3 --- 1 file changed, 3 deletions(-) --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -777,9 +777,6 @@ static int axis_fifo_parse_dt(struct axi 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");