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()
960 static void check_unmap(struct dma_debug_entry *ref) in check_unmap() argument
966 bucket = get_hash_bucket(ref, &flags); in check_unmap()
967 entry = bucket_find_exact(bucket, ref); in check_unmap()
973 if (dma_mapping_error(ref->dev, ref->dev_addr)) { in check_unmap()
974 err_printk(ref->dev, NULL, in check_unmap()
978 err_printk(ref->dev, NULL, in check_unmap()
982 ref->dev_addr, ref->size); in check_unmap()
987 if (ref->size != entry->size) { in check_unmap()
988 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
992 ref->dev_addr, entry->size, ref->size); in check_unmap()
995 if (ref->type != entry->type) { in check_unmap()
996 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1000 ref->dev_addr, ref->size, in check_unmap()
1001 type2name[entry->type], type2name[ref->type]); in check_unmap()
1003 (phys_addr(ref) != phys_addr(entry))) { in check_unmap()
1004 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1009 ref->dev_addr, ref->size, in check_unmap()
1011 phys_addr(ref)); in check_unmap()
1014 if (ref->sg_call_ents && ref->type == dma_debug_sg && in check_unmap()
1015 ref->sg_call_ents != entry->sg_call_ents) { in check_unmap()
1016 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1019 entry->sg_call_ents, ref->sg_call_ents); in check_unmap()
1026 if (ref->direction != entry->direction) { in check_unmap()
1027 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1031 ref->dev_addr, ref->size, in check_unmap()
1033 dir2name[ref->direction]); in check_unmap()
1042 err_printk(ref->dev, entry, in check_unmap()
1046 ref->dev_addr, ref->size, in check_unmap()
1092 struct dma_debug_entry *ref, in check_sync() argument
1099 bucket = get_hash_bucket(ref, &flags); in check_sync()
1101 entry = bucket_find_contain(&bucket, ref, &flags); in check_sync()
1107 (unsigned long long)ref->dev_addr, ref->size); in check_sync()
1111 if (ref->size > entry->size) { in check_sync()
1118 ref->size); in check_sync()
1124 if (ref->direction != entry->direction) { in check_sync()
1129 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1131 dir2name[ref->direction]); in check_sync()
1135 !(ref->direction == DMA_TO_DEVICE)) in check_sync()
1140 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1142 dir2name[ref->direction]); in check_sync()
1145 !(ref->direction == DMA_FROM_DEVICE)) in check_sync()
1150 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1152 dir2name[ref->direction]); in check_sync()
1154 if (ref->sg_call_ents && ref->type == dma_debug_sg && in check_sync()
1155 ref->sg_call_ents != entry->sg_call_ents) { in check_sync()
1156 err_printk(ref->dev, entry, "device driver syncs " in check_sync()
1159 entry->sg_call_ents, ref->sg_call_ents); in check_sync()
1246 struct dma_debug_entry ref; in debug_dma_mapping_error() local
1254 ref.dev = dev; in debug_dma_mapping_error()
1255 ref.dev_addr = dma_addr; in debug_dma_mapping_error()
1256 bucket = get_hash_bucket(&ref, &flags); in debug_dma_mapping_error()
1259 if (!exact_match(&ref, entry)) in debug_dma_mapping_error()
1285 struct dma_debug_entry ref = { in debug_dma_unmap_page() local
1295 check_unmap(&ref); in debug_dma_unmap_page()
1337 struct dma_debug_entry *ref) in get_nr_mapped_entries() argument
1344 bucket = get_hash_bucket(ref, &flags); in get_nr_mapped_entries()
1345 entry = bucket_find_exact(bucket, ref); in get_nr_mapped_entries()
1366 struct dma_debug_entry ref = { in debug_dma_unmap_sg() local
1381 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_unmap_sg()
1383 check_unmap(&ref); in debug_dma_unmap_sg()
1425 struct dma_debug_entry ref = { in debug_dma_free_coherent() local
1439 ref.pfn = vmalloc_to_pfn(virt); in debug_dma_free_coherent()
1441 ref.pfn = page_to_pfn(virt_to_page(virt)); in debug_dma_free_coherent()
1446 check_unmap(&ref); in debug_dma_free_coherent()
1477 struct dma_debug_entry ref = { in debug_dma_unmap_resource() local
1488 check_unmap(&ref); in debug_dma_unmap_resource()
1494 struct dma_debug_entry ref; in debug_dma_sync_single_for_cpu() local
1499 ref.type = dma_debug_single; in debug_dma_sync_single_for_cpu()
1500 ref.dev = dev; in debug_dma_sync_single_for_cpu()
1501 ref.dev_addr = dma_handle; in debug_dma_sync_single_for_cpu()
1502 ref.size = size; in debug_dma_sync_single_for_cpu()
1503 ref.direction = direction; in debug_dma_sync_single_for_cpu()
1504 ref.sg_call_ents = 0; in debug_dma_sync_single_for_cpu()
1506 check_sync(dev, &ref, true); in debug_dma_sync_single_for_cpu()
1513 struct dma_debug_entry ref; in debug_dma_sync_single_for_device() local
1518 ref.type = dma_debug_single; in debug_dma_sync_single_for_device()
1519 ref.dev = dev; in debug_dma_sync_single_for_device()
1520 ref.dev_addr = dma_handle; in debug_dma_sync_single_for_device()
1521 ref.size = size; in debug_dma_sync_single_for_device()
1522 ref.direction = direction; in debug_dma_sync_single_for_device()
1523 ref.sg_call_ents = 0; in debug_dma_sync_single_for_device()
1525 check_sync(dev, &ref, false); in debug_dma_sync_single_for_device()
1539 struct dma_debug_entry ref = { in debug_dma_sync_sg_for_cpu() local
1551 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_sync_sg_for_cpu()
1556 check_sync(dev, &ref, true); in debug_dma_sync_sg_for_cpu()
1571 struct dma_debug_entry ref = { in debug_dma_sync_sg_for_device() local
1582 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_sync_sg_for_device()
1587 check_sync(dev, &ref, false); in debug_dma_sync_sg_for_device()