projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: use synchronize_rcu_expedited()
[deliverable/linux.git]
/
lib
/
dma-debug.c
diff --git
a/lib/dma-debug.c
b/lib/dma-debug.c
index 4bfb0471f10684f230e4351db489a1292b83f414..db07bfd9298ea93d4ddcdf76a8a0c868b955371b 100644
(file)
--- a/
lib/dma-debug.c
+++ b/
lib/dma-debug.c
@@
-649,7
+649,7
@@
out_err:
return -ENOMEM;
}
return -ENOMEM;
}
-static int device_dma_allocations(struct device *dev)
+static int device_dma_allocations(struct device *dev
, struct dma_debug_entry **out_entry
)
{
struct dma_debug_entry *entry;
unsigned long flags;
{
struct dma_debug_entry *entry;
unsigned long flags;
@@
-660,8
+660,10
@@
static int device_dma_allocations(struct device *dev)
for (i = 0; i < HASH_SIZE; ++i) {
spin_lock(&dma_entry_hash[i].lock);
list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
for (i = 0; i < HASH_SIZE; ++i) {
spin_lock(&dma_entry_hash[i].lock);
list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
- if (entry->dev == dev)
+ if (entry->dev == dev)
{
count += 1;
count += 1;
+ *out_entry = entry;
+ }
}
spin_unlock(&dma_entry_hash[i].lock);
}
}
spin_unlock(&dma_entry_hash[i].lock);
}
@@
-674,6
+676,7
@@
static int device_dma_allocations(struct device *dev)
static int dma_debug_device_change(struct notifier_block *nb, unsigned long action, void *data)
{
struct device *dev = data;
static int dma_debug_device_change(struct notifier_block *nb, unsigned long action, void *data)
{
struct device *dev = data;
+ struct dma_debug_entry *uninitialized_var(entry);
int count;
if (global_disable)
int count;
if (global_disable)
@@
-681,12
+684,17
@@
static int dma_debug_device_change(struct notifier_block *nb, unsigned long acti
switch (action) {
case BUS_NOTIFY_UNBOUND_DRIVER:
switch (action) {
case BUS_NOTIFY_UNBOUND_DRIVER:
- count = device_dma_allocations(dev);
+ count = device_dma_allocations(dev
, &entry
);
if (count == 0)
break;
if (count == 0)
break;
- err_printk(dev,
NULL
, "DMA-API: device driver has pending "
+ err_printk(dev,
entry
, "DMA-API: device driver has pending "
"DMA allocations while released from device "
"DMA allocations while released from device "
- "[count=%d]\n", count);
+ "[count=%d]\n"
+ "One of leaked entries details: "
+ "[device address=0x%016llx] [size=%llu bytes] "
+ "[mapped with %s] [mapped as %s]\n",
+ count, entry->dev_addr, entry->size,
+ dir2name[entry->direction], type2name[entry->type]);
break;
default:
break;
break;
default:
break;
This page took
0.03957 seconds
and
5
git commands to generate.