* Re: [PATCH] dma-direct: Improve readability of the dma_direct_map_sg() for P2PDMA case
2026-07-13 8:30 ` [PATCH] dma-direct: Improve readability of the dma_direct_map_sg() for P2PDMA case Marek Szyprowski
@ 2026-07-13 9:37 ` Leon Romanovsky
2026-07-13 15:47 ` Logan Gunthorpe
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Leon Romanovsky @ 2026-07-13 9:37 UTC (permalink / raw)
To: Marek Szyprowski
Cc: iommu, linux-kernel, Robin Murphy, Lu Baolu, Luis Chamberlain,
Bjorn Helgaas, Logan Gunthorpe, Christoph Hellwig, Li RongQing
On Mon, Jul 13, 2026 at 10:30:22AM +0200, Marek Szyprowski wrote:
> Improve readability of the sg_dma_len assignment in the P2PDMA cases by
> removing duplicated code, which was a direct result of the d0d08f4bd7f6
> ("dma-direct: Fix missing sg_dma_len assignment in P2PDMA bus mappings")
> fix. No functional change.
>
> Suggested-by: Leon Romanovsky <leon@kernel.org>
> Link: https://lore.kernel.org/all/20260604071856.GA245424@unreal/
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> kernel/dma/direct.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] dma-direct: Improve readability of the dma_direct_map_sg() for P2PDMA case
2026-07-13 8:30 ` [PATCH] dma-direct: Improve readability of the dma_direct_map_sg() for P2PDMA case Marek Szyprowski
2026-07-13 9:37 ` Leon Romanovsky
@ 2026-07-13 15:47 ` Logan Gunthorpe
2026-07-14 6:03 ` Marek Szyprowski
2026-07-14 7:37 ` Pranjal Shrivastava
3 siblings, 0 replies; 5+ messages in thread
From: Logan Gunthorpe @ 2026-07-13 15:47 UTC (permalink / raw)
To: Marek Szyprowski, iommu, linux-kernel
Cc: Leon Romanovsky, Robin Murphy, Lu Baolu, Luis Chamberlain,
Bjorn Helgaas, Christoph Hellwig, Li RongQing
On 2026-07-13 02:30, Marek Szyprowski wrote:
> Improve readability of the sg_dma_len assignment in the P2PDMA cases by
> removing duplicated code, which was a direct result of the d0d08f4bd7f6
> ("dma-direct: Fix missing sg_dma_len assignment in P2PDMA bus mappings")
> fix. No functional change.
>
> Suggested-by: Leon Romanovsky <leon@kernel.org>
> Link: https://lore.kernel.org/all/20260604071856.GA245424@unreal/
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Looks good to me, thanks.
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] dma-direct: Improve readability of the dma_direct_map_sg() for P2PDMA case
2026-07-13 8:30 ` [PATCH] dma-direct: Improve readability of the dma_direct_map_sg() for P2PDMA case Marek Szyprowski
2026-07-13 9:37 ` Leon Romanovsky
2026-07-13 15:47 ` Logan Gunthorpe
@ 2026-07-14 6:03 ` Marek Szyprowski
2026-07-14 7:37 ` Pranjal Shrivastava
3 siblings, 0 replies; 5+ messages in thread
From: Marek Szyprowski @ 2026-07-14 6:03 UTC (permalink / raw)
To: iommu, linux-kernel
Cc: Leon Romanovsky, Robin Murphy, Lu Baolu, Luis Chamberlain,
Bjorn Helgaas, Logan Gunthorpe, Christoph Hellwig, Li RongQing
On 13.07.2026 10:30, Marek Szyprowski wrote:
> Improve readability of the sg_dma_len assignment in the P2PDMA cases by
> removing duplicated code, which was a direct result of the d0d08f4bd7f6
> ("dma-direct: Fix missing sg_dma_len assignment in P2PDMA bus mappings")
> fix. No functional change.
>
> Suggested-by: Leon Romanovsky <leon@kernel.org>
> Link: https://lore.kernel.org/all/20260604071856.GA245424@unreal/
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Pushed to dma-mapping-for-next.
> ---
> kernel/dma/direct.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
> index 4391b797d4db..d8219efe3273 100644
> --- a/kernel/dma/direct.c
> +++ b/kernel/dma/direct.c
> @@ -486,15 +486,14 @@ int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
> goto out_unmap;
> }
> break;
> case PCI_P2PDMA_MAP_BUS_ADDR:
> sg->dma_address = pci_p2pdma_bus_addr_map(
> p2pdma_state.mem, sg_phys(sg));
> - sg_dma_len(sg) = sg->length;
> sg_dma_mark_bus_address(sg);
> - continue;
> + break;
> default:
> ret = -EREMOTEIO;
> goto out_unmap;
> }
> sg_dma_len(sg) = sg->length;
> }
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] dma-direct: Improve readability of the dma_direct_map_sg() for P2PDMA case
2026-07-13 8:30 ` [PATCH] dma-direct: Improve readability of the dma_direct_map_sg() for P2PDMA case Marek Szyprowski
` (2 preceding siblings ...)
2026-07-14 6:03 ` Marek Szyprowski
@ 2026-07-14 7:37 ` Pranjal Shrivastava
3 siblings, 0 replies; 5+ messages in thread
From: Pranjal Shrivastava @ 2026-07-14 7:37 UTC (permalink / raw)
To: Marek Szyprowski
Cc: iommu, linux-kernel, Leon Romanovsky, Robin Murphy, Lu Baolu,
Luis Chamberlain, Bjorn Helgaas, Logan Gunthorpe,
Christoph Hellwig, Li RongQing
On Mon, Jul 13, 2026 at 10:30:22AM +0200, Marek Szyprowski wrote:
> Improve readability of the sg_dma_len assignment in the P2PDMA cases by
> removing duplicated code, which was a direct result of the d0d08f4bd7f6
> ("dma-direct: Fix missing sg_dma_len assignment in P2PDMA bus mappings")
> fix. No functional change.
>
> Suggested-by: Leon Romanovsky <leon@kernel.org>
> Link: https://lore.kernel.org/all/20260604071856.GA245424@unreal/
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> kernel/dma/direct.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
> index 4391b797d4db..d8219efe3273 100644
> --- a/kernel/dma/direct.c
> +++ b/kernel/dma/direct.c
> @@ -486,15 +486,14 @@ int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
> goto out_unmap;
> }
> break;
> case PCI_P2PDMA_MAP_BUS_ADDR:
> sg->dma_address = pci_p2pdma_bus_addr_map(
> p2pdma_state.mem, sg_phys(sg));
> - sg_dma_len(sg) = sg->length;
> sg_dma_mark_bus_address(sg);
> - continue;
> + break;
> default:
> ret = -EREMOTEIO;
> goto out_unmap;
> }
> sg_dma_len(sg) = sg->length;
> }
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Thanks,
Praan
^ permalink raw reply [flat|nested] 5+ messages in thread