All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Kevin Liu <keyuan.liu@gmail.com>
Cc: linux-mmc@vger.kernel.org
Subject: Re: sdhci: sdio wakeup and free_irq
Date: Sun, 23 Sep 2012 23:25:19 -0400	[thread overview]
Message-ID: <m3d31cdrvk.fsf@pullcord.laptop.org> (raw)
In-Reply-To: <CADz5_gLLTY6ibBSZCHfYFfJ9Uz15zVu41hm19pQ_FCgBqhsmEw@mail.gmail.com> (Kevin Liu's message of "Fri, 21 Sep 2012 17:20:56 +0800")

Hi,

On Fri, Sep 21 2012, Kevin Liu wrote:
> Can latest code support sdio wakeup?

Yes, it should work.  OLPC has been using it in production with
libertas_sdio for several years.

> I see at last of sdhci_suspend_host, irq will be freed. But if the irq
> is used for wakeup system like sdio wakeup irq? Then system can't be
> woken up.

free_irq() is just removing the handler while the stack is suspended, it
isn't stopping your hardware from waking up the system.  Your hardware
needs to be programmed to wake the system if the SDIO IRQ fires; many
SoCs will do this as long as the SDIO is in 1-bit data width mode (which
doesn't require the card clock to be powered).  We turn on 1-bit mode if
MMC_PM_KEEP_POWER is set in host->pm_flags.

The driver (libertas, mwifiex) is responsible for setting host->pm_flags
if it wants the SDIO to stay powered during the next system suspend.

Once the hardware wakes up the system, we'll register the handler again,
it will fire because the line is still raised, and we'll handle it the
normal way.  The card isn't reinitialized if MMC_PM_KEEP_POWER is set.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  reply	other threads:[~2012-09-24  3:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21  9:20 sdhci: sdio wakeup and free_irq Kevin Liu
2012-09-24  3:25 ` Chris Ball [this message]
2012-09-24  4:21   ` Kevin Liu
2012-09-24  4:47     ` Chris Ball
2012-09-24  5:54       ` Kevin Liu

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=m3d31cdrvk.fsf@pullcord.laptop.org \
    --to=cjb@laptop.org \
    --cc=keyuan.liu@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 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.