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 0A52478F52; Mon, 12 May 2025 17:30:53 +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=1747071053; cv=none; b=ACHa6sL3jfGZ/fs7Cwa2H40f+6EOXflfz2BbmKsw+tK/X66yq2IZZm0X8TjeGG1HMxfXvaPDE5MlqBghrdRzu7r/+p6evhfkplQjesI+tHbBubpRsqBWA7ruyps45AhdfRwP0fXQPCW2KFgx4VTyW17DDEOt8NIBQJE3i/yFIsw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747071053; c=relaxed/simple; bh=6oESvyB1j7CfkifizxvZXN0fK8tkKhMepA6qv15qsLk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aK/GpzGXx9C4lli1BJEjxYDiABGYQmKNI4NSb5QtIemfOfLyw0Acgqqj9jdDy2kILBl9WCSzl5SuvjAEOLVnuoziX9tNPxuwA232iYil4nNPZTYbkspKaEhjuS5PAXZhndS3cZXtEjKJrmZGkPr96rVS8tfQuRkLiLvpRu0PQqk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NTKx5zGX; 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="NTKx5zGX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8503DC4CEE9; Mon, 12 May 2025 17:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747071052; bh=6oESvyB1j7CfkifizxvZXN0fK8tkKhMepA6qv15qsLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NTKx5zGXDfVI3B9iVkPYW9n5nfhZL/2Pjf6CmF2kkwTeRRW4eSNwj41SMUPS8eohs eJLh3TViqlKTBGGzcOBWs/m89VAtUfrYN1N7ekdoi4oDov9gcc0rMfHrM3xbyEx1mX tegMOwuutKHxG5Oi5bkF8ndTkJAePSKAW/Pmh9lE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gabriel Shahrouzi Subject: [PATCH 5.15 21/54] staging: axis-fifo: Remove hardware resets for user errors Date: Mon, 12 May 2025 19:29:33 +0200 Message-ID: <20250512172016.502438655@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250512172015.643809034@linuxfoundation.org> References: <20250512172015.643809034@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gabriel Shahrouzi commit c6e8d85fafa7193613db37da29c0e8d6e2515b13 upstream. The axis-fifo driver performs a full hardware reset (via reset_ip_core()) in several error paths within the read and write functions. This reset flushes both TX and RX FIFOs and resets the AXI-Stream links. Allow the user to handle the error without causing hardware disruption or data loss in other FIFO paths. 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/20250419004306.669605-1-gshahrouzi@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/axis-fifo/axis-fifo.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -401,16 +401,14 @@ static ssize_t axis_fifo_read(struct fil bytes_available = ioread32(fifo->base_addr + XLLF_RLR_OFFSET); if (!bytes_available) { - dev_err(fifo->dt_device, "received a packet of length 0 - fifo core will be reset\n"); - reset_ip_core(fifo); + dev_err(fifo->dt_device, "received a packet of length 0\n"); ret = -EIO; goto end_unlock; } if (bytes_available > len) { - dev_err(fifo->dt_device, "user read buffer too small (available bytes=%zu user buffer bytes=%zu) - fifo core will be reset\n", + dev_err(fifo->dt_device, "user read buffer too small (available bytes=%zu user buffer bytes=%zu)\n", bytes_available, len); - reset_ip_core(fifo); ret = -EINVAL; goto end_unlock; } @@ -419,8 +417,7 @@ static ssize_t axis_fifo_read(struct fil /* this probably can't happen unless IP * registers were previously mishandled */ - dev_err(fifo->dt_device, "received a packet that isn't word-aligned - fifo core will be reset\n"); - reset_ip_core(fifo); + dev_err(fifo->dt_device, "received a packet that isn't word-aligned\n"); ret = -EIO; goto end_unlock; } @@ -441,7 +438,6 @@ static ssize_t axis_fifo_read(struct fil if (copy_to_user(buf + copied * sizeof(u32), tmp_buf, copy * sizeof(u32))) { - reset_ip_core(fifo); ret = -EFAULT; goto end_unlock; } @@ -552,7 +548,6 @@ static ssize_t axis_fifo_write(struct fi if (copy_from_user(tmp_buf, buf + copied * sizeof(u32), copy * sizeof(u32))) { - reset_ip_core(fifo); ret = -EFAULT; goto end_unlock; }