All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Lemberg <Alex.Lemberg@sandisk.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Avi Shchislowski <Avi.Shchislowski@sandisk.com>,
	linux-mmc <linux-mmc@vger.kernel.org>
Subject: RE: [RFC PATCH v3] mmc: sleep notification
Date: Mon, 3 Aug 2015 12:44:26 +0000	[thread overview]
Message-ID: <282CEDFCBC30114F83C499CB8F2ED53343C9F474@SACMBXIP01.sdcorp.global.sandisk.com> (raw)
In-Reply-To: <CAPDyKFqV4pQYUUtZYJjFP72KNeAQJMV9qMV1uN2sKCT0At3s4g@mail.gmail.com>

Hi Ulf,


> -----Original Message-----
> From: Ulf Hansson [mailto:ulf.hansson@linaro.org]
> Sent: Wednesday, July 22, 2015 5:41 PM
> To: Alex Lemberg
> Cc: Avi Shchislowski; linux-mmc
> Subject: Re: [RFC PATCH v3] mmc: sleep notification
> 
> On 18 June 2015 at 16:57, Alex Lemberg <Alex.Lemberg@sandisk.com>
> wrote:
> > Hi Ulf,
> >
> >> -----Original Message-----
> >> From: Ulf Hansson [mailto:ulf.hansson@linaro.org]
> >> Sent: Monday, June 15, 2015 11:24 AM
> >> To: Alex Lemberg
> >> Cc: Avi Shchislowski; linux-mmc
> >> Subject: Re: [RFC PATCH v3] mmc: sleep notification
> >>
> >> On 8 June 2015 at 15:17, Alex Lemberg <Alex.Lemberg@sandisk.com>
> >> wrote:
> >> > Hi Ulf,
> >> >
> >> > [...]
> >> >
> >> >>
> >> >> One of my comments for v2, was that I think you should remove all
> >> >> code which was related to HPI to interrupt sleep notification from
> >> >> the runtime PM resume path. Instead I wanted you to add that
> >> >> functionality as separate patch based on top of this patch.
> >> >>
> >> >> You haven't done that in v3, why?
> >> >
> >> > The sleep_notify call was moved to suspend() per your
> recommendation.
> >> > As far as I understand, no new requests should be sent during
> >> > mmc_suspend() process, thus HPI support is not needed anymore.
> >> > Is this the correct assumption?
> >>
> >> Yes.
> >>
> >> I don't think you need mmc_card_set_sleep_notify() and the
> >> corresponding new MMC_STATE_SLEEP_NOTIFY ,
> mmc_device_prg_state(), etc.
> >
> > mmc_card_set_sleep_notify(), MMC_STATE_SLEEP_NOTIFY and the
> corresponding - We are removing it from the current patch. Probably will add
> them as a separate patch in future.
> 
> Great!
> 
> > mmc_device_prg_state() - is required for waiting for Sleep_Notification
> completion/timeout, although we would like to leave this function.
> 
> Doesn't __mmc_switch() already deal with this? No, I don't think it's needed.
You are right, __mmc_switch() wait loop is enough, if HPI is not going to be in use during sleep_notification.
> 
> >
> >>
> >> Overall, I think this patch could be simplified yet another step.
> >>
> >> > The only case where HPI is used in this patch - is during
> >> > sleep_notify
> >> timeout error.
> >>
> >> Why?
> >
> > In case of timeout error, we would like to handle it by sending HPI - to let
> device interrupt/stop the prg state.
> 
> Is that according to the spec? I think it would be better to try a reset
> sequence to recover, by using CMD0 and so forth, what do you think?

Not must by the spec, but there are several options how to handle timeout error.
Checking the existing driver, the '-ETIMEDOUT' error is handled by mmc_interrupt_hpi ()
in case of  mmc_wait_for_req_done() function. 
Can we use the same approach?

> 
> >
> >>
> >> One final question, I noticed that you have removed the check for
> >> MMC_CAP2_FULL_PWR_CYCLE in the _mmc_suspend() function, why?
> >
> > As far as we understand, this MMC_CAP2_FULL_PWR_CYCLE was used to
> > distinguish between PON (when the power can be cut) and Sleep (when the
> power have to stay ON).
> > Now we have Sleep_Notification PON, which allows to cut the power also
> in case of Sleep.
> > Hope the interpretation above is correct.
> 
> Unfortunate your interpretation is wrong.
> 
> MMC_CAP2_FULL_PWR_CYCLE, indicates whether the mmc host can cut
> *both* VCC and VCCQ.
> 
> For the suspend case, the default behaviour is to send CMD5 (sleep), as we
> don't trust hosts to set MMC_CAP2_FULL_PWR_CYCLE even if it potentially
> could.
> Keeping this policy is important, as we don't want to issue PON unless we
> know that we will be cutting both VCC and VCCQ.

You are right, spec doesn’t talk about vccq in case of Sleep_Notification, but
only  about vcc.
We will stay with existing logic and add sleep_notification call before sending sleep command.

Thanks,
Alex

> 
> Kind regards
> Uffe

  reply	other threads:[~2015-08-03 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08  6:46 [RFC PATCH v3] mmc: sleep notification Avi Shchislowski
2015-06-08  9:03 ` Ulf Hansson
2015-06-08 13:17   ` Alex Lemberg
2015-06-15  8:23     ` Ulf Hansson
2015-06-18 14:57       ` Alex Lemberg
2015-07-22 14:40         ` Ulf Hansson
2015-08-03 12:44           ` Alex Lemberg [this message]
2015-08-25 12:04             ` 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=282CEDFCBC30114F83C499CB8F2ED53343C9F474@SACMBXIP01.sdcorp.global.sandisk.com \
    --to=alex.lemberg@sandisk.com \
    --cc=Avi.Shchislowski@sandisk.com \
    --cc=linux-mmc@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.