Lines Matching refs: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 struct dma_debug_entry *entry, index = *ref; in bucket_find_contain()
357 entry = __hash_bucket_find(*bucket, ref, containing_match); in bucket_find_contain()
943 static void check_unmap(struct dma_debug_entry *ref) in check_unmap() argument
949 bucket = get_hash_bucket(ref, &flags); in check_unmap()
950 entry = bucket_find_exact(bucket, ref); in check_unmap()
956 if (dma_mapping_error(ref->dev, ref->dev_addr)) { in check_unmap()
957 err_printk(ref->dev, NULL, in check_unmap()
961 err_printk(ref->dev, NULL, in check_unmap()
965 ref->dev_addr, ref->size); in check_unmap()
970 if (ref->size != entry->size) { in check_unmap()
971 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
975 ref->dev_addr, entry->size, ref->size); in check_unmap()
978 if (ref->type != entry->type) { in check_unmap()
979 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
983 ref->dev_addr, ref->size, in check_unmap()
984 type2name[entry->type], type2name[ref->type]); in check_unmap()
986 (phys_addr(ref) != phys_addr(entry))) { in check_unmap()
987 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
992 ref->dev_addr, ref->size, in check_unmap()
994 phys_addr(ref)); in check_unmap()
997 if (ref->sg_call_ents && ref->type == dma_debug_sg && in check_unmap()
998 ref->sg_call_ents != entry->sg_call_ents) { in check_unmap()
999 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1002 entry->sg_call_ents, ref->sg_call_ents); in check_unmap()
1009 if (ref->direction != entry->direction) { in check_unmap()
1010 err_printk(ref->dev, entry, "device driver frees " in check_unmap()
1014 ref->dev_addr, ref->size, in check_unmap()
1016 dir2name[ref->direction]); in check_unmap()
1025 err_printk(ref->dev, entry, in check_unmap()
1029 ref->dev_addr, ref->size, in check_unmap()
1075 struct dma_debug_entry *ref, in check_sync() argument
1082 bucket = get_hash_bucket(ref, &flags); in check_sync()
1084 entry = bucket_find_contain(&bucket, ref, &flags); in check_sync()
1090 (unsigned long long)ref->dev_addr, ref->size); in check_sync()
1094 if (ref->size > entry->size) { in check_sync()
1101 ref->size); in check_sync()
1107 if (ref->direction != entry->direction) { in check_sync()
1112 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1114 dir2name[ref->direction]); in check_sync()
1118 !(ref->direction == DMA_TO_DEVICE)) in check_sync()
1123 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1125 dir2name[ref->direction]); in check_sync()
1128 !(ref->direction == DMA_FROM_DEVICE)) in check_sync()
1133 (unsigned long long)ref->dev_addr, entry->size, in check_sync()
1135 dir2name[ref->direction]); in check_sync()
1137 if (ref->sg_call_ents && ref->type == dma_debug_sg && in check_sync()
1138 ref->sg_call_ents != entry->sg_call_ents) { in check_sync()
1139 err_printk(ref->dev, entry, "device driver syncs " in check_sync()
1142 entry->sg_call_ents, ref->sg_call_ents); in check_sync()
1229 struct dma_debug_entry ref; in debug_dma_mapping_error() local
1237 ref.dev = dev; in debug_dma_mapping_error()
1238 ref.dev_addr = dma_addr; in debug_dma_mapping_error()
1239 bucket = get_hash_bucket(&ref, &flags); in debug_dma_mapping_error()
1242 if (!exact_match(&ref, entry)) in debug_dma_mapping_error()
1268 struct dma_debug_entry ref = { in debug_dma_unmap_page() local
1278 check_unmap(&ref); in debug_dma_unmap_page()
1320 struct dma_debug_entry *ref) in get_nr_mapped_entries() argument
1327 bucket = get_hash_bucket(ref, &flags); in get_nr_mapped_entries()
1328 entry = bucket_find_exact(bucket, ref); in get_nr_mapped_entries()
1349 struct dma_debug_entry ref = { in debug_dma_unmap_sg() local
1364 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_unmap_sg()
1366 check_unmap(&ref); in debug_dma_unmap_sg()
1408 struct dma_debug_entry ref = { in debug_dma_free_coherent() local
1422 ref.pfn = vmalloc_to_pfn(virt); in debug_dma_free_coherent()
1424 ref.pfn = page_to_pfn(virt_to_page(virt)); in debug_dma_free_coherent()
1429 check_unmap(&ref); in debug_dma_free_coherent()
1460 struct dma_debug_entry ref = { in debug_dma_unmap_resource() local
1471 check_unmap(&ref); in debug_dma_unmap_resource()
1477 struct dma_debug_entry ref; in debug_dma_sync_single_for_cpu() local
1482 ref.type = dma_debug_single; in debug_dma_sync_single_for_cpu()
1483 ref.dev = dev; in debug_dma_sync_single_for_cpu()
1484 ref.dev_addr = dma_handle; in debug_dma_sync_single_for_cpu()
1485 ref.size = size; in debug_dma_sync_single_for_cpu()
1486 ref.direction = direction; in debug_dma_sync_single_for_cpu()
1487 ref.sg_call_ents = 0; in debug_dma_sync_single_for_cpu()
1489 check_sync(dev, &ref, true); in debug_dma_sync_single_for_cpu()
1496 struct dma_debug_entry ref; in debug_dma_sync_single_for_device() local
1501 ref.type = dma_debug_single; in debug_dma_sync_single_for_device()
1502 ref.dev = dev; in debug_dma_sync_single_for_device()
1503 ref.dev_addr = dma_handle; in debug_dma_sync_single_for_device()
1504 ref.size = size; in debug_dma_sync_single_for_device()
1505 ref.direction = direction; in debug_dma_sync_single_for_device()
1506 ref.sg_call_ents = 0; in debug_dma_sync_single_for_device()
1508 check_sync(dev, &ref, false); in debug_dma_sync_single_for_device()
1522 struct dma_debug_entry ref = { in debug_dma_sync_sg_for_cpu() local
1534 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_sync_sg_for_cpu()
1539 check_sync(dev, &ref, true); in debug_dma_sync_sg_for_cpu()
1554 struct dma_debug_entry ref = { in debug_dma_sync_sg_for_device() local
1565 mapped_ents = get_nr_mapped_entries(dev, &ref); in debug_dma_sync_sg_for_device()
1570 check_sync(dev, &ref, false); in debug_dma_sync_sg_for_device()