LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2] wlcore: sdio: allow pm to handle sdio power
@ 2018-04-26 5:47 Eyal Reizer
2018-04-26 8:16 ` Kalle Valo
2018-04-30 10:31 ` [v2] " Kalle Valo
0 siblings, 2 replies; 6+ messages in thread
From: Eyal Reizer @ 2018-04-26 5:47 UTC (permalink / raw)
To: kvalo, linux-wireless, robh, sre, tony, linux-kernel; +Cc: Eyal Reizer
pm_runtime handles sdio power on and power off transitions.
An old workaround for trying to control the power explicitly from the
driver was in fact causing failures on suspend/resume as the mmc layer
already power the module on resume.
In case of resume pm_runtime_get sync returns a positive device's usage
count causing the driver to try an re-initialize an already initialized
device. This was causing sdio bus failure on resume.
Remove this manual power on/off sequence as it is in-fact not needed.
Signed-off-by: Eyal Reizer <eyalr@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
---
drivers/net/wireless/ti/wlcore/sdio.c | 27 ++++++---------------------
1 file changed, 6 insertions(+), 21 deletions(-)
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 1f727ba..6dbe61d 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -155,17 +155,11 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
struct mmc_card *card = func->card;
ret = pm_runtime_get_sync(&card->dev);
- if (ret) {
- /*
- * Runtime PM might be temporarily disabled, or the device
- * might have a positive reference counter. Make sure it is
- * really powered on.
- */
- ret = mmc_power_restore_host(card->host);
- if (ret < 0) {
- pm_runtime_put_sync(&card->dev);
- goto out;
- }
+ if (ret < 0) {
+ pm_runtime_put_noidle(&card->dev);
+ dev_err(glue->dev, "%s: failed to get_sync(%d)\n",
+ __func__, ret);
+ goto out;
}
sdio_claim_host(func);
@@ -178,7 +172,6 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
{
- int ret;
struct sdio_func *func = dev_to_sdio_func(glue->dev);
struct mmc_card *card = func->card;
@@ -186,16 +179,8 @@ static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
sdio_disable_func(func);
sdio_release_host(func);
- /* Power off the card manually in case it wasn't powered off above */
- ret = mmc_power_save_host(card->host);
- if (ret < 0)
- goto out;
-
/* Let runtime PM know the card is powered off */
- pm_runtime_put_sync(&card->dev);
-
-out:
- return ret;
+ return pm_runtime_put_sync(&card->dev);
}
static int wl12xx_sdio_set_power(struct device *child, bool enable)
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] wlcore: sdio: allow pm to handle sdio power
2018-04-26 5:47 [PATCH v2] wlcore: sdio: allow pm to handle sdio power Eyal Reizer
@ 2018-04-26 8:16 ` Kalle Valo
2018-04-26 8:37 ` [EXTERNAL] " Reizer, Eyal
2018-04-30 10:31 ` [v2] " Kalle Valo
1 sibling, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2018-04-26 8:16 UTC (permalink / raw)
To: Eyal Reizer; +Cc: linux-wireless, robh, sre, tony, linux-kernel, Eyal Reizer
Eyal Reizer <eyalreizer@gmail.com> writes:
> pm_runtime handles sdio power on and power off transitions.
> An old workaround for trying to control the power explicitly from the
> driver was in fact causing failures on suspend/resume as the mmc layer
> already power the module on resume.
>
> In case of resume pm_runtime_get sync returns a positive device's usage
> count causing the driver to try an re-initialize an already initialized
> device. This was causing sdio bus failure on resume.
>
> Remove this manual power on/off sequence as it is in-fact not needed.
>
> Signed-off-by: Eyal Reizer <eyalr@ti.com>
> Acked-by: Tony Lindgren <tony@atomide.com>
No changelog.
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#changelog_missing
No need to resubmit because of this, I guess you just fixed the title
and added Tony's Acked-by?
--
Kalle Valo
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [EXTERNAL] Re: [PATCH v2] wlcore: sdio: allow pm to handle sdio power
2018-04-26 8:16 ` Kalle Valo
@ 2018-04-26 8:37 ` Reizer, Eyal
2018-04-26 9:26 ` Kalle Valo
0 siblings, 1 reply; 6+ messages in thread
From: Reizer, Eyal @ 2018-04-26 8:37 UTC (permalink / raw)
To: Kalle Valo, Eyal Reizer; +Cc: linux-wireless, robh, sre, tony, linux-kernel
>
> > pm_runtime handles sdio power on and power off transitions.
> > An old workaround for trying to control the power explicitly from the
> > driver was in fact causing failures on suspend/resume as the mmc layer
> > already power the module on resume.
> >
> > In case of resume pm_runtime_get sync returns a positive device's usage
> > count causing the driver to try an re-initialize an already initialized
> > device. This was causing sdio bus failure on resume.
> >
> > Remove this manual power on/off sequence as it is in-fact not needed.
> >
> > Signed-off-by: Eyal Reizer <eyalr@ti.com>
> > Acked-by: Tony Lindgren <tony@atomide.com>
>
> No changelog.
>
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingp
> atches#changelog_missing
>
> No need to resubmit because of this, I guess you just fixed the title
> and added Tony's Acked-by?
Yes, this is correct. No change in the actual patch hence there was no change
Log.
Best Regards,
Eyal
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [EXTERNAL] Re: [PATCH v2] wlcore: sdio: allow pm to handle sdio power
2018-04-26 8:37 ` [EXTERNAL] " Reizer, Eyal
@ 2018-04-26 9:26 ` Kalle Valo
2018-04-26 10:14 ` Reizer, Eyal
0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2018-04-26 9:26 UTC (permalink / raw)
To: Reizer, Eyal; +Cc: Eyal Reizer, linux-wireless, robh, sre, tony, linux-kernel
"Reizer, Eyal" <eyalr@ti.com> writes:
>>
>> > pm_runtime handles sdio power on and power off transitions.
>> > An old workaround for trying to control the power explicitly from the
>> > driver was in fact causing failures on suspend/resume as the mmc layer
>> > already power the module on resume.
>> >
>> > In case of resume pm_runtime_get sync returns a positive device's usage
>> > count causing the driver to try an re-initialize an already initialized
>> > device. This was causing sdio bus failure on resume.
>> >
>> > Remove this manual power on/off sequence as it is in-fact not needed.
>> >
>> > Signed-off-by: Eyal Reizer <eyalr@ti.com>
>> > Acked-by: Tony Lindgren <tony@atomide.com>
>>
>> No changelog.
>>
>> https://wireless.wiki.kernel.org/en/developers/documentation/submittingp
>> atches#changelog_missing
>>
>> No need to resubmit because of this, I guess you just fixed the title
>> and added Tony's Acked-by?
>
> Yes, this is correct. No change in the actual patch hence there was no change
> Log.
_Always_ include a change log, even if you didn't actually change
anything. Otherwise the maintainer has no clue what has changed and why
a new version was submitted.
--
Kalle Valo
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [EXTERNAL] Re: [PATCH v2] wlcore: sdio: allow pm to handle sdio power
2018-04-26 9:26 ` Kalle Valo
@ 2018-04-26 10:14 ` Reizer, Eyal
0 siblings, 0 replies; 6+ messages in thread
From: Reizer, Eyal @ 2018-04-26 10:14 UTC (permalink / raw)
To: Kalle Valo; +Cc: Eyal Reizer, linux-wireless, robh, sre, tony, linux-kernel
>
> >>
> >> > pm_runtime handles sdio power on and power off transitions.
> >> > An old workaround for trying to control the power explicitly from the
> >> > driver was in fact causing failures on suspend/resume as the mmc layer
> >> > already power the module on resume.
> >> >
> >> > In case of resume pm_runtime_get sync returns a positive device's
> usage
> >> > count causing the driver to try an re-initialize an already initialized
> >> > device. This was causing sdio bus failure on resume.
> >> >
> >> > Remove this manual power on/off sequence as it is in-fact not needed.
> >> >
> >> > Signed-off-by: Eyal Reizer <eyalr@ti.com>
> >> > Acked-by: Tony Lindgren <tony@atomide.com>
> >>
> >> No changelog.
> >>
> >>
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingp
> >> atches#changelog_missing
> >>
> >> No need to resubmit because of this, I guess you just fixed the title
> >> and added Tony's Acked-by?
> >
> > Yes, this is correct. No change in the actual patch hence there was no
> change
> > Log.
>
> _Always_ include a change log, even if you didn't actually change
> anything. Otherwise the maintainer has no clue what has changed and why
> a new version was submitted.
>
Understood. Thanks!
BR,
Eyal
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [v2] wlcore: sdio: allow pm to handle sdio power
2018-04-26 5:47 [PATCH v2] wlcore: sdio: allow pm to handle sdio power Eyal Reizer
2018-04-26 8:16 ` Kalle Valo
@ 2018-04-30 10:31 ` Kalle Valo
1 sibling, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2018-04-30 10:31 UTC (permalink / raw)
To: Eyal Reizer; +Cc: linux-wireless, robh, sre, tony, linux-kernel, Eyal Reizer
Eyal Reizer <eyalreizer@gmail.com> wrote:
> pm_runtime handles sdio power on and power off transitions.
> An old workaround for trying to control the power explicitly from the
> driver was in fact causing failures on suspend/resume as the mmc layer
> already power the module on resume.
>
> In case of resume pm_runtime_get sync returns a positive device's usage
> count causing the driver to try an re-initialize an already initialized
> device. This was causing sdio bus failure on resume.
>
> Remove this manual power on/off sequence as it is in-fact not needed.
>
> Signed-off-by: Eyal Reizer <eyalr@ti.com>
> Acked-by: Tony Lindgren <tony@atomide.com>
Patch applied to wireless-drivers-next.git, thanks.
60f36637bbbd wlcore: sdio: allow pm to handle sdio power
--
https://patchwork.kernel.org/patch/10364645/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-04-30 10:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 5:47 [PATCH v2] wlcore: sdio: allow pm to handle sdio power Eyal Reizer
2018-04-26 8:16 ` Kalle Valo
2018-04-26 8:37 ` [EXTERNAL] " Reizer, Eyal
2018-04-26 9:26 ` Kalle Valo
2018-04-26 10:14 ` Reizer, Eyal
2018-04-30 10:31 ` [v2] " Kalle Valo
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).