public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Prasanna NAVARATNA <prasanna.navaratna@gmail.com>
To: linux-mmc@vger.kernel.org
Subject: Re: core: negotiate ocr during resume
Date: Mon, 8 Apr 2013 06:41:35 +0000 (UTC)	[thread overview]
Message-ID: <loom.20130408T082911-988@post.gmane.org> (raw)
In-Reply-To: CADz5_g+V-th0Vpyo72sOOCKUBsZbT2VQCkAXrVFfJBEDbDfF_w@mail.gmail.com


Kevin : you didn't handle the special case that the card is changed to a
new card during suspended. So the ocr may be different here.

PNN : This case doesn't holds good because even when new card is inserted
during suspend, cd interrupt is generated and mmc_detect_change will be
called and mmc_rescan will be scheduled to begin initialization from the
beginning, where ocr is freshly read from new card (mmc_attach_***) and my
patch will take care to update new ocr in card->ocr.
Although consider an hypothetical situation where within the debounce time
of cd, suppose resume gets called, it may fail. But fair enough after 200ms,
fresh initialization will begin and card re-inits. So no need to take
special consideration here. Don't you agree?

Kevin : But if the card detect can't wakeup system then the cd interrupt may
be discarded if it occurred during system suspended. For example, if
the card detect used slot-gpio and the slot power is off during system
suspended or card used polling for card detect.
So there must be a solution to verify whether a same card after system
resumed. In fact, there have been such method in current code:

in mmc_sd_init_card:
        if (oldcard) {
                if (memcmp(cid, oldcard->raw_cid, sizeof(cid)) != 0)
                        return -ENOENT;
                card = oldcard;

So in my patch, I moved mmc_select_voltage after this verification.
Please consider this case.

_PNN_ : I personally haven’t seen any system design where card insertion or 
removal doesn't generate interrupt to resume the system (I may not have seen 
enough variety of systems)
But suppose assume, mmc_detect_change, for various reasons as you mentioned 
above is not called during card insertion or removal.
Then still “oldcard” pointer is valid but old card has been replaced with 
new card. Your patch will still consider old ocr saved of old card. Right?
I didn't understand, how does your patch works and takes care of this 
situation? Please elaborate.

Thanks & Regards,
Prasanna NAVARATNA


  reply	other threads:[~2013-04-08  7:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-07  1:55 core: negotiate ocr during resume Kevin Liu
2013-04-08  6:41 ` Prasanna NAVARATNA [this message]
2013-04-08  8:09   ` [PATCH] mmc: Adding (more) ftrace event logging to the mmc layer "Månsson, Björn"
  -- strict thread matches above, loose matches on Subject: below --
2013-04-05  8:33 core: negotiate ocr during resume Kevin Liu
2013-04-05  9:44 ` Prasanna NAVARATNA
2013-04-05 10:37 ` Prasanna NAVARATNA
2013-04-05 10:49 ` Prasanna NAVARATNA

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=loom.20130408T082911-988@post.gmane.org \
    --to=prasanna.navaratna@gmail.com \
    --cc=linux-mmc@vger.kernel.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