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 6623034F486; Tue, 26 Aug 2025 13:58:10 +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=1756216690; cv=none; b=AehGaeDRSALJjUYcbzwcgre2g70fVHDkwO3nU0KaT4bHzhsXDqekIcPkpvpf/9MOfiK+NdCa20GjkKgdZhcScwlqsbwfRDMfDtyTdARnwGlqO8cU/xcRHgIwI81FbMhvn4/XSPVVhvTER4U3sk41oIBr+H9wcdBbE+FcnVNof+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756216690; c=relaxed/simple; bh=WsZVPhqxQ00nForpI4Dt/CnR7O5Zmqh/CgJGA6rxGj0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t6E1sQnaoJEtrLr3GRiidMQwaP1/L5/Jd4PyYsWgudZJcX8py5H7bBEYfACj/eBjM0+xP0cYwRC9lRcUq8fC5kMcRDETqb5I63luboBcybdr78rfHd5mcBDDyuR8fqIpacRFa7n+zPW/udY4JQsiz61YQkFeI0DXXGXiMUkcWJc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kwh7aUGQ; 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="kwh7aUGQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAFC6C4CEF1; Tue, 26 Aug 2025 13:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756216690; bh=WsZVPhqxQ00nForpI4Dt/CnR7O5Zmqh/CgJGA6rxGj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kwh7aUGQLsr9PMPSYCjI2kG54FfHsWpFe/JTmUp34sEb4jdtF29DG6E9E9AptzdFO RKnKyx1Q+sgBhUOXdI3tlK20EAoeeByrTfAjFeNmtGc4q2lQ2Jyd/QGTEXzcfhNez/ ckcwtMmJpDuGj+DyPFyeOBjwamhYS4TagsC2mi2g= 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.15 475/644] zynq_fpga: use sgtable-based scatterlist wrappers Date: Tue, 26 Aug 2025 13:09:26 +0200 Message-ID: <20250826110958.254859985@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@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.15-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; }