linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Eric Bentley <Eric.Bentley@lairdtech.com>,
	Kalle Valo <kvalo@codeaurora.org>
Cc: Steve deRosier <derosier@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v2] brcmfmac: Correctly fail to suspend when SDIO does not support power on suspend
Date: Fri, 1 Sep 2017 22:02:48 +0200	[thread overview]
Message-ID: <eacde476-6130-6ab1-ea09-ceb2d3a58aaa@broadcom.com> (raw)
In-Reply-To: <AC37C967-209B-4BC3-9AF2-9CC4C27391C0@lairdtech.com>

On 01-09-17 15:00, Eric Bentley wrote:
> Return error when failing to set power management capabilities flag.  This will
> cause the suspend to fail but the radio will continue to operate.  Allowing this
> to fail without reporting error will cause the radio to be non-functional on
> resume as it will have lost power.

There is more to this story to tell. Initially, the suspend callback did 
return an error upon failing to set the flags. This was dropped by 
commit 330b4e4be937 ("brcmfmac: Add wowl support for SDIO devices.") as 
it set the flags only for wowl and that wowl would only be enabled if 
the host supports the capability flags:

+#ifdef CONFIG_PM_SLEEP
+       /* wowl can be supported when KEEP_POWER is true and (WAKE_SDIO_IRQ
+        * is true or when platform data OOB irq is true).
+        */
+       if ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_KEEP_POWER) &&
+           ((sdio_get_host_pm_caps(sdiodev->func[1]) & 
MMC_PM_WAKE_SDIO_IRQ) ||
+            (sdiodev->pdata->oob_irq_supported)))
+               bus_if->wowl_supported = true;
+#endif

However, MMC_PM_KEEP_POWER is also needed for the non-wowl case. I 
restored that in commit bdf1340cf20f ("brcmfmac: fix sdio suspend and 
resume"), but overlooked the error code return also needed to be restored.

Also note that the wifi chip (the term "radio" does not quite cover it) 
has not really lost power. It is quite common that it is not powered 
through the SDIO bus. With the power-sequence support in the MMC stack 
these days the suspend may result in loss of power. Otherwise, it is 
just the bus that loses power (and clock) and the flags affect what 
tricks the MMC stack tries to pull to get the device accessible again 
upon resume.

Maybe you can incorporate some of this in the commit message, but you 
should at least add:

Fixes: 330b4e4be937 ("brcmfmac: Add wowl support for SDIO devices.")
Fixes: bdf1340cf20f ("brcmfmac: fix sdio suspend and resume")
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Eric Bentley eric.bentley@lairdtech.com
> ---
> v2: corrected errant ( with {
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

  reply	other threads:[~2017-09-01 20:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01 13:00 [PATCH v2] brcmfmac: Correctly fail to suspend when SDIO does not support power on suspend Eric Bentley
2017-09-01 20:02 ` Arend van Spriel [this message]
2017-09-04 19:33   ` Steve deRosier
2017-09-04 20:40     ` Arend van Spriel
2017-09-07 12:54 ` [v2] " Kalle Valo

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=eacde476-6130-6ab1-ea09-ceb2d3a58aaa@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=Eric.Bentley@lairdtech.com \
    --cc=derosier@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@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;
as well as URLs for NNTP newsgroup(s).