Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'dma-mapping-6.14-2025-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux

Pull dma-mapping fix from Marek Szyprowski:

- fix missing clear bdr in check_ram_in_range_map() (Baochen Qiang)

* tag 'dma-mapping-6.14-2025-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux:
dma-mapping: fix missing clear bdr in check_ram_in_range_map()

+18 -10
+18 -10
kernel/dma/direct.c
··· 584 584 return mask >= phys_to_dma_unencrypted(dev, min_mask); 585 585 } 586 586 587 + static const struct bus_dma_region *dma_find_range(struct device *dev, 588 + unsigned long start_pfn) 589 + { 590 + const struct bus_dma_region *m; 591 + 592 + for (m = dev->dma_range_map; PFN_DOWN(m->size); m++) { 593 + unsigned long cpu_start_pfn = PFN_DOWN(m->cpu_start); 594 + 595 + if (start_pfn >= cpu_start_pfn && 596 + start_pfn - cpu_start_pfn < PFN_DOWN(m->size)) 597 + return m; 598 + } 599 + 600 + return NULL; 601 + } 602 + 587 603 /* 588 604 * To check whether all ram resource ranges are covered by dma range map 589 605 * Returns 0 when further check is needed ··· 609 593 unsigned long nr_pages, void *data) 610 594 { 611 595 unsigned long end_pfn = start_pfn + nr_pages; 612 - const struct bus_dma_region *bdr = NULL; 613 - const struct bus_dma_region *m; 614 596 struct device *dev = data; 615 597 616 598 while (start_pfn < end_pfn) { 617 - for (m = dev->dma_range_map; PFN_DOWN(m->size); m++) { 618 - unsigned long cpu_start_pfn = PFN_DOWN(m->cpu_start); 599 + const struct bus_dma_region *bdr; 619 600 620 - if (start_pfn >= cpu_start_pfn && 621 - start_pfn - cpu_start_pfn < PFN_DOWN(m->size)) { 622 - bdr = m; 623 - break; 624 - } 625 - } 601 + bdr = dma_find_range(dev, start_pfn); 626 602 if (!bdr) 627 603 return 1; 628 604