Merge branch 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86, gart: Rename pci-gart_64.c to amd_gart_64.c x86/amd-iommu: Use threaded interupt handler arch/x86/kernel/pci-iommu_table.c: Convert sprintf_symbol to %pS x86/amd-iommu: Add support for invalidate_all command x86/amd-iommu: Add extended feature detection x86/amd-iommu: Add ATS enable/disable code x86/amd-iommu: Add flag to indicate IOTLB support x86/amd-iommu: Flush device IOTLB if ATS is enabled x86/amd-iommu: Select PCI_IOV with AMD IOMMU driver PCI: Move ATS declarations in seperate header file dma-debug: print information about leaked entry x86/amd-iommu: Flush all internal TLBs when IOMMUs are enabled x86/amd-iommu: Rename iommu_flush_device x86/amd-iommu: Improve handling of full command buffer x86/amd-iommu: Rename iommu_flush* to domain_flush* x86/amd-iommu: Remove command buffer resetting logic x86/amd-iommu: Cleanup completion-wait handling x86/amd-iommu: Cleanup inv_pages command handling x86/amd-iommu: Move inv-dte command building to own function x86/amd-iommu: Move compl-wait command building to own function
This commit is contained in:
+13
-5
@@ -649,7 +649,7 @@ out_err:
|
||||
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;
|
||||
@@ -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) {
|
||||
if (entry->dev == dev)
|
||||
if (entry->dev == dev) {
|
||||
count += 1;
|
||||
*out_entry = entry;
|
||||
}
|
||||
}
|
||||
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;
|
||||
struct dma_debug_entry *uninitialized_var(entry);
|
||||
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:
|
||||
count = device_dma_allocations(dev);
|
||||
count = device_dma_allocations(dev, &entry);
|
||||
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 "
|
||||
"[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;
|
||||
|
||||
Reference in New Issue
Block a user