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 44FB71CDFAC; Sun, 7 Sep 2025 20:11:35 +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=1757275896; cv=none; b=sGixS1u+rH0uo+eJZpxGdmgMDCE028wioqfdO2IDYU5F7eBvzf2Ad4dRk/gUyIP+MD3mTzS60wSJLdLgDGgTVZ1VcU7XV4ScKIgs9h0NvnHNNcdQtFEk8LFNovLU5IaFdooUjRL8tMKxol24Ne3PFuFNjROg6JEPk6k8YXckp/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757275896; c=relaxed/simple; bh=acYXjUc5HStyhqn37aqtBfWYG5SxopnuwoEEfz6VIu8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ku1aXRhovZotSlTZpzDlEGmNdiWl0uUl+kMCTNj4j+blw8gIfCWFmqquxDENiYA4InHGVpZJIB5HZPTUmBkZejfVVtLjVkpeh3naKh8eZDiggHFJvwXl3JWcIdhMoYR3IS7e6Hc76ZBh8/zzeJY4EhF3b6p9zjHSaMNV/1XhI4s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Fh/DufqT; 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="Fh/DufqT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A54FC4CEF0; Sun, 7 Sep 2025 20:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757275895; bh=acYXjUc5HStyhqn37aqtBfWYG5SxopnuwoEEfz6VIu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fh/DufqTxPJuXnMST7SnkQ8rivteG+X9Qh4r76P28P6VBo2q4IUHIuuPi27PpmMG8 aj1IPE2bXnWUDX2XW7ixD/oz02hFBlqQ+c+B8xHYLUg6y8pNTrC52Wwc3r+Ndbx1zp 0XET8GHXF2Q310yraqmqVK4UC738zC+Vkb1/FLlA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Larisa Grigore , Frank Li , James Clark , Mark Brown , Sasha Levin Subject: [PATCH 5.4 43/45] spi: spi-fsl-lpspi: Reset FIFO and disable module on transfer abort Date: Sun, 7 Sep 2025 21:58:29 +0200 Message-ID: <20250907195602.258565981@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250907195600.953058118@linuxfoundation.org> References: <20250907195600.953058118@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Larisa Grigore [ Upstream commit e811b088a3641861fc9d2b2b840efc61a0f1907d ] In DMA mode fsl_lpspi_reset() is always called at the end, even when the transfer is aborted. In PIO mode aborts skip the reset leaving the FIFO filled and the module enabled. Fix it by always calling fsl_lpspi_reset(). Fixes: a15dc3d657fa ("spi: lpspi: Fix CLK pin becomes low before one transfer") Signed-off-by: Larisa Grigore Reviewed-by: Frank Li Signed-off-by: James Clark Link: https://patch.msgid.link/20250828-james-nxp-lpspi-v2-3-6262b9aa9be4@linaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-fsl-lpspi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 6cabad2923aec..789cdb001eb64 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -722,12 +722,10 @@ static int fsl_lpspi_pio_transfer(struct spi_controller *controller, fsl_lpspi_write_tx_fifo(fsl_lpspi); ret = fsl_lpspi_wait_for_completion(controller); - if (ret) - return ret; fsl_lpspi_reset(fsl_lpspi); - return 0; + return ret; } static int fsl_lpspi_transfer_one(struct spi_controller *controller, -- 2.51.0