From: Shuah Khan <shuah.kh@samsung.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: akpm@linux-foundation.org, alexander.h.duyck@intel.com,
linux-kernel@vger.kernel.org, shuahkhan@gmail.com,
Shuah Khan <shuah.kh@samsung.com>,
"shuahkhan@gmail.com" <shuahkhan@gmail.com>
Subject: Re: [PATCH v2] dma-debug: enhance dma_debug_device_change() to check for mapping errors
Date: Fri, 10 Jan 2014 17:25:45 -0700 [thread overview]
Message-ID: <52D08F89.10109@samsung.com> (raw)
In-Reply-To: <52CC37F1.6080704@samsung.com>
On 01/07/2014 10:22 AM, Shuah Khan wrote:
> On 01/07/2014 08:12 AM, Joerg Roedel wrote:
>> On Tue, Jan 07, 2014 at 08:00:33AM -0700, Shuah Khan wrote:
>>> This patch and a follow-on cocinelli warning fix patch are in
>>> linux-next. Would you like me to send a patch relative to the change
>>> in linux-next or cut a new patch against the latest Linus's git. I
>>> can go either way. We just have to remember to drop those two
>>> patches from linux-next.
>>
>> Please do a patch against linus.git and drop the two patches from
>> linux-next. Over which tree did they go into linux-next anyway?
>>
>>
>
> ok. It went through mm tree.
>
I have a separate routine now for scanning for entries with map error
flag set and I also have a new err_printk() call to print the entry from
dma_debug_device_change() right after device_dma_allocations() check and
corresponding err_printk(). Snippet of the diff below. Only one warning
gets printed. Looking at err_printk(): if (!show_all_errors &&
show_num_errors > 0) conditional, it appears that is the way it is
supposed to work, unless I am missing something
One way to not miss the second warning is to just generate just a
pr_err() for the mapping error instead of err_printk(). Leaked entries
is a bigger problem that should really be shown and the same entry might
not have the map error flag set. Thoughts?
static int dma_debug_device_change(struct notifier_block *nb, unsigned
long action, void *data)
{
struct device *dev = data;
@@ -758,6 +784,18 @@ static int dma_debug_device_change(struct
notifier_block *nb, unsigned long acti
"[mapped with %s] [mapped as %s]\n",
count, entry->dev_addr, entry->size,
dir2name[entry->direction],
type2name[entry->type]);
+
+ count = device_dma_map_errors(dev, &entry);
+ if (count == 0)
+ break;
+ err_printk(dev, entry,
+ "DMA-API: device driver failed to check
map err"
+ ": [count=%d]\n"
+ "Details of an entry with map error flag
set: "
+ "[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;
--
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658
prev parent reply other threads:[~2014-01-11 0:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 20:56 Shuah Khan
2013-12-30 14:15 ` Joerg Roedel
2014-01-03 18:26 ` Shuah Khan
2014-01-07 14:26 ` Joerg Roedel
2014-01-07 15:00 ` Shuah Khan
2014-01-07 15:12 ` Joerg Roedel
2014-01-07 17:22 ` Shuah Khan
2014-01-11 0:25 ` Shuah Khan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52D08F89.10109@samsung.com \
--to=shuah.kh@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@intel.com \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shuahkhan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome