All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samiullah Khawaja <skhawaja@google.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	 Robin Murphy <robin.murphy@arm.com>,
	Jon Mason <jdmason@kudzu.us>, Dave Jiang <dave.jiang@intel.com>,
	 Allen Hubbe <allenbh@gmail.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	 ntb@lists.linux.dev
Subject: Re: [PATCH v2 3/6] dma-debug: Remove unused DMA attribute parameter
Date: Wed, 6 May 2026 17:47:31 +0000	[thread overview]
Message-ID: <aft-oG90nnHkjzDb@google.com> (raw)
In-Reply-To: <20260501-dma-attrs-debug-v2-3-8dbac75cd501@nvidia.com>

On Fri, May 01, 2026 at 09:35:07AM +0300, Leon Romanovsky wrote:
>From: Leon Romanovsky <leonro@nvidia.com>
>
>debug_dma_alloc_pages() always receives a DMA attribute value of 0,
>because dma_alloc_pages() never receives any attributes from its callers.
>As preparation for upcoming patches, remove this unused attribute from
>the debug routine.
>
>Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
>---
> kernel/dma/debug.c   | 5 ++---
> kernel/dma/debug.h   | 6 ++----
> kernel/dma/mapping.c | 2 +-
> 3 files changed, 5 insertions(+), 8 deletions(-)
>
>diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
>index 1a725edbbbf6a..3b53495337f5c 100644
>--- a/kernel/dma/debug.c
>+++ b/kernel/dma/debug.c
>@@ -1567,8 +1567,7 @@ void debug_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
>
> void debug_dma_alloc_pages(struct device *dev, struct page *page,
> 			   size_t size, int direction,
>-			   dma_addr_t dma_addr,
>-			   unsigned long attrs)
>+			   dma_addr_t dma_addr)
> {
> 	struct dma_debug_entry *entry;
>
>@@ -1586,7 +1585,7 @@ void debug_dma_alloc_pages(struct device *dev, struct page *page,
> 	entry->dev_addr  = dma_addr;
> 	entry->direction = direction;
>
>-	add_dma_entry(entry, attrs);
>+	add_dma_entry(entry, 0);
> }
>
> void debug_dma_free_pages(struct device *dev, struct page *page,
>diff --git a/kernel/dma/debug.h b/kernel/dma/debug.h
>index da7be0bddcf67..24b8610850fbd 100644
>--- a/kernel/dma/debug.h
>+++ b/kernel/dma/debug.h
>@@ -47,8 +47,7 @@ extern void debug_dma_sync_sg_for_device(struct device *dev,
> 					 int nelems, int direction);
> extern void debug_dma_alloc_pages(struct device *dev, struct page *page,
> 				  size_t size, int direction,
>-				  dma_addr_t dma_addr,
>-				  unsigned long attrs);
>+				  dma_addr_t dma_addr);
> extern void debug_dma_free_pages(struct device *dev, struct page *page,
> 				 size_t size, int direction,
> 				 dma_addr_t dma_addr);
>@@ -113,8 +112,7 @@ static inline void debug_dma_sync_sg_for_device(struct device *dev,
>
> static inline void debug_dma_alloc_pages(struct device *dev, struct page *page,
> 					 size_t size, int direction,
>-					 dma_addr_t dma_addr,
>-					 unsigned long attrs)
>+					 dma_addr_t dma_addr)
> {
> }
>
>diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
>index 23ed8eb9233e5..6cbefbd4158c8 100644
>--- a/kernel/dma/mapping.c
>+++ b/kernel/dma/mapping.c
>@@ -733,7 +733,7 @@ struct page *dma_alloc_pages(struct device *dev, size_t size,
> 	if (page) {
> 		trace_dma_alloc_pages(dev, page_to_virt(page), *dma_handle,
> 				      size, dir, gfp, 0);
>-		debug_dma_alloc_pages(dev, page, size, dir, *dma_handle, 0);
>+		debug_dma_alloc_pages(dev, page, size, dir, *dma_handle);
> 	} else {
> 		trace_dma_alloc_pages(dev, NULL, 0, size, dir, gfp, 0);
> 	}
>
>-- 
>2.53.0
>
>

Reviewed-by: Samiullah Khawaja <skhawaja@google.com>

  reply	other threads:[~2026-05-06 17:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260501063531eucas1p1019e81b1904fc7f0811b3c50cbbf9567@eucas1p1.samsung.com>
2026-05-01  6:35 ` [PATCH v2 0/6] Add DMA attributes tracking Leon Romanovsky
2026-05-01  6:35   ` [PATCH v2 1/6] ntb: Store original DMA address for future release Leon Romanovsky
2026-05-01 17:00     ` Dave Jiang
2026-05-01  6:35   ` [PATCH v2 2/6] ntb: Use consistent DMA attributes when freeing DMA mappings Leon Romanovsky
2026-05-01 17:00     ` Dave Jiang
2026-05-01  6:35   ` [PATCH v2 3/6] dma-debug: Remove unused DMA attribute parameter Leon Romanovsky
2026-05-06 17:47     ` Samiullah Khawaja [this message]
2026-05-01  6:35   ` [PATCH v2 4/6] dma-debug: Record DMA attributes in debug entry Leon Romanovsky
2026-05-06 17:53     ` Samiullah Khawaja
2026-05-01  6:35   ` [PATCH v2 5/6] dma-debug: Feed DMA attribute for unmapping flows too Leon Romanovsky
2026-05-06 18:06     ` Samiullah Khawaja
2026-05-01  6:35   ` [PATCH v2 6/6] dma-debug: Ensure mappings are created and released with matching attributes Leon Romanovsky
2026-05-06 18:16     ` Samiullah Khawaja
2026-05-08  8:50   ` [PATCH v2 0/6] Add DMA attributes tracking Marek Szyprowski
2026-05-08 16:20     ` Dave Jiang
2026-05-08 20:31       ` Marek Szyprowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aft-oG90nnHkjzDb@google.com \
    --to=skhawaja@google.com \
    --cc=allenbh@gmail.com \
    --cc=dave.jiang@intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jdmason@kudzu.us \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=ntb@lists.linux.dev \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.