From: Michal Schmidt <mschmidt@redhat.com>
To: netdev@vger.kernel.org
Cc: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>,
Yuval Mintz <Yuval.Mintz@qlogic.com>,
Ariel Elior <Ariel.Elior@qlogic.com>
Subject: Re: [PATCH net] bnx2x: fix DMA API usage
Date: Fri, 26 Jun 2015 17:57:05 +0200 [thread overview]
Message-ID: <558D7651.7020909@redhat.com> (raw)
In-Reply-To: <1435333800-22447-2-git-send-email-mschmidt@redhat.com>
On 06/26/2015 05:50 PM, Michal Schmidt wrote:
> With CONFIG_DMA_API_DEBUG=y bnx2x triggers the error "DMA-API: device
> driver frees DMA memory with wrong function".
> On archs where PAGE_SIZE > SGE_PAGE_SIZE it also triggers "DMA-API:
> device driver frees DMA memory with different size".
>
> Fix this by making the mapping and unmapping symmetric:
> - Do not map the whole pool page at once. Instead map the
> SGE_PAGE_SIZE-sized pieces individually, so they can be unmapped in
> the same manner.
> - What's mapped using dma_map_page() must be unmapped using
> dma_unmap_page().
>
> Tested on ppc64.
>
> Fixes: 4cace675d687 ("bnx2x: Alloc 4k fragment for each rx ring buffer element")
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> ---
> drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 -
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 23 ++++++++++-------------
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 12 ++----------
> 3 files changed, 12 insertions(+), 24 deletions(-)
The two patches I sent are absolutely identical.
I just sent it twice by mistake. Sorry for any confusion.
Michal
next prev parent reply other threads:[~2015-06-26 15:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-26 15:49 [PATCH net] bnx2x: fix DMA API usage Michal Schmidt
2015-06-26 15:50 ` Michal Schmidt
2015-06-26 15:57 ` Michal Schmidt [this message]
2015-06-29 3:25 ` 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=558D7651.7020909@redhat.com \
--to=mschmidt@redhat.com \
--cc=Ariel.Elior@qlogic.com \
--cc=Yuval.Mintz@qlogic.com \
--cc=krisman@linux.vnet.ibm.com \
--cc=netdev@vger.kernel.org \
/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).