Lines Matching full:ref
293 struct dma_debug_entry *ref, in __hash_bucket_find() argument
300 if (!match(ref, entry)) in __hash_bucket_find()
315 entry->size == ref->size ? ++match_lvl : 0; in __hash_bucket_find()
316 entry->type == ref->type ? ++match_lvl : 0; in __hash_bucket_find()
317 entry->direction == ref->direction ? ++match_lvl : 0; in __hash_bucket_find()
318 entry->sg_call_ents == ref->sg_call_ents ? ++match_lvl : 0; in __hash_bucket_find()
343 struct dma_debug_entry *ref) in bucket_find_exact() argument
345 return __hash_bucket_find(bucket, ref, exact_match); in bucket_find_exact()
349 struct dma_debug_entry *ref, in bucket_find_contain() argument
353 unsigned int max_range = dma_get_max_seg_size(ref->dev); in bucket_find_contain()
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()
946 static void check_unmap(struct dma_debug_entry *ref) in check_unmap() argument
952 bucket = get_hash_bucket(ref, &flags); in check_unmap()
953 entry = bucket_find_exact(bucket, ref); in check_unmap()
959 if (dma_mapping_error(ref->dev, ref->dev_addr)) { in check_unmap()
960 err_printk(ref->dev, NULL, in check_unmap()
964 err_printk(ref->dev, NULL, in check_unmap()
968 ref->dev_addr, ref->size); in check_unmap()
973 if (ref->size != entry->size) { in check_unmap()
974 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
978 ref->dev_addr, entry->size, ref->size); in check_unmap()
981 if (ref->type != entry->type) { in check_unmap()
982 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
986 ref->dev_addr, ref->size, in check_unmap()
987 type2name[entry->type], type2name[ref->type]); in check_unmap()
989 (phys_addr(ref) != phys_addr(entry))) { in check_unmap()
990 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
995 ref->dev_addr, ref->size, in check_unmap()
997 phys_addr(ref)); in check_unmap()
1000 if (ref->sg_call_ents && ref->type == dma_debug_sg && in check_unmap()
1001 ref->sg_call_ents != entry->sg_call_ents) { in check_unmap()
1002 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1005 entry->sg_call_ents, ref->sg_call_ents); in check_unmap()
1012 if (ref->direction != entry->direction) { in check_unmap()
1013 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1017 ref->dev_addr, ref->size, in check_unmap()
1019 dir2name[ref->direction]); in check_unmap()
1028 err_printk(ref->dev, entry, in check_unmap()
1032 ref->dev_addr, ref->size, in check_unmap()
1088 struct dma_debug_entry *ref, in check_sync() argument
1095 bucket = get_hash_bucket(ref, &flags); in check_sync()
1097 entry = bucket_find_contain(&bucket, ref, &flags); in check_sync()
1103 (unsigned long long)ref->dev_addr, ref->size); in check_sync()
1107 if (ref->size > entry->size) { in check_sync()
1114 ref->size); in check_sync()
1120 if (ref->direction != entry->direction) { in check_sync()
1125 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1127 dir2name[ref->direction]); in check_sync()
1131 !(ref->direction == DMA_TO_DEVICE)) in check_sync()
1136 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1138 dir2name[ref->direction]); in check_sync()
1141 !(ref->direction == DMA_FROM_DEVICE)) in check_sync()
1146 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1148 dir2name[ref->direction]); in check_sync()
1150 if (ref->sg_call_ents && ref->type == dma_debug_sg && in check_sync()
1151 ref->sg_call_ents != entry->sg_call_ents) { in check_sync()
1152 err_printk(ref->dev, entry, "device driver syncs " in check_sync()
1155 entry->sg_call_ents, ref->sg_call_ents); in check_sync()
1241 struct dma_debug_entry ref; in debug_dma_mapping_error() local
1249 ref.dev = dev; in debug_dma_mapping_error()
1250 ref.dev_addr = dma_addr; in debug_dma_mapping_error()
1251 bucket = get_hash_bucket(&ref, &flags); in debug_dma_mapping_error()
1254 if (!exact_match(&ref, entry)) in debug_dma_mapping_error()
1280 struct dma_debug_entry ref = { in debug_dma_unmap_page() local
1290 check_unmap(&ref); in debug_dma_unmap_page()
1331 struct dma_debug_entry *ref) in get_nr_mapped_entries() argument
1338 bucket = get_hash_bucket(ref, &flags); in get_nr_mapped_entries()
1339 entry = bucket_find_exact(bucket, ref); in get_nr_mapped_entries()
1360 struct dma_debug_entry ref = { in debug_dma_unmap_sg() local
1375 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_unmap_sg()
1377 check_unmap(&ref); in debug_dma_unmap_sg()
1418 struct dma_debug_entry ref = { in debug_dma_free_coherent() local
1432 ref.pfn = vmalloc_to_pfn(virt); in debug_dma_free_coherent()
1434 ref.pfn = page_to_pfn(virt_to_page(virt)); in debug_dma_free_coherent()
1439 check_unmap(&ref); in debug_dma_free_coherent()
1469 struct dma_debug_entry ref = { in debug_dma_unmap_resource() local
1480 check_unmap(&ref); in debug_dma_unmap_resource()
1486 struct dma_debug_entry ref; in debug_dma_sync_single_for_cpu() local
1491 ref.type = dma_debug_single; in debug_dma_sync_single_for_cpu()
1492 ref.dev = dev; in debug_dma_sync_single_for_cpu()
1493 ref.dev_addr = dma_handle; in debug_dma_sync_single_for_cpu()
1494 ref.size = size; in debug_dma_sync_single_for_cpu()
1495 ref.direction = direction; in debug_dma_sync_single_for_cpu()
1496 ref.sg_call_ents = 0; in debug_dma_sync_single_for_cpu()
1498 check_sync(dev, &ref, true); in debug_dma_sync_single_for_cpu()
1505 struct dma_debug_entry ref; in debug_dma_sync_single_for_device() local
1510 ref.type = dma_debug_single; in debug_dma_sync_single_for_device()
1511 ref.dev = dev; in debug_dma_sync_single_for_device()
1512 ref.dev_addr = dma_handle; in debug_dma_sync_single_for_device()
1513 ref.size = size; in debug_dma_sync_single_for_device()
1514 ref.direction = direction; in debug_dma_sync_single_for_device()
1515 ref.sg_call_ents = 0; in debug_dma_sync_single_for_device()
1517 check_sync(dev, &ref, false); in debug_dma_sync_single_for_device()
1531 struct dma_debug_entry ref = { in debug_dma_sync_sg_for_cpu() local
1543 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_sync_sg_for_cpu()
1548 check_sync(dev, &ref, true); in debug_dma_sync_sg_for_cpu()
1563 struct dma_debug_entry ref = { in debug_dma_sync_sg_for_device() local
1574 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_sync_sg_for_device()
1579 check_sync(dev, &ref, false); in debug_dma_sync_sg_for_device()