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 8BF24352093; Tue, 26 Aug 2025 14:40:09 +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=1756219209; cv=none; b=RF8Zac01AEgEkp+5DGUWfyQKSqwqyCtxklbieDJI5Bs/zVnvdT9POXA+eXx5yDmEyFZSH1fWQBpEBXxBcnSurPoKNWM+sjhiBRagYht/n9G0PlYbZ9i6q9gVadzcTtLKPgmx1BFkGvkP9WvkpkzqNl+1C7NvCiCVZbTEX900CgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756219209; c=relaxed/simple; bh=jB0CQP2g9rej0iHB/geKuu6oGN2riMC0LJNGML0tySc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=elhGJtTkr2dDgWUPb1+jmyi7S7rbVJrU+fjqtZfSAzrBsnoTz/SpkBX/09AkdfVkrTuqVCcf1UcWVTvCGuUR2rDJ1TXnau0RJ5e+k2N2LiWKNbYikOYEYc1jcZKEwWasWmCeH9GlHciCBnBeR2xw60unbJJcXV7WTuzg7UgPtl8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aPTTrKL7; 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="aPTTrKL7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15039C4CEF1; Tue, 26 Aug 2025 14:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756219209; bh=jB0CQP2g9rej0iHB/geKuu6oGN2riMC0LJNGML0tySc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aPTTrKL7qE6itRFWtIWLCXjuWArd4SQcF1jF39msIcz23678t9Mv8fcTQq7h8+wO4 Ejz7HunVUvnn+VcBOUYRygRPlgqHTmzU1vyHxtuhoprMDGi0g7DuG5q4RTsWwwcqzr SIbxsu1MLzZHSEhF00RvLlljrU+UjMa6bRXpROn4= 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.4 295/403] zynq_fpga: use sgtable-based scatterlist wrappers Date: Tue, 26 Aug 2025 13:10:21 +0200 Message-ID: <20250826110914.958050732@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110905.607690791@linuxfoundation.org> References: <20250826110905.607690791@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: 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; }