mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
Merge tag 'dma-mapping-5.19-2022-06-06' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping fixes from Christoph Hellwig: - fix a regressin in setting swiotlb ->force_bounce (me) - make dma-debug less chatty (Rob Clark) * tag 'dma-mapping-5.19-2022-06-06' of git://git.infradead.org/users/hch/dma-mapping: swiotlb: fix setting ->force_bounce dma-debug: make things less spammy under memory pressure
This commit is contained in:
@@ -564,7 +564,7 @@ static void add_dma_entry(struct dma_debug_entry *entry, unsigned long attrs)
|
|||||||
|
|
||||||
rc = active_cacheline_insert(entry);
|
rc = active_cacheline_insert(entry);
|
||||||
if (rc == -ENOMEM) {
|
if (rc == -ENOMEM) {
|
||||||
pr_err("cacheline tracking ENOMEM, dma-debug disabled\n");
|
pr_err_once("cacheline tracking ENOMEM, dma-debug disabled\n");
|
||||||
global_disable = true;
|
global_disable = true;
|
||||||
} else if (rc == -EEXIST && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) {
|
} else if (rc == -EEXIST && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) {
|
||||||
err_printk(entry->dev, entry,
|
err_printk(entry->dev, entry,
|
||||||
|
@@ -192,7 +192,7 @@ void __init swiotlb_update_mem_attributes(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
|
static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
|
||||||
unsigned long nslabs, bool late_alloc)
|
unsigned long nslabs, unsigned int flags, bool late_alloc)
|
||||||
{
|
{
|
||||||
void *vaddr = phys_to_virt(start);
|
void *vaddr = phys_to_virt(start);
|
||||||
unsigned long bytes = nslabs << IO_TLB_SHIFT, i;
|
unsigned long bytes = nslabs << IO_TLB_SHIFT, i;
|
||||||
@@ -203,8 +203,7 @@ static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
|
|||||||
mem->index = 0;
|
mem->index = 0;
|
||||||
mem->late_alloc = late_alloc;
|
mem->late_alloc = late_alloc;
|
||||||
|
|
||||||
if (swiotlb_force_bounce)
|
mem->force_bounce = swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
|
||||||
mem->force_bounce = true;
|
|
||||||
|
|
||||||
spin_lock_init(&mem->lock);
|
spin_lock_init(&mem->lock);
|
||||||
for (i = 0; i < mem->nslabs; i++) {
|
for (i = 0; i < mem->nslabs; i++) {
|
||||||
@@ -275,8 +274,7 @@ retry:
|
|||||||
panic("%s: Failed to allocate %zu bytes align=0x%lx\n",
|
panic("%s: Failed to allocate %zu bytes align=0x%lx\n",
|
||||||
__func__, alloc_size, PAGE_SIZE);
|
__func__, alloc_size, PAGE_SIZE);
|
||||||
|
|
||||||
swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, false);
|
swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, flags, false);
|
||||||
mem->force_bounce = flags & SWIOTLB_FORCE;
|
|
||||||
|
|
||||||
if (flags & SWIOTLB_VERBOSE)
|
if (flags & SWIOTLB_VERBOSE)
|
||||||
swiotlb_print_info();
|
swiotlb_print_info();
|
||||||
@@ -348,7 +346,7 @@ retry:
|
|||||||
|
|
||||||
set_memory_decrypted((unsigned long)vstart,
|
set_memory_decrypted((unsigned long)vstart,
|
||||||
(nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT);
|
(nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT);
|
||||||
swiotlb_init_io_tlb_mem(mem, virt_to_phys(vstart), nslabs, true);
|
swiotlb_init_io_tlb_mem(mem, virt_to_phys(vstart), nslabs, 0, true);
|
||||||
|
|
||||||
swiotlb_print_info();
|
swiotlb_print_info();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -835,8 +833,8 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
|
|||||||
|
|
||||||
set_memory_decrypted((unsigned long)phys_to_virt(rmem->base),
|
set_memory_decrypted((unsigned long)phys_to_virt(rmem->base),
|
||||||
rmem->size >> PAGE_SHIFT);
|
rmem->size >> PAGE_SHIFT);
|
||||||
swiotlb_init_io_tlb_mem(mem, rmem->base, nslabs, false);
|
swiotlb_init_io_tlb_mem(mem, rmem->base, nslabs, SWIOTLB_FORCE,
|
||||||
mem->force_bounce = true;
|
false);
|
||||||
mem->for_alloc = true;
|
mem->for_alloc = true;
|
||||||
|
|
||||||
rmem->priv = mem;
|
rmem->priv = mem;
|
||||||
|
Reference in New Issue
Block a user