Linux IOMMU Development
 help / color / mirror / Atom feed
* missing clear bdr in check_ram_in_range_map()?
@ 2024-12-09 10:50 Baochen Qiang
  2024-12-12  7:14 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Baochen Qiang @ 2024-12-09 10:50 UTC (permalink / raw)
  To: Christoph Hellwig, Marek Szyprowski, Robin Murphy; +Cc: linux-kernel, iommu

Hi,

while checking check_ram_in_range_map() I am confused by the condition set/check on bdr.
If I am reading the code correctly, if bdr is set once, it would never get cleared, hence
that function will always returns 0.

should we clear bdr before each new iteration?

diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 5b4e6d3bf7bc..1605b956b25e 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -611,6 +611,7 @@ static int check_ram_in_range_map(unsigned long start_pfn,
                        return 1;

                start_pfn = PFN_DOWN(bdr->cpu_start) + PFN_DOWN(bdr->size);
+               bdr = NULL;
        }

        return 0;


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-03-04  1:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09 10:50 missing clear bdr in check_ram_in_range_map()? Baochen Qiang
2024-12-12  7:14 ` Christoph Hellwig
2024-12-20  3:25   ` Baochen Qiang
2025-02-28 13:22     ` Marek Szyprowski
2025-03-04  1:59       ` Baochen Qiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox