From: "Joe Woodward" <jw@terrafix.co.uk>
To: Daniel Drake <dsd@laptop.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>
Subject: Re: mmc: sdio: runtime PM and 8686 problems
Date: Wed, 07 Dec 2011 12:28:51 +0000 [thread overview]
Message-ID: <WC20111207122851.07076E@terrafix.co.uk> (raw)
In-Reply-To: <CAMLZHHSGL20vr7E1rMO47RsxOmO-UPRyOdnqq=DUie3FVzNcaQ@mail.gmail.com>
Right, a bit more information.
First I tried just adding delays as suggested:
# Delays in core.c:mmc_power_up() increased to 1000.
# Delay in core.c:mmc_power_off() increased to 1000.
# sdio.c:mmc_sdio_power_restore() modified to add delays.
...
msleep(500);
sdio_reset(host);
msleep(500);
mmc_go_idle(host);
msleep(500);
mmc_send_if_cond(host, host->ocr_avail);
msleep(500);
ret = mmc_send_io_op_cond(host, 0, &ocr);
...
And there was no improvement (it slowed down the probe a lot!), so I tried again with much longer delays (3 seconds rather than 500ms) and still no change.
So I added control of the nRESET line in sdio.c:mmc_sdio_power_restore().
...
gpio_set_value(16, 0); /* GPIO16 is the nRESET line */
msleep(10);
gpio_set_value(16, 1);
msleep(100);
msleep(3000);
sdio_reset(host);
msleep(3000);
mmc_go_idle(host);
msleep(3000);
mmc_send_if_cond(host, host->ocr_avail);
msleep(3000);
...
and things sprung in to life, well sometimes! Sadly this only worked intermittently, and only with longer delays.
I guess this may not be a suprise, as I'm force resetting the card but not doing a full "probe".
I'm afraid I can't probe the nRESET line as the SD8686 is hidden under a shielding can, and I don't have the schematics for the GUMSTIX Overo to be able to
look for the signal anywhere else.
With the SD8686 only working every now and again with the nRESET control it's difficult to make progress as I'm stabbing around in the dark - I never really
know if I'm improving things or not when adding/removing timeouts etc...
Previous kernel's never had runtime PM enabled, so I'm not sure what you mean to compare there?
Whatever procedure is first applied to the SD8686 with runtime PM disabled works 100% of the time.
Does anyone know if OLPC keep any out-of-tree patches to make runtime PM work for them on the SD8686 (maybe fudging GPIOs or similar)?
Cheers,
Joe
-----Original Message-----
From: Daniel Drake <dsd@laptop.org>
To: Joe Woodward <jw@terrafix.co.uk>
Cc: Ohad Ben-Cohen <ohad@wizery.com>, linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>
Date: Sat, 3 Dec 2011 10:44:18 -0600
Subject: Re: mmc: sdio: runtime PM and 8686 problems
> On Thu, Dec 1, 2011 at 5:28 AM, Joe Woodward <jw@terrafix.co.uk> wrote:
> > I've had a play with the nRESET line (as far as I can tell it is the
> only pin I have access to), and no joy.
> >
> > Also tried playing about a bit with the CMD sequence, again no joy.
> >
> > I'm not entirely sure of the CMD sequence. It seems we get:
> > - CMD52 (x2)
> > - CMD0
> > - CMD8 (fails)
> > - CMD5 (fails)
> >
> > In the "SDIO Simplified Specification Version 2.00"
> (https://www.sdcard.org/developers/overview/sdio/sdio_spec/Simplified_S
> DIO_Card_Spec.pdf) page 6 it
> > seems only a CMD52 should be required to "Re-init IO". Previous
> thread posts state CMD5 (x2) are required by the 8686, but why
> CMD0/CMD8?
> >
> > Incidentally errors only occur after the CMD0, but before the first
> error we get (i.e. a change of cs from 1 to 0):
> > "mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 0
> timing 0".
>
> Can you see how this compares with older working kernels?
>
> Some more things to try:
> there are some delays in mmc_power_off - try increasing them to 1000.
>
>
> mmc_sdio_power_restore does:
> sdio_reset (cmd52)
> mmc_go_idle (cmd0)
> mmc_send_if_cond (cmd8)
> mmc_send_io_op_cond (cmd52)
>
> These are the commands you have been looking at from the angle of the
> logs.
>
> Try sprinkling in a load of msleep(500) delays before and inbetween
> those commands. And if you suspect some of them are not necessary
> trying removing them, etc.
>
> Non-scientific but this is how we have got things working so far :)
>
> Thanks,
> Daniel
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-12-07 12:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 8:53 mmc: sdio: runtime PM and 8686 problems Joe Woodward
2011-11-18 9:06 ` Ohad Ben-Cohen
2011-11-18 10:00 ` Joe Woodward
2011-11-18 12:15 ` Ohad Ben-Cohen
2011-11-29 11:17 ` Joe Woodward
2011-11-29 12:43 ` Ohad Ben-Cohen
2011-11-29 21:42 ` Daniel Drake
2011-11-30 10:36 ` Ohad Ben-Cohen
2011-11-30 14:12 ` Daniel Drake
2011-11-30 14:29 ` Ohad Ben-Cohen
2011-11-30 14:57 ` Daniel Drake
2011-12-01 7:50 ` Ohad Ben-Cohen
2011-11-30 15:00 ` Joe Woodward
2011-12-01 8:07 ` Ohad Ben-Cohen
2011-12-01 11:28 ` Joe Woodward
2011-12-03 16:44 ` Daniel Drake
2011-12-03 16:45 ` Daniel Drake
2011-12-07 12:28 ` Joe Woodward [this message]
2011-12-19 9:10 ` Ohad Ben-Cohen
2011-12-19 9:22 ` Ohad Ben-Cohen
2012-04-26 23:51 ` Steve Sakoman
2012-04-27 8:26 ` Joe Woodward
2012-04-28 9:51 ` NeilBrown
-- strict thread matches above, loose matches on Subject: below --
2011-12-01 11:29 Joe Woodward
2011-12-01 11:29 Joe Woodward
2011-11-11 7:26 [PATCH 2/2] mmc: core: Support packed command for eMMC4.5 device Seungwon Jeon
2011-11-11 9:38 ` S, Venkatraman
2011-11-11 19:01 ` merez
2011-11-14 9:46 ` Seungwon Jeon
2011-11-15 12:48 ` merez
2011-11-17 2:02 ` Seungwon Jeon
2011-11-17 9:16 ` mmc: sdio: runtime PM and 8686 problems Joe Woodward
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=WC20111207122851.07076E@terrafix.co.uk \
--to=jw@terrafix.co.uk \
--cc=cjb@laptop.org \
--cc=dsd@laptop.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ohad@wizery.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox