* [PATCH] mmc: atmel-mci: not busy flag has also to be used for read operations
@ 2012-07-24 9:42 ludovic.desroches
2012-08-08 3:05 ` Chris Ball
0 siblings, 1 reply; 3+ messages in thread
From: ludovic.desroches @ 2012-07-24 9:42 UTC (permalink / raw)
To: linux-mmc; +Cc: cjb, nicolas.ferre, plagnioj, linux-arm-kernel
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Even if the datasheet says that the not busy flag has to be used only for
write operations, it's false excepted for version lesser than v2xx.
Not waiting the not busy flag for read operations can cause the controller to
hang-up during the initialization of some SD cards.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: stable@vger.kernel.org
Hello,
This is a fix for 3.5 and later.
Due to the big changes into atmel-mci driver to support all atmel mci versions,
a bug was introduced.
With some SD cards (mainly micro) when using DMA, the controller hangs-up after
the first CMD6 command because the next command is sent too early.
Regards
Ludovic
---
drivers/mmc/host/atmel-mci.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index f2c115e..b6abfa7 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -81,6 +81,7 @@ struct atmel_mci_caps {
bool has_bad_data_ordering;
bool need_reset_after_xfer;
bool need_blksz_mul_4;
+ bool need_notbusy_for_read_ops;
};
struct atmel_mci_dma {
@@ -1619,7 +1620,8 @@ static void atmci_tasklet_func(unsigned long priv)
__func__);
atmci_set_completed(host, EVENT_XFER_COMPLETE);
- if (host->data->flags & MMC_DATA_WRITE) {
+ if (host->caps.need_notbusy_for_read_ops
+ || (host->data->flags & MMC_DATA_WRITE)) {
atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
state = STATE_WAITING_NOTBUSY;
} else if (host->mrq->stop) {
@@ -2212,6 +2214,7 @@ static void __init atmci_get_cap(struct atmel_mci *host)
host->caps.has_bad_data_ordering = 1;
host->caps.need_reset_after_xfer = 1;
host->caps.need_blksz_mul_4 = 1;
+ host->caps.need_notbusy_for_read_ops = 0;
/* keep only major version number */
switch (version & 0xf00) {
@@ -2232,6 +2235,7 @@ static void __init atmci_get_cap(struct atmel_mci *host)
case 0x200:
host->caps.has_rwproof = 1;
host->caps.need_blksz_mul_4 = 0;
+ host->caps.need_notbusy_for_read_ops = 1;
case 0x100:
host->caps.has_bad_data_ordering = 0;
host->caps.need_reset_after_xfer = 0;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: atmel-mci: not busy flag has also to be used for read operations
2012-07-24 9:42 [PATCH] mmc: atmel-mci: not busy flag has also to be used for read operations ludovic.desroches
@ 2012-08-08 3:05 ` Chris Ball
2012-08-09 6:29 ` ludovic.desroches
0 siblings, 1 reply; 3+ messages in thread
From: Chris Ball @ 2012-08-08 3:05 UTC (permalink / raw)
To: ludovic.desroches; +Cc: linux-mmc, nicolas.ferre, plagnioj, linux-arm-kernel
Hi,
On Tue, Jul 24 2012, ludovic.desroches@atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> Even if the datasheet says that the not busy flag has to be used only for
> write operations, it's false excepted for version lesser than v2xx.
> Not waiting the not busy flag for read operations can cause the controller to
> hang-up during the initialization of some SD cards.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Cc: stable@vger.kernel.org
>
>
> Hello,
>
> This is a fix for 3.5 and later.
>
> Due to the big changes into atmel-mci driver to support all atmel mci versions,
> a bug was introduced.
> With some SD cards (mainly micro) when using DMA, the controller hangs-up after
> the first CMD6 command because the next command is sent too early.
>
> Regards
>
> Ludovic
>
>
> ---
> drivers/mmc/host/atmel-mci.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
Thanks. I've applied this for mmc-next now, but please put your patch
commentary *underneath* the "---" lines, so that it doesn't end up in
the git history itself. I've rewritten the commit message to be:
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Even if the datasheet says that the not busy flag has to be used only
for write operations, it's false except for version lesser than v2xx.
Not waiting on the not busy flag for read operations can cause the
controller to hang-up during the initialization of some SD cards
with DMA after the first CMD6 -- the next command is sent too early.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: stable <stable@vger.kernel.org> [3.5, 3.6]
Signed-off-by: Chris Ball <cjb@laptop.org>
---
<patch commentary can go here>
drivers/mmc/host/atmel-mci.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: atmel-mci: not busy flag has also to be used for read operations
2012-08-08 3:05 ` Chris Ball
@ 2012-08-09 6:29 ` ludovic.desroches
0 siblings, 0 replies; 3+ messages in thread
From: ludovic.desroches @ 2012-08-09 6:29 UTC (permalink / raw)
To: Chris Ball
Cc: nicolas.ferre, plagnioj, ludovic.desroches, linux-mmc,
linux-arm-kernel
Le 08/08/2012 05:05 AM, Chris Ball a écrit :
> Hi,
>
> On Tue, Jul 24 2012, ludovic.desroches@atmel.com wrote:
>> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>>
>> Even if the datasheet says that the not busy flag has to be used only for
>> write operations, it's false excepted for version lesser than v2xx.
>> Not waiting the not busy flag for read operations can cause the controller to
>> hang-up during the initialization of some SD cards.
>>
>> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
>> Cc: stable@vger.kernel.org
>>
>>
>> Hello,
>>
>> This is a fix for 3.5 and later.
>>
>> Due to the big changes into atmel-mci driver to support all atmel mci versions,
>> a bug was introduced.
>> With some SD cards (mainly micro) when using DMA, the controller hangs-up after
>> the first CMD6 command because the next command is sent too early.
>>
>> Regards
>>
>> Ludovic
>>
>>
>> ---
>> drivers/mmc/host/atmel-mci.c | 6 +++++-
>> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> Thanks. I've applied this for mmc-next now, but please put your patch
> commentary *underneath* the "---" lines, so that it doesn't end up in
> the git history itself. I've rewritten the commit message to be:
Sorry for this error.
Thanks
Ludovic
>
>
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> Even if the datasheet says that the not busy flag has to be used only
> for write operations, it's false except for version lesser than v2xx.
>
> Not waiting on the not busy flag for read operations can cause the
> controller to hang-up during the initialization of some SD cards
> with DMA after the first CMD6 -- the next command is sent too early.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Cc: stable <stable@vger.kernel.org> [3.5, 3.6]
> Signed-off-by: Chris Ball <cjb@laptop.org>
> ---
> <patch commentary can go here>
>
> drivers/mmc/host/atmel-mci.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-09 6:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24 9:42 [PATCH] mmc: atmel-mci: not busy flag has also to be used for read operations ludovic.desroches
2012-08-08 3:05 ` Chris Ball
2012-08-09 6:29 ` ludovic.desroches
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).