Commit 4ced7ead authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] dmapool: use dev_err() whenever we can to get the better information in it.

parent c884ee80
...@@ -237,9 +237,12 @@ dma_pool_destroy (struct dma_pool *pool) ...@@ -237,9 +237,12 @@ dma_pool_destroy (struct dma_pool *pool)
page = list_entry (pool->page_list.next, page = list_entry (pool->page_list.next,
struct dma_page, page_list); struct dma_page, page_list);
if (is_page_busy (pool->blocks_per_page, page->bitmap)) { if (is_page_busy (pool->blocks_per_page, page->bitmap)) {
printk (KERN_ERR "dma_pool_destroy %s/%s, %p busy\n", if (pool->dev)
pool->dev ? pool->dev->bus_id : NULL, dev_err(pool->dev, "dma_pool_destroy %s, %p busy\n",
pool->name, page->vaddr); pool->name, page->vaddr);
else
printk (KERN_ERR "dma_pool_destroy %s, %p busy\n",
pool->name, page->vaddr);
/* leak the still-in-use consistent memory */ /* leak the still-in-use consistent memory */
list_del (&page->page_list); list_del (&page->page_list);
kfree (page); kfree (page);
...@@ -362,9 +365,12 @@ dma_pool_free (struct dma_pool *pool, void *vaddr, dma_addr_t dma) ...@@ -362,9 +365,12 @@ dma_pool_free (struct dma_pool *pool, void *vaddr, dma_addr_t dma)
int map, block; int map, block;
if ((page = pool_find_page (pool, dma)) == 0) { if ((page = pool_find_page (pool, dma)) == 0) {
printk (KERN_ERR "dma_pool_free %s/%s, %p/%lx (bad dma)\n", if (pool->dev)
pool->dev ? pool->dev->bus_id : NULL, dev_err(pool->dev, "dma_pool_free %s, %p/%lx (bad dma)\n",
pool->name, vaddr, (unsigned long) dma); pool->name, vaddr, (unsigned long) dma);
else
printk (KERN_ERR "dma_pool_free %s, %p/%lx (bad dma)\n",
pool->name, vaddr, (unsigned long) dma);
return; return;
} }
...@@ -375,15 +381,21 @@ dma_pool_free (struct dma_pool *pool, void *vaddr, dma_addr_t dma) ...@@ -375,15 +381,21 @@ dma_pool_free (struct dma_pool *pool, void *vaddr, dma_addr_t dma)
#ifdef CONFIG_DEBUG_SLAB #ifdef CONFIG_DEBUG_SLAB
if (((dma - page->dma) + (void *)page->vaddr) != vaddr) { if (((dma - page->dma) + (void *)page->vaddr) != vaddr) {
printk (KERN_ERR "dma_pool_free %s/%s, %p (bad vaddr)/%Lx\n", if (pool->dev)
pool->dev ? pool->dev->bus_id : NULL, dev_err(pool->dev, "dma_pool_free %s, %p (bad vaddr)/%Lx\n",
pool->name, vaddr, (unsigned long long) dma); pool->name, vaddr, (unsigned long long) dma);
else
printk (KERN_ERR "dma_pool_free %s, %p (bad vaddr)/%Lx\n",
pool->name, vaddr, (unsigned long long) dma);
return; return;
} }
if (page->bitmap [map] & (1UL << block)) { if (page->bitmap [map] & (1UL << block)) {
printk (KERN_ERR "dma_pool_free %s/%s, dma %Lx already free\n", if (pool->dev)
pool->dev ? pool->dev->bus_id : NULL, dev_err(pool->dev, "dma_pool_free %s, dma %Lx already free\n",
pool->name, (unsigned long long)dma); pool->name, (unsigned long long)dma);
else
printk (KERN_ERR "dma_pool_free %s, dma %Lx already free\n",
pool->name, (unsigned long long)dma);
return; return;
} }
memset (vaddr, POOL_POISON_FREED, pool->size); memset (vaddr, POOL_POISON_FREED, pool->size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment