linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Fenkart <afenkart@gmail.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Chris Ball <cjb@laptop.org>, Tony Lindgren <tony@atomide.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Felipe Balbi <balbi@ti.com>, Balaji T K <balajitk@ti.com>,
	Daniel Mack <zonque@gmail.com>,
	linux-doc@vger.kernel.org, linux-mmc <linux-mmc@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>
Subject: Re: [PATCH v3 2/3] mmc: omap_hsmmc: Pin remux workaround to support SDIO interrupt on AM335x.
Date: Tue, 19 Nov 2013 14:37:52 +0100	[thread overview]
Message-ID: <CALtMJEB4RRHdc9HYqdCf=YonbpADrj5_MiWJgE1rxK_t5O8nsA@mail.gmail.com> (raw)
In-Reply-To: <CAPDyKFrTm3BB3o=445FjigB1nVuKukwa6FtunPqtzFR2BihhRg@mail.gmail.com>

Hi Ulf,

2013/11/19 Ulf Hansson <ulf.hansson@linaro.org>:
> On 18 November 2013 08:53, Andreas Fenkart <afenkart@gmail.com> wrote:

>>
>> +static irqreturn_t omap_hsmmc_cirq(int irq, void *dev_id)
>> +{
>> +       struct omap_hsmmc_host *host = dev_id;
>> +       unsigned long flags;
>> +
>> +       spin_lock_irqsave(&host->irq_lock, flags);
>> +       if (host->flags & HSMMC_CIRQ_GPIO_ENABLED) {
>> +               disable_irq_nosync(mmc_slot(host).sdio_irq);
>> +               host->flags &= ~HSMMC_CIRQ_GPIO_ENABLED;
>> +       }
>> +       spin_unlock_irqrestore(&host->irq_lock, flags);
>> +
>> +       pm_request_resume(host->dev); /* no use counter */
>
> In the case were you are not waking up from system suspend, but from
> runtime suspend, you likely want to signal the SDIO irq as soon as
> possible. Then you should use mmc_signal_sdio_irq instead.

That was my intention first as well, and previous patches worked that way.
SDIO IRQ while in pm_suspend is a rare event, compard to SDIO irq
while in pm_active state.

cat /proc/interrupts
           CPU0
 80:      68349      INTC  64  mmc0
236:       4352      GPIO  28  mmc0

Here the Wifi module is just connected, not being pinged or iperf
running. So the benefit will not be as big as you imagine.

On the other side the optimisations is not without problems, while in
pm_suspend the functional clock is off and you must not access the
registers of the module.

But this is exactly whapt happens when you call mmc_signal_sdio_irq,
it will call back into the drivers omap_hsmmc_enable_sdio_irq trying to
disable the SDIO irq. So you must add special state machines there.

After all it's doable but error prone, and I consider not worth the troubles
for no noticeable speedup.

Also have a look here, Balaji T K had a similar remark to yours
http://www.spinics.net/lists/linux-omap/msg99832.html

>
> In the other case, when waking up from system suspend, you should be
> able to completely rely on that the mmc_sdio_resume from the core
> layer, will handle the IRQ.
>
> Kind regards
> Ulf Hansson
>

  reply	other threads:[~2013-11-19 13:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18  7:53 [PATCH v3 0/3] mmc: omap_hsmmc: Enable SDIO IRQ Andreas Fenkart
2013-11-18  7:53 ` [PATCH v3 1/3] " Andreas Fenkart
2013-11-18  7:53 ` [PATCH v3 2/3] mmc: omap_hsmmc: Pin remux workaround to support SDIO interrupt on AM335x Andreas Fenkart
2013-11-18 10:03   ` Michael Trimarchi
2013-11-18 12:15     ` Andreas Fenkart
2013-11-18 16:22       ` Balaji T K
2013-11-19 15:49         ` Tony Lindgren
2013-11-19 15:59           ` Balaji T K
2013-11-19 16:19             ` Tony Lindgren
2013-11-21 11:37               ` Andreas Fenkart
2013-11-21 11:58                 ` Balaji T K
2014-06-30 12:23             ` Andreas Fenkart
2013-11-19 13:18   ` Ulf Hansson
2013-11-19 13:37     ` Andreas Fenkart [this message]
2013-11-19 15:09       ` Ulf Hansson
2013-11-18  7:54 ` [PATCH v3 3/3] mmc: omap_hsmmc: Extend debugfs for SDIO IRQ, GPIO and pinmux Andreas Fenkart
  -- strict thread matches above, loose matches on Subject: below --
2013-11-25 13:26 [PATCH v3 0/3] mmc: omap_hsmmc: Enable SDIO IRQ Andreas Fenkart
2013-11-25 13:26 ` [PATCH v3 2/3] mmc: omap_hsmmc: Pin remux workaround to support SDIO interrupt on AM335x Andreas Fenkart
2013-11-25 22:46   ` Tony Lindgren
2013-11-26  1:16     ` Felipe Balbi
2013-11-26 18:06       ` Tony Lindgren
2013-11-27 16:59     ` Balaji T K
2013-11-27 17:04       ` Tony Lindgren

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='CALtMJEB4RRHdc9HYqdCf=YonbpADrj5_MiWJgE1rxK_t5O8nsA@mail.gmail.com' \
    --to=afenkart@gmail.com \
    --cc=balajitk@ti.com \
    --cc=balbi@ti.com \
    --cc=cjb@laptop.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=ulf.hansson@linaro.org \
    --cc=zonque@gmail.com \
    /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).