From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Kevin Liu <kliu5@marvell.com>, Jialing Fu <jlfu@marvell.com>,
Jisheng Zhang <jszhang@marvell.com>
Subject: Re: [PATCH v2] mmc: sdhci: fix wakeup configuration
Date: Fri, 20 May 2016 21:28:56 +0300 [thread overview]
Message-ID: <573F5768.2070708@intel.com> (raw)
In-Reply-To: <CAPDyKFoqG6pYujivi6Rop4orVLViN7Feq+iB7LXkbx6zURZ=Qw@mail.gmail.com>
On 20/05/2016 4:39 p.m., Ulf Hansson wrote:
> On 20 May 2016 at 13:46, Adrian Hunter <adrian.hunter@intel.com> wrote:
>> On 13/05/16 16:16, Ludovic Desroches wrote:
>>> Activating wakeup event is not enough to get a wakeup signal. The
>>> corresponding events have to be enabled in the Interrupt Status Enable
>>> Register too. It follows the specification and is needed at least by
>>> sdhci-of-at91.
>>>
>>> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
>>
>> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>
> Is this material for stable and as a fix for 4.6?
Not as far as I know.
>
> Kind regards
> Uffe
>
>>
>>
>>> ---
>>> drivers/mmc/host/sdhci.c | 15 ++++++++++++++-
>>> 1 file changed, 14 insertions(+), 1 deletion(-)
>>>
>>> Changes:
>>> - v2:
>>> - update commit message and comments
>>> - do not rename val and mask variables
>>>
>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>> index e010ea4..e351859 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -2605,18 +2605,31 @@ static irqreturn_t sdhci_thread_irq(int irq, void *dev_id)
>>> \*****************************************************************************/
>>>
>>> #ifdef CONFIG_PM
>>> +/*
>>> + * To enable wakeup events, the corresponding events have to be enabled in
>>> + * the Interrupt Status Enable register too. See 'Table 1-6: Wakeup Signal
>>> + * Table' in the SD Host Controller Standard Specification.
>>> + * It is useless to restore SDHCI_INT_ENABLE state in
>>> + * sdhci_disable_irq_wakeups() since it will be set by
>>> + * sdhci_enable_card_detection() or sdhci_init().
>>> + */
>>> void sdhci_enable_irq_wakeups(struct sdhci_host *host)
>>> {
>>> u8 val;
>>> u8 mask = SDHCI_WAKE_ON_INSERT | SDHCI_WAKE_ON_REMOVE
>>> | SDHCI_WAKE_ON_INT;
>>> + u32 irq_val = SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE |
>>> + SDHCI_INT_CARD_INT;
>>>
>>> val = sdhci_readb(host, SDHCI_WAKE_UP_CONTROL);
>>> val |= mask ;
>>> /* Avoid fake wake up */
>>> - if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
>>> + if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) {
>>> val &= ~(SDHCI_WAKE_ON_INSERT | SDHCI_WAKE_ON_REMOVE);
>>> + irq_val &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE);
>>> + }
>>> sdhci_writeb(host, val, SDHCI_WAKE_UP_CONTROL);
>>> + sdhci_writel(host, irq_val, SDHCI_INT_ENABLE);
>>> }
>>> EXPORT_SYMBOL_GPL(sdhci_enable_irq_wakeups);
>>>
>>>
>>
next prev parent reply other threads:[~2016-05-20 18:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 13:16 [PATCH v2] mmc: sdhci: fix wakeup configuration Ludovic Desroches
2016-05-20 11:46 ` Adrian Hunter
2016-05-20 13:39 ` Ulf Hansson
2016-05-20 18:28 ` Adrian Hunter [this message]
2016-05-26 12:30 ` Ludovic Desroches
2016-06-03 8:33 ` 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=573F5768.2070708@intel.com \
--to=adrian.hunter@intel.com \
--cc=jlfu@marvell.com \
--cc=jszhang@marvell.com \
--cc=kliu5@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ludovic.desroches@atmel.com \
--cc=nicolas.ferre@atmel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox