lkml.org 
[lkml]   [2012]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dma-debug: New interfaces to debug dma mapping errors
On Sun, Sep 16, 2012 at 06:52:51PM -0600, Shuah Khan wrote:
> +void debug_dma_dump_map_errors(struct device *dev, int all)
> +{
> + if (all) {
> + dev_info(dev,
> + "DMA-API: DMA map error summary:\n"
> + "DMA map errors returned = %d\n"
> + "DMA map errors not checked = %d\n"
> + "DMA unmap errors = %d\n"
> + "SWIOTLB overflow triggers = %d\n",
> + dev->dma_map_errors,
> + dev->dma_map_errors_not_checked,
> + dev->dma_unmap_errors,
> + dev->iotlb_overflow_cnt);
> + return;
> + }
> +
> + if (dev->dma_map_errors_not_checked) {
> + dev_err(dev,
> + "DMA-API: Driver failed to check\n"
> + "%d out of a total of %d DMA map errors returned\n"
> + "by DMA mapping interfaces\n",
> + dev->dma_map_errors_not_checked,
> + dev->dma_map_errors);
> + }
> +
> + if (dev->dma_unmap_errors) {
> + dev_err(dev,
> + "DMA-API: Driver tried to free invalid\n"
> + "DMA addresses %d times\n",
> + dev->dma_unmap_errors);
> + }
> +
> + if (dev->iotlb_overflow_cnt) {
> + dev_err(dev,
> + "DMA-API: SWIOTLB overflow buffer triggered %d times\n",
> + dev->iotlb_overflow_cnt);
> + }
> +}
> +EXPORT_SYMBOL(debug_dma_dump_map_errors);

Don't use syslog for stuff like this, that's not good. Why not use
debugfs?

greg k-h


\
 
 \ /
  Last update: 2012-09-17 04:41    [W:0.146 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site