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 C285D31985C; Tue, 26 Aug 2025 14:20:33 +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=1756218033; cv=none; b=j0Zsv41DfQS5ZsxQDf0OqEAuFBGAGcC7L0euD2MUh/xtuc0H6mHX5fr6r/mUW1yMKEucsdR8ELY7Cnq4hHM61Mbd/MS65Cu1WT/CE7umQ6/b2MKxzZV0wbY8Qal06/1hUPObYi6KpI9JnZKVI9sKJ5WjJacq0wD0kuloOyzGx7c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756218033; c=relaxed/simple; bh=tl416Ah0lDjYbk5M6fNQ0SRXampkSE2J6GyKlT0HPn4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OfM+p7jnv8FsuKdI65RsXInFp0EcCfXtAGgqYO9nA0oLxXfYZE5IQ/LLApmaV/B9luMJWn04mBy/q0dabTs5ysl30atFeICHyZ0kiK/sv8afNlBMaDQWTi7vFZwQ2WgWf60B4aziVJsOxUH0soV6Gbzm3kk1l8qMTBvbj3Phceo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FzjMirnQ; 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="FzjMirnQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5283DC4CEF1; Tue, 26 Aug 2025 14:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756218033; bh=tl416Ah0lDjYbk5M6fNQ0SRXampkSE2J6GyKlT0HPn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FzjMirnQwaqiX0ztfWwt30GshnfLJtt+38lGNcNvzrBP0uSe8Ik9hNBsZI6g6XFTu Co1GHHtSw6Dfzywl1mfQ/qRQ+zblitqPDCnxuEanJ18lWy4YM/c5rULJ+l74fzUfJD qTnFdHubpFB4CVNhjoyGm6iWzYiEZOmivcAo9Wek= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Marek Szyprowski , Jason Gunthorpe , Xu Yilun , Xu Yilun Subject: [PATCH 5.10 367/523] zynq_fpga: use sgtable-based scatterlist wrappers Date: Tue, 26 Aug 2025 13:09:37 +0200 Message-ID: <20250826110933.520441847@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110924.562212281@linuxfoundation.org> References: <20250826110924.562212281@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.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marek Szyprowski commit 37e00703228ab44d0aacc32a97809a4f6f58df1b upstream. Use common wrappers operating directly on the struct sg_table objects to fix incorrect use of statterlists related calls. dma_unmap_sg() function has to be called with the number of elements originally passed to the dma_map_sg() function, not the one returned in sgtable's nents. CC: stable@vger.kernel.org Fixes: 425902f5c8e3 ("fpga zynq: Use the scatterlist interface") Signed-off-by: Marek Szyprowski Reviewed-by: Jason Gunthorpe Reviewed-by: Xu Yilun Link: https://lore.kernel.org/r/20250616120932.1090614-1-m.szyprowski@samsung.com Signed-off-by: Xu Yilun Signed-off-by: Greg Kroah-Hartman --- drivers/fpga/zynq-fpga.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/fpga/zynq-fpga.c +++ b/drivers/fpga/zynq-fpga.c @@ -406,7 +406,7 @@ static int zynq_fpga_ops_write(struct fp } priv->dma_nelms = - dma_map_sg(mgr->dev.parent, sgt->sgl, sgt->nents, DMA_TO_DEVICE); + dma_map_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0); if (priv->dma_nelms == 0) { dev_err(&mgr->dev, "Unable to DMA map (TO_DEVICE)\n"); return -ENOMEM; @@ -478,7 +478,7 @@ out_clk: clk_disable(priv->clk); out_free: - dma_unmap_sg(mgr->dev.parent, sgt->sgl, sgt->nents, DMA_TO_DEVICE); + dma_unmap_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0); return err; }