From: Chris Ball <cjb@laptop.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Javier Martin <javier.martin@vista-silicon.com>,
linux-mmc@vger.kernel.org, viresh.linux@gmail.com,
g.liakhovetski@gmx.de, vinod.koul@linux.intel.com,
fabio.estevam@freescale.com, gcembed@gmail.com
Subject: Re: [PATCH v2] mmc: mxcmmc: fix bug that may block a data transfer forever.
Date: Wed, 19 Sep 2012 01:52:34 -0400 [thread overview]
Message-ID: <m3wqzqimot.fsf@pullcord.laptop.org> (raw)
In-Reply-To: <20120910074753.GX18243@pengutronix.de> (Sascha Hauer's message of "Mon, 10 Sep 2012 09:47:54 +0200")
Hi,
On Mon, Sep 10 2012, Sascha Hauer wrote:
> On Fri, Sep 07, 2012 at 12:43:37PM +0200, Javier Martin wrote:
>> The problem can be easily reproduced using a script that loops
>> copying a file in an SD card to another place in the same SD card
>> and its related to read transfers. This only happens with DMA enabled.
>>
>> This is related to the fact that, when reading, an MMC irq signals
>> the fact that all data from the SD card has been copied to the
>> internal buffers. However, it doesn't signal whether the DMA transfer
>> that is in charge of moving data from these internal buffers to RAM
>> has finished or not. Thus, calling dmaengine_terminate_all() in the
>> MMC irq routine can cancel an ongoing DMA transfer leaving some data
>> in the internal buffers that produces an accumulative effect which,
>> in the end, blocks a read data transfer forever.
>>
>> The following patch watches DMA irq for reading and MMC irqs for
>> writing transfers. The 'dangerous' usage of dmaengine_terminate_all()
>> is removed and a timeout of 10 seconds is added so that the MMC won't
>> block forever anymore.
>>
>> Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
>> ---
>> Changes since v1:
>> - Use DMA callbacks for reading and MMC irqs for writing instead
>> of monitoring both irqs for each transfer.
>> - Increase timeout to 10 seconds to give enough time to slow cards.
>>
>
> Looks good now, thanks.
>
> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Thanks, queued in mmc-next for 3.7. Vinod, would be good to add your
Reviewed-by if you're happy with this patch now.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2012-09-19 5:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-07 10:43 [PATCH v2] mmc: mxcmmc: fix bug that may block a data transfer forever Javier Martin
2012-09-10 7:47 ` Sascha Hauer
2012-09-19 5:52 ` Chris Ball [this message]
2012-09-14 2:52 ` Vinod Koul
2012-09-14 12:50 ` javier Martin
2013-02-19 14:14 ` Anatolij Gustschin
2013-02-21 12:32 ` javier Martin
2013-02-21 12:57 ` Anatolij Gustschin
2013-02-21 15:49 ` Fabio Estevam
2013-03-14 19:58 ` Anatolij Gustschin
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=m3wqzqimot.fsf@pullcord.laptop.org \
--to=cjb@laptop.org \
--cc=fabio.estevam@freescale.com \
--cc=g.liakhovetski@gmx.de \
--cc=gcembed@gmail.com \
--cc=javier.martin@vista-silicon.com \
--cc=linux-mmc@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=vinod.koul@linux.intel.com \
--cc=viresh.linux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.