From: NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>
To: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Chris Ball <chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-mmc <linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
GTA04 owners
<gta04-owner-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
Subject: Re: [PATCH 2/2] mmc: core: reset sdio card properly on resume.
Date: Tue, 11 Nov 2014 11:17:38 +1100 [thread overview]
Message-ID: <20141111111738.1e7856ce@notabene.brown> (raw)
In-Reply-To: <CAPDyKFrrOozTO5xR8RO=4L8xZ9hLGizH=2mxZE=5zvwMhhgD+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2589 bytes --]
On Mon, 10 Nov 2014 14:29:19 +0100 Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On 8 November 2014 01:14, NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org> wrote:
> > mmc_sdio_power_restore calls
> > mmc_send_if_cond(host, host->ocr_avail);
> >
> > ret = mmc_send_io_op_cond(host, 0, NULL);
> >
> > between mmc_go_idle() and mmc_sdio_init_card().
> > mmc_sdio_resume needs to as well, else my libertas sdio wifi
> > device doesn't resume properly from suspend.
> >
> > Signed-off-by: NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>
> > ---
> > drivers/mmc/core/sdio.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> > index e636d9e99e4a..3f069a6f448f 100644
> > --- a/drivers/mmc/core/sdio.c
> > +++ b/drivers/mmc/core/sdio.c
> > @@ -981,8 +981,12 @@ static int mmc_sdio_resume(struct mmc_host *host)
> > if (mmc_card_is_removable(host) || !mmc_card_keep_power(host)) {
> > sdio_reset(host);
> > mmc_go_idle(host);
> > - err = mmc_sdio_init_card(host, host->card->ocr, host->card,
> > - mmc_card_keep_power(host));
> > + mmc_send_if_cond(host, host->ocr_avail);
>
> /s /host->ocr_avail /host->card->ocr
>
> I would expect that to work. I do realize that "host->ocr_avail" is
> being used in the ->power_restore() callback, but I think that's wrong
> as well. Could you maybe verify that changing to host->card->ocr works
> in this path as well? That's would of course be a separate patch.
Hi Ulf,
I made the substitution in mmc_sdio_resume and mmc_sdio_power_restore
and my sdio device continues to work, including after resume.
The host->card->ocr value is 0x10000, the host->ocr_avail value is 0x18000.
If you like I'll send the two patches formally, but it might be a day or so.
Thanks,
NeilBrown
>
> > + err = mmc_send_io_op_cond(host, 0, NULL);
> > + if (!err)
> > + err = mmc_sdio_init_card(host, host->card->ocr,
> > + host->card,
> > + mmc_card_keep_power(host));
> > } else if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) {
> > /* We may have switched to 1-bit mode during suspend */
> > err = sdio_enable_4bit_bus(host->card);
> >
> >
>
> Kind regards
> Uffe
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
next prev parent reply other threads:[~2014-11-11 0:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-08 0:14 [PATCH 0/2] mmc: improve power-on for sdio wifi card NeilBrown
2014-11-08 0:14 ` [PATCH 2/2] mmc: core: reset sdio card properly on resume NeilBrown
2014-11-10 13:29 ` Ulf Hansson
[not found] ` <CAPDyKFrrOozTO5xR8RO=4L8xZ9hLGizH=2mxZE=5zvwMhhgD+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-11 0:17 ` NeilBrown [this message]
2014-11-11 8:12 ` Ulf Hansson
2014-11-08 0:14 ` [PATCH 1/2] mmc: core: allow a reset gpio to be configured NeilBrown
2014-11-28 11:56 ` Ulf Hansson
2014-11-28 14:45 ` Mark Brown
2014-12-02 1:55 ` NeilBrown
2014-12-02 6:05 ` [Gta04-owner] " Dr. H. Nikolaus Schaller
2014-12-02 12:11 ` Ulf Hansson
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=20141111111738.1e7856ce@notabene.brown \
--to=neilb-l3a5bk7wagm@public.gmane.org \
--cc=chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gta04-owner-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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).