linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Chen Bough <Haibo.Chen@freescale.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [SHDCI] Heavy (thousands) DMA leaks
Date: Mon, 3 Aug 2015 11:39:34 +0200	[thread overview]
Message-ID: <55BF36D6.4080504@suse.cz> (raw)
In-Reply-To: <BY1PR03MB138811AD7FAB3C561CC683679A770@BY1PR03MB1388.namprd03.prod.outlook.com>

Hi,

On 08/03/2015, 11:30 AM, Chen Bough wrote:
> I carefully review my patch, all the DMA memory mapped in sdhci_pre_req() is unmapped in sdhci_post_req.

I suspect 'host_cookie' or 'next' handling is bad somewhere. But I don't
know...

> Can you provide the method of your testing DMA leaks?

boot kernel with CONFIG_DMA_API_DEBUG
insert the card
mount it
rsync from the card ~200 MB
umount it
unload the sdhci driver
the leak warning is reported

I am not sure whether suspend-resume is needed after the first step.

> You said over 4000 leaked mappings during one card transfer, if true, 
> We can't map any dma memory after some sd transfer, do you meet this?

Yes, I see:
sdhci-pci 0000:02:00.0: swiotlb buffer is full (sz: 65536 bytes)
after some time. The driver falls back to non-DMA transfers after that.
It also generates a warning about that:
WARNING: CPU: 0 PID: 0 at drivers/mmc/host/sdhci.c:857
sdhci_prepare_data+0x8ec/0x900 [sdhci]()

thanks,
-- 
js
suse labs

  reply	other threads:[~2015-08-03  9:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30  9:31 [SHDCI] Heavy (thousands) DMA leaks Jiri Slaby
2015-07-31  6:56 ` Chen Bough
2015-08-03  9:30 ` Chen Bough
2015-08-03  9:39   ` Jiri Slaby [this message]
2015-08-05 11:52     ` Jiri Slaby
2015-08-05 15:11       ` [RFC] sdhci: fix DMA leaks [was: [SHDCI] Heavy (thousands) DMA leaks] Jiri Slaby
2015-08-05 16:25         ` Pavel Machek
2015-08-06  7:42         ` Chen Bough
2015-08-06  9:06           ` Jiri Slaby
2015-08-06  9:17             ` Chen Bough
2015-08-24 16:26               ` Laura Abbott
2015-08-25  1:50                 ` Chen Bough

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=55BF36D6.4080504@suse.cz \
    --to=jslaby@suse.cz \
    --cc=Haibo.Chen@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.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).