Lines Matching refs:ref

294 						  struct dma_debug_entry *ref,  in __hash_bucket_find()  argument
301 if (!match(ref, entry)) in __hash_bucket_find()
316 entry->size == ref->size ? ++match_lvl : 0; in __hash_bucket_find()
317 entry->type == ref->type ? ++match_lvl : 0; in __hash_bucket_find()
318 entry->direction == ref->direction ? ++match_lvl : 0; in __hash_bucket_find()
319 entry->sg_call_ents == ref->sg_call_ents ? ++match_lvl : 0; in __hash_bucket_find()
344 struct dma_debug_entry *ref) in bucket_find_exact() argument
346 return __hash_bucket_find(bucket, ref, exact_match); in bucket_find_exact()
350 struct dma_debug_entry *ref, in bucket_find_contain() argument
354 struct dma_debug_entry *entry, index = *ref; in bucket_find_contain()
358 entry = __hash_bucket_find(*bucket, ref, containing_match); in bucket_find_contain()
963 static void check_unmap(struct dma_debug_entry *ref) in check_unmap() argument
969 bucket = get_hash_bucket(ref, &flags); in check_unmap()
970 entry = bucket_find_exact(bucket, ref); in check_unmap()
976 if (dma_mapping_error(ref->dev, ref->dev_addr)) { in check_unmap()
977 err_printk(ref->dev, NULL, in check_unmap()
981 err_printk(ref->dev, NULL, in check_unmap()
985 ref->dev_addr, ref->size); in check_unmap()
990 if (ref->size != entry->size) { in check_unmap()
991 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
995 ref->dev_addr, entry->size, ref->size); in check_unmap()
998 if (ref->type != entry->type) { in check_unmap()
999 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1003 ref->dev_addr, ref->size, in check_unmap()
1004 type2name[entry->type], type2name[ref->type]); in check_unmap()
1006 (phys_addr(ref) != phys_addr(entry))) { in check_unmap()
1007 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1012 ref->dev_addr, ref->size, in check_unmap()
1014 phys_addr(ref)); in check_unmap()
1017 if (ref->sg_call_ents && ref->type == dma_debug_sg && in check_unmap()
1018 ref->sg_call_ents != entry->sg_call_ents) { in check_unmap()
1019 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1022 entry->sg_call_ents, ref->sg_call_ents); in check_unmap()
1029 if (ref->direction != entry->direction) { in check_unmap()
1030 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1034 ref->dev_addr, ref->size, in check_unmap()
1036 dir2name[ref->direction]); in check_unmap()
1045 err_printk(ref->dev, entry, in check_unmap()
1049 ref->dev_addr, ref->size, in check_unmap()
1095 struct dma_debug_entry *ref, in check_sync() argument
1102 bucket = get_hash_bucket(ref, &flags); in check_sync()
1104 entry = bucket_find_contain(&bucket, ref, &flags); in check_sync()
1110 (unsigned long long)ref->dev_addr, ref->size); in check_sync()
1114 if (ref->size > entry->size) { in check_sync()
1121 ref->size); in check_sync()
1127 if (ref->direction != entry->direction) { in check_sync()
1132 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1134 dir2name[ref->direction]); in check_sync()
1138 !(ref->direction == DMA_TO_DEVICE)) in check_sync()
1143 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1145 dir2name[ref->direction]); in check_sync()
1148 !(ref->direction == DMA_FROM_DEVICE)) in check_sync()
1153 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1155 dir2name[ref->direction]); in check_sync()
1157 if (ref->sg_call_ents && ref->type == dma_debug_sg && in check_sync()
1158 ref->sg_call_ents != entry->sg_call_ents) { in check_sync()
1159 err_printk(ref->dev, entry, "device driver syncs " in check_sync()
1162 entry->sg_call_ents, ref->sg_call_ents); in check_sync()
1249 struct dma_debug_entry ref; in debug_dma_mapping_error() local
1257 ref.dev = dev; in debug_dma_mapping_error()
1258 ref.dev_addr = dma_addr; in debug_dma_mapping_error()
1259 bucket = get_hash_bucket(&ref, &flags); in debug_dma_mapping_error()
1262 if (!exact_match(&ref, entry)) in debug_dma_mapping_error()
1288 struct dma_debug_entry ref = { in debug_dma_unmap_page() local
1298 check_unmap(&ref); in debug_dma_unmap_page()
1340 struct dma_debug_entry *ref) in get_nr_mapped_entries() argument
1347 bucket = get_hash_bucket(ref, &flags); in get_nr_mapped_entries()
1348 entry = bucket_find_exact(bucket, ref); in get_nr_mapped_entries()
1369 struct dma_debug_entry ref = { in debug_dma_unmap_sg() local
1384 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_unmap_sg()
1386 check_unmap(&ref); in debug_dma_unmap_sg()
1428 struct dma_debug_entry ref = { in debug_dma_free_coherent() local
1442 ref.pfn = vmalloc_to_pfn(virt); in debug_dma_free_coherent()
1444 ref.pfn = page_to_pfn(virt_to_page(virt)); in debug_dma_free_coherent()
1449 check_unmap(&ref); in debug_dma_free_coherent()
1480 struct dma_debug_entry ref = { in debug_dma_unmap_resource() local
1491 check_unmap(&ref); in debug_dma_unmap_resource()
1497 struct dma_debug_entry ref; in debug_dma_sync_single_for_cpu() local
1502 ref.type = dma_debug_single; in debug_dma_sync_single_for_cpu()
1503 ref.dev = dev; in debug_dma_sync_single_for_cpu()
1504 ref.dev_addr = dma_handle; in debug_dma_sync_single_for_cpu()
1505 ref.size = size; in debug_dma_sync_single_for_cpu()
1506 ref.direction = direction; in debug_dma_sync_single_for_cpu()
1507 ref.sg_call_ents = 0; in debug_dma_sync_single_for_cpu()
1509 check_sync(dev, &ref, true); in debug_dma_sync_single_for_cpu()
1516 struct dma_debug_entry ref; in debug_dma_sync_single_for_device() local
1521 ref.type = dma_debug_single; in debug_dma_sync_single_for_device()
1522 ref.dev = dev; in debug_dma_sync_single_for_device()
1523 ref.dev_addr = dma_handle; in debug_dma_sync_single_for_device()
1524 ref.size = size; in debug_dma_sync_single_for_device()
1525 ref.direction = direction; in debug_dma_sync_single_for_device()
1526 ref.sg_call_ents = 0; in debug_dma_sync_single_for_device()
1528 check_sync(dev, &ref, false); in debug_dma_sync_single_for_device()
1542 struct dma_debug_entry ref = { in debug_dma_sync_sg_for_cpu() local
1554 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_sync_sg_for_cpu()
1559 check_sync(dev, &ref, true); in debug_dma_sync_sg_for_cpu()
1574 struct dma_debug_entry ref = { in debug_dma_sync_sg_for_device() local
1585 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_sync_sg_for_device()
1590 check_sync(dev, &ref, false); in debug_dma_sync_sg_for_device()