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-5.7-1' of git://git.infradead.org/users/hch/dma-mapping

Pull dma-mapping fixes from Christoph Hellwig:

- fix an integer truncation in dma_direct_get_required_mask
(Kishon Vijay Abraham)

- fix the display of dma mapping types (Grygorii Strashko)

* tag 'dma-mapping-5.7-1' of git://git.infradead.org/users/hch/dma-mapping:
dma-debug: fix displaying of dma allocation type
dma-direct: fix data truncation in dma_direct_get_required_mask()

+8 -4
+6 -3
kernel/dma/debug.c
··· 137 137 [MAP_ERR_CHECKED] = "dma map error checked", 138 138 }; 139 139 140 - static const char *type2name[5] = { "single", "page", 141 - "scather-gather", "coherent", 142 - "resource" }; 140 + static const char *type2name[] = { 141 + [dma_debug_single] = "single", 142 + [dma_debug_sg] = "scather-gather", 143 + [dma_debug_coherent] = "coherent", 144 + [dma_debug_resource] = "resource", 145 + }; 143 146 144 147 static const char *dir2name[4] = { "DMA_BIDIRECTIONAL", "DMA_TO_DEVICE", 145 148 "DMA_FROM_DEVICE", "DMA_NONE" };
+2 -1
kernel/dma/direct.c
··· 39 39 40 40 u64 dma_direct_get_required_mask(struct device *dev) 41 41 { 42 - u64 max_dma = phys_to_dma_direct(dev, (max_pfn - 1) << PAGE_SHIFT); 42 + phys_addr_t phys = (phys_addr_t)(max_pfn - 1) << PAGE_SHIFT; 43 + u64 max_dma = phys_to_dma_direct(dev, phys); 43 44 44 45 return (1ULL << (fls64(max_dma) - 1)) * 2 - 1; 45 46 }