From: Jarek Poplawski <jarkao2@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH 00/11] DMA sync errors
Date: Thu, 21 Jan 2010 12:44:23 +0000 [thread overview]
Message-ID: <20100121124423.GA8817@ff.dom.local> (raw)
In-Reply-To: <20100120163410.774f0c4c@nehalam>
On Wed, Jan 20, 2010 at 04:34:10PM -0800, Stephen Hemminger wrote:
> On Wed, 20 Jan 2010 16:18:05 -0800 (PST)
> David Miller <davem@davemloft.net> wrote:
>
> > From: Stephen Hemminger <shemminger@vyatta.com>
> > Date: Wed, 20 Jan 2010 15:28:32 -0800
> >
> > > This should fix the dma-debug API code (and documentation), to
> > > avoid false positives when sync is done on a partial map.
> > >
> > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > ...
> > > --- a/lib/dma-debug.c 2010-01-20 15:22:55.919519883 -0800
> > > +++ b/lib/dma-debug.c 2010-01-20 15:26:31.648895638 -0800
> > > @@ -285,11 +285,9 @@ static struct dma_debug_entry *hash_buck
> > > }
> > >
> > > /*
> > > - * If we have multiple matches but no perfect-fit, just return
> > > - * NULL.
> > > + * If we have multiple matches but no perfect-fit
> > > + * return best value and let caller deal with it.
> > > */
> > > - ret = (matches == 1) ? ret : NULL;
> > > -
> > > return ret;
> > > }
> > >
> >
> > I think you have to enforce a perfect-fit match for the
> > non-SYNC cases.
> >
> > check_sync() can pass in 'true' for a new bool argument "partial_ok"
> > added to hash_bucket_find() whereas check_unmap() can pass 'false'.
> >
> > get_nr_mapped_entries() should pass 'false' as well.
>
> check_unmap has checks for different size, different type,
> call_ents, direction etc.
>
> The code for get_nr_mapped_entries() is the only question;
> it is used by unmap_sg() and probably needs perfect match only.
>
Hmm... After looking at it more, mainly dma_sync_single_range()
implementations, I didn't find any reasons for these comments in
DMA-API.txt, but even if I missed something, this patch definitely
shows these lib/dma-debug warnings are buggy if they depend on the
number of mapped entries (while otherwise ref->size < entry->size
isn't reported). Btw, it seems code should try to return minimum
entry->size for such a check.
Thanks Stephen, now I feel 99.9% safe ;-)
Sorry for mistrust, David!
Jarek P.
next prev parent reply other threads:[~2010-01-21 12:44 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 20:44 [PATCH 00/11] DMA sync errors Stephen Hemminger
2010-01-20 20:45 ` [PATCH 01/11] tg3: fix DMA sync_single length error Stephen Hemminger
2010-01-20 20:45 ` [PATCH 02/11] sky2: " Stephen Hemminger
2010-01-20 21:32 ` Jarek Poplawski
2010-01-20 22:52 ` David Miller
2010-01-20 23:21 ` Jarek Poplawski
2010-01-20 23:34 ` David Miller
2010-01-20 23:41 ` David Miller
2010-01-20 23:59 ` Jarek Poplawski
2010-01-21 0:04 ` Stephen Hemminger
2010-01-21 0:15 ` David Miller
2010-01-20 23:52 ` Jarek Poplawski
2010-01-20 23:56 ` David Miller
2010-01-20 20:45 ` [PATCH 03/11] skge: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 04/11] r8169: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 05/11] rrunner: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 06/11] de2104x: " Stephen Hemminger
2010-01-22 1:02 ` Grant Grundler
2010-01-22 1:12 ` Stephen Hemminger
2010-01-20 20:45 ` [PATCH 07/11] sungem: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 08/11] sunhme: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 09/11] cassini: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 10/11] cxgb3: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 11/11] ipoib: " Stephen Hemminger
2010-01-20 22:46 ` [PATCH 00/11] DMA sync errors David Miller
2010-01-20 23:28 ` Stephen Hemminger
2010-01-21 0:18 ` David Miller
2010-01-21 0:34 ` Stephen Hemminger
2010-01-21 0:36 ` David Miller
2010-01-21 12:44 ` Jarek Poplawski [this message]
2010-01-21 13:12 ` David Miller
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=20100121124423.GA8817@ff.dom.local \
--to=jarkao2@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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;
as well as URLs for NNTP newsgroup(s).