linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: NeilBrown <neilb@suse.de>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux-pm mailing list <linux-pm@vger.kernel.org>
Subject: Re: SDIO driver return -ENOSYS behaviour change?
Date: Fri, 28 Feb 2014 16:49:52 +0800	[thread overview]
Message-ID: <53104DB0.9010709@intel.com> (raw)
In-Reply-To: <CAPDyKFpWS+hRJM2Fz=TZxyFzQWkGwE7YRTuToB_t+1ODY0SQeg@mail.gmail.com>

On 02/28/2014 04:30 PM, Ulf Hansson wrote:
> On 28 February 2014 03:37, Aaron Lu <aaron.lu@intel.com> wrote:
>> On 02/27/2014 09:05 PM, Ulf Hansson wrote:
>>> I think it's more a matter of having a controlled suspend sequence.
>>> The mmc core are not able to serve any new SDIO requests while it is
>>> suspended, therefore it tells the sdio func driver about when it safe
>>> to send request - using it's PM callbacks.
>>
>> Does this mean after the function device is suspended from PM core's
>> pespective, the mmc core will still send some requests to the function
>> device? I did see one such request, disable_width, get sent after the
>> function driver's suspend callback is invoked, don't know if there are
>> others.
> 
> Nope. The mmc core will send request to the "card device" during
> suspend. Those are part's of a sequence to put the card in a proper
> "suspend mode".

I suppose this request is sent after calling function driver's suspend
callback? BTW, what request is it?

> 
>>
>> From the mmc_sdio_suspend function I can see two things are done:
>> 1 function device driver's suspend callback is called;
>> 2 optionally disable_width and power off the card according to some flags.
>>
>> So once we fixed the -ENOSYS problem, can we have the function device
>> run its own suspend callback and have the mmc_sdio_suspend just did the
>> disable_width and power off thing?
> 
> That requires that all sdio func devices get suspended before the card
> devices. (And resumed after, but that will of course be implicit.)

Yes, and this is guaranteed by PM core as the function device is the
child of the card device.

> 
> I guess the guarantee for that is already present, since we have added
> the func device to the driver model after we have added the card
> device at mmc_sdio_attach(). So, I suppose this could work.

Exactly.

> 
> Do you want me to create a patch that you can test?

That would be good. I do not have any SDIO card at hand, but I would be
glad to review the patch.

Thanks,
Aaron

      reply	other threads:[~2014-02-28  8:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27  9:10 SDIO driver return -ENOSYS behaviour change? Aaron Lu
2014-02-27 10:18 ` Ulf Hansson
2014-02-27 11:26   ` Aaron Lu
2014-02-27 13:05     ` Ulf Hansson
2014-02-28  2:37       ` Aaron Lu
2014-02-28  8:30         ` Ulf Hansson
2014-02-28  8:49           ` Aaron Lu [this message]

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=53104DB0.9010709@intel.com \
    --to=aaron.lu@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@linaro.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).