* Re: [PATCH] MMC: SDHCI Auto-CMD23 fixes.
2011-05-25 7:13 ` [PATCH] MMC: SDHCI Auto-CMD23 fixes Andrei Warkentin
@ 2011-05-25 6:47 ` Andrei Warkentin
2011-05-25 20:13 ` Chris Ball
1 sibling, 0 replies; 4+ messages in thread
From: Andrei Warkentin @ 2011-05-25 6:47 UTC (permalink / raw)
To: cjb; +Cc: linux-mmc, Andrei Warkentin
Chris,
On Wed, May 25, 2011 at 2:13 AM, Andrei Warkentin <andreiw@motorola.com> wrote:
> Fixes bugs in Auto-CMD23 feature enable decision. Auto-CMD23
> shoud be enabled if host is >= v3, and SDMA is not in use.
>
> USE_ADMA | USE_SDMA | Auto-CMD23
> ---------+----------+-----------
> 0 | 0 | 1
> ---------+----------+-----------
> 0 | 1 | 0
> ---------+----------+-----------
> 1 | 0 | 1
> ---------+----------+-----------
> 1 | 1 | 1
>
> Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
> ---
> drivers/mmc/host/sdhci.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index fbb1842..a4e64b0 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2498,9 +2498,9 @@ int sdhci_add_host(struct sdhci_host *host)
> host->flags |= SDHCI_AUTO_CMD12;
>
> /* Auto-CMD23 stuff only works in ADMA or PIO. */
> - if ((host->version == SDHCI_SPEC_300) &&
> + if ((host->version >= SDHCI_SPEC_300) &&
> ((host->flags & SDHCI_USE_ADMA) ||
> - !(host->flags & SDHCI_REQ_USE_DMA))) {
> + !(host->flags & SDHCI_USE_SDMA))) {
> host->flags |= SDHCI_AUTO_CMD23;
> printk(KERN_INFO "%s: Auto-CMD23 available\n", mmc_hostname(mmc));
> } else
> --
> 1.7.0.4
>
>
The reason the older logic didn't work correctly is because
SDHCI_REQ_USE_DMA is not set in sdhci_add_host, but set in
sdhci_prepare_data. That means if you didn't have USE_ADMA, but had
USE_SDMA, it would still enable AUTO_CMD23, since the
SDHCI_REQ_USE_DMA bit would always be 0. I would be very grateful if
you can try it out on your XO. I unfortunately can't test this out
right now.
A
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] MMC: SDHCI Auto-CMD23 fixes.
[not found] <m3aaeby3xr.fsf@pullcord.laptop.org>
@ 2011-05-25 7:13 ` Andrei Warkentin
2011-05-25 6:47 ` Andrei Warkentin
2011-05-25 20:13 ` Chris Ball
0 siblings, 2 replies; 4+ messages in thread
From: Andrei Warkentin @ 2011-05-25 7:13 UTC (permalink / raw)
To: linux-mmc; +Cc: cjb, Andrei Warkentin
Fixes bugs in Auto-CMD23 feature enable decision. Auto-CMD23
shoud be enabled if host is >= v3, and SDMA is not in use.
USE_ADMA | USE_SDMA | Auto-CMD23
---------+----------+-----------
0 | 0 | 1
---------+----------+-----------
0 | 1 | 0
---------+----------+-----------
1 | 0 | 1
---------+----------+-----------
1 | 1 | 1
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
---
drivers/mmc/host/sdhci.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index fbb1842..a4e64b0 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2498,9 +2498,9 @@ int sdhci_add_host(struct sdhci_host *host)
host->flags |= SDHCI_AUTO_CMD12;
/* Auto-CMD23 stuff only works in ADMA or PIO. */
- if ((host->version == SDHCI_SPEC_300) &&
+ if ((host->version >= SDHCI_SPEC_300) &&
((host->flags & SDHCI_USE_ADMA) ||
- !(host->flags & SDHCI_REQ_USE_DMA))) {
+ !(host->flags & SDHCI_USE_SDMA))) {
host->flags |= SDHCI_AUTO_CMD23;
printk(KERN_INFO "%s: Auto-CMD23 available\n", mmc_hostname(mmc));
} else
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] MMC: SDHCI Auto-CMD23 fixes.
2011-05-25 7:13 ` [PATCH] MMC: SDHCI Auto-CMD23 fixes Andrei Warkentin
2011-05-25 6:47 ` Andrei Warkentin
@ 2011-05-25 20:13 ` Chris Ball
2011-05-25 20:35 ` Andrei Warkentin
1 sibling, 1 reply; 4+ messages in thread
From: Chris Ball @ 2011-05-25 20:13 UTC (permalink / raw)
To: Andrei Warkentin; +Cc: linux-mmc
Hi,
On Wed, May 25 2011, Andrei Warkentin wrote:
> Fixes bugs in Auto-CMD23 feature enable decision. Auto-CMD23
> shoud be enabled if host is >= v3, and SDMA is not in use.
>
> USE_ADMA | USE_SDMA | Auto-CMD23
> ---------+----------+-----------
> 0 | 0 | 1
> ---------+----------+-----------
> 0 | 1 | 0
> ---------+----------+-----------
> 1 | 0 | 1
> ---------+----------+-----------
> 1 | 1 | 1
>
> Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Great, this does the right thing on my XO now. I'll send it to Linus
along with the rest of the merge shortly.
Thanks!
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MMC: SDHCI Auto-CMD23 fixes.
2011-05-25 20:13 ` Chris Ball
@ 2011-05-25 20:35 ` Andrei Warkentin
0 siblings, 0 replies; 4+ messages in thread
From: Andrei Warkentin @ 2011-05-25 20:35 UTC (permalink / raw)
To: Chris Ball; +Cc: linux-mmc
On Wed, May 25, 2011 at 3:13 PM, Chris Ball <cjb@laptop.org> wrote:
> Hi,
>
> On Wed, May 25 2011, Andrei Warkentin wrote:
>> Fixes bugs in Auto-CMD23 feature enable decision. Auto-CMD23
>> shoud be enabled if host is >= v3, and SDMA is not in use.
>>
>> USE_ADMA | USE_SDMA | Auto-CMD23
>> ---------+----------+-----------
>> 0 | 0 | 1
>> ---------+----------+-----------
>> 0 | 1 | 0
>> ---------+----------+-----------
>> 1 | 0 | 1
>> ---------+----------+-----------
>> 1 | 1 | 1
>>
>> Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
>
> Great, this does the right thing on my XO now. I'll send it to Linus
> along with the rest of the merge shortly.
>
> Thanks!
>
Great :-)! Thanks!
A
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-05-25 20:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <m3aaeby3xr.fsf@pullcord.laptop.org>
2011-05-25 7:13 ` [PATCH] MMC: SDHCI Auto-CMD23 fixes Andrei Warkentin
2011-05-25 6:47 ` Andrei Warkentin
2011-05-25 20:13 ` Chris Ball
2011-05-25 20:35 ` Andrei Warkentin
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).