linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: John Stultz <john.stultz@linaro.org>
Cc: Zoran Markovic <zoran.markovic@linaro.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Chris Ball <cjb@laptop.org>, San Mehat <san@google.com>,
	Colin Cross <ccross@android.com>
Subject: Re: [RFC/PATCH] mmc: core: Signal wakeup event at card insert/removal
Date: Tue, 1 Oct 2013 11:22:43 +0200	[thread overview]
Message-ID: <CAPDyKFoSr_iExmxUpx8g+padMWSas97pEasnwk_MH6Ho7q70sQ@mail.gmail.com> (raw)
In-Reply-To: <5241C4CD.4080200@linaro.org>

Hi John,

> So how does the notification done to userspace? I wonder if you could
> use the select/lock/read style method for releasing the kernel space
> wakeup_source, as is done in the input layer?

If I understand what you mean correctly, it is very similar what Zoran
tried to do before in his patch!?

For the mmc subsystem, especially considering the pitfalls around the
scheduled detect work, I think it will be hard to get this right, if
implementing like this. I fear we might end up in situations were the
wakeup_source is never "relaxed".

>
>
>> Not sure how to set the time-out value to meet all expectations. I
>> believe we could also consider that inserting/removing a card is a
>> quite seldom operation, so using a bit higher value than necessary
>> might be okay. What do you think?
>
> As long as its sure to be *very* rare, then slightly longer delays
> aren't a major problem.  The trouble with the timeout style wakelocks is
> that they are easy to misuse and that hurts power efficiency. (I've
> heard stories of badly written wifi drivers that took 5 minute timed
> wakelocks on packets, which effectively kept devices from ever sleeping).

In this case, I am more confident that this would actually simplify
code that much, so we can get around all the scary pitfalls.

I can only think of one case which could lead to problem. If there is
a host driver, enabled for wakeup, that gets spurious card detect
irqs, outside the window were you expect a card to be
detected/removed, and at the same time do not have a software
mechanism to "debounce" the irqs. But, should we even consider this as
a valid case?

Kind regards
Ulf Hansson

>
> So if possible, its much better to have a normal path where the pm_relax
> is called in most cases, using the timeout for only the few places where
> you really can't get an end point.
>
> thanks
> -john

  reply	other threads:[~2013-10-01  9:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20  9:48 [RFC/PATCH] mmc: core: Signal wakeup event at card insert/removal Ulf Hansson
2013-09-23 10:55 ` Jaehoon Chung
2013-09-23 12:11   ` Ulf Hansson
2013-09-23 12:46     ` Jaehoon Chung
2013-09-23 21:14 ` Zoran Markovic
2013-09-24  7:55   ` Ulf Hansson
2013-09-24 16:58     ` John Stultz
2013-10-01  9:22       ` Ulf Hansson [this message]
2013-10-10 18:41         ` Zoran Markovic
2013-09-24  9:58 ` 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=CAPDyKFoSr_iExmxUpx8g+padMWSas97pEasnwk_MH6Ho7q70sQ@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=ccross@android.com \
    --cc=cjb@laptop.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=san@google.com \
    --cc=zoran.markovic@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).