All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module
@ 2015-12-01  5:39 Tony Lindgren
  2015-12-01  5:39   ` Tony Lindgren
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Tony Lindgren @ 2015-12-01  5:39 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: linux-kernel, linux-usb, linux-omap

Hi,

Here are two fixes for rmmod and PM. These can be merged separately after
the review from the MUSB related changes.

Regards,

Tony


Tony Lindgren (2):
  phy: twl4030-usb: Relase usb phy on unload
  phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload

 drivers/phy/phy-twl4030-usb.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

-- 
2.6.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] phy: twl4030-usb: Relase usb phy on unload
@ 2015-12-01  5:39   ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2015-12-01  5:39 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-kernel, linux-usb, linux-omap, Bin Liu, Felipe Balbi, NeilBrown

Otherwise rmmod omap2430; rmmod phy-twl4030-usb; modprobe omap2430
will try to use a non-existing phy and oops:

Unable to handle kernel paging request at virtual address b6f7c1f0
...
[<c048a284>] (devm_usb_get_phy_by_node) from [<bf0758ac>]
(omap2430_musb_init+0x44/0x2b4 [omap2430])
[<bf0758ac>] (omap2430_musb_init [omap2430]) from [<bf055ec0>]
(musb_init_controller+0x194/0x878 [musb_hdrc])

Cc: Bin Liu <b-liu@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: NeilBrown <neil@brown.name>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/phy/phy-twl4030-usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 3a707dd..79870c4 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -750,6 +750,7 @@ static int twl4030_usb_remove(struct platform_device *pdev)
 	struct twl4030_usb *twl = platform_get_drvdata(pdev);
 	int val;
 
+	usb_remove_phy(&twl->phy);
 	pm_runtime_get_sync(twl->dev);
 	cancel_delayed_work(&twl->id_workaround_work);
 	device_remove_file(twl->dev, &dev_attr_vbus);
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 1/2] phy: twl4030-usb: Relase usb phy on unload
@ 2015-12-01  5:39   ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2015-12-01  5:39 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Bin Liu, Felipe Balbi,
	NeilBrown

Otherwise rmmod omap2430; rmmod phy-twl4030-usb; modprobe omap2430
will try to use a non-existing phy and oops:

Unable to handle kernel paging request at virtual address b6f7c1f0
...
[<c048a284>] (devm_usb_get_phy_by_node) from [<bf0758ac>]
(omap2430_musb_init+0x44/0x2b4 [omap2430])
[<bf0758ac>] (omap2430_musb_init [omap2430]) from [<bf055ec0>]
(musb_init_controller+0x194/0x878 [musb_hdrc])

Cc: Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>
Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Cc: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
Cc: NeilBrown <neil-+NVA1uvv1dVBDLzU/O5InQ@public.gmane.org>
Signed-off-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
---
 drivers/phy/phy-twl4030-usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 3a707dd..79870c4 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -750,6 +750,7 @@ static int twl4030_usb_remove(struct platform_device *pdev)
 	struct twl4030_usb *twl = platform_get_drvdata(pdev);
 	int val;
 
+	usb_remove_phy(&twl->phy);
 	pm_runtime_get_sync(twl->dev);
 	cancel_delayed_work(&twl->id_workaround_work);
 	device_remove_file(twl->dev, &dev_attr_vbus);
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload
  2015-12-01  5:39 [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module Tony Lindgren
  2015-12-01  5:39   ` Tony Lindgren
@ 2015-12-01  5:39 ` Tony Lindgren
  2016-02-08 19:51 ` [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module Tony Lindgren
  2 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2015-12-01  5:39 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-kernel, linux-usb, linux-omap, Bin Liu, Felipe Balbi, NeilBrown

If we reload phy-twl4030-usb, we get a warning about unbalanced
pm_runtime_enable. Let's fix the issue and also fix idling of the
device on unload before we attempt to shut it down.

If we don't properly idle the PHY before shutting it down on removal,
the twl4030 ends up consuming about 62mW of extra power compared to
running idle with the module loaded.

Cc: Bin Liu <b-liu@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: NeilBrown <neil@brown.name>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/phy/phy-twl4030-usb.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 79870c4..f96065a 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -715,6 +715,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 	pm_runtime_use_autosuspend(&pdev->dev);
 	pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
 	pm_runtime_enable(&pdev->dev);
+	pm_runtime_get_sync(&pdev->dev);
 
 	/* Our job is to use irqs and status from the power module
 	 * to keep the transceiver disabled when nothing's connected.
@@ -758,6 +759,13 @@ static int twl4030_usb_remove(struct platform_device *pdev)
 	/* set transceiver mode to power on defaults */
 	twl4030_usb_set_mode(twl, -1);
 
+	/* idle ulpi before powering off */
+	if (cable_present(twl->linkstat))
+		pm_runtime_put_noidle(twl->dev);
+	pm_runtime_mark_last_busy(twl->dev);
+	pm_runtime_put_sync_suspend(twl->dev);
+	pm_runtime_disable(twl->dev);
+
 	/* autogate 60MHz ULPI clock,
 	 * clear dpll clock request for i2c access,
 	 * disable 32KHz
@@ -772,11 +780,6 @@ static int twl4030_usb_remove(struct platform_device *pdev)
 	/* disable complete OTG block */
 	twl4030_usb_clear_bits(twl, POWER_CTRL, POWER_CTRL_OTG_ENAB);
 
-	if (cable_present(twl->linkstat))
-		pm_runtime_put_noidle(twl->dev);
-	pm_runtime_mark_last_busy(twl->dev);
-	pm_runtime_put(twl->dev);
-
 	return 0;
 }
 
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module
  2015-12-01  5:39 [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module Tony Lindgren
  2015-12-01  5:39   ` Tony Lindgren
  2015-12-01  5:39 ` [PATCH 2/2] phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload Tony Lindgren
@ 2016-02-08 19:51 ` Tony Lindgren
  2016-02-09  5:11     ` Kishon Vijay Abraham I
  2 siblings, 1 reply; 9+ messages in thread
From: Tony Lindgren @ 2016-02-08 19:51 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: linux-kernel, linux-usb, linux-omap, Pavel Machek

Hi Kishon,

* Tony Lindgren <tony@atomide.com> [151130 21:40]:
> Hi,
> 
> Here are two fixes for rmmod and PM. These can be merged separately after
> the review from the MUSB related changes.

Looks like these two fixes never got merged. Care to merge
these for v4.5-rc cycle with Cc stable v4.4?

Without these omap3 PM is blocked as the USB modules can
never be unloaded.

I can also merge these via the ARM SoC tree if you ack and have
no other fixes for the -rc cycle.

Regards,

Tony

> Tony Lindgren (2):
>   phy: twl4030-usb: Relase usb phy on unload
>   phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload
> 
>  drivers/phy/phy-twl4030-usb.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> -- 
> 2.6.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module
  2016-02-08 19:51 ` [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module Tony Lindgren
@ 2016-02-09  5:11     ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 9+ messages in thread
From: Kishon Vijay Abraham I @ 2016-02-09  5:11 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-kernel, linux-usb, linux-omap, Pavel Machek

Hi Tony,

On Tuesday 09 February 2016 01:21 AM, Tony Lindgren wrote:
> Hi Kishon,
> 
> * Tony Lindgren <tony@atomide.com> [151130 21:40]:
>> Hi,
>>
>> Here are two fixes for rmmod and PM. These can be merged separately after
>> the review from the MUSB related changes.
> 
> Looks like these two fixes never got merged. Care to merge
> these for v4.5-rc cycle with Cc stable v4.4?
> 
> Without these omap3 PM is blocked as the USB modules can
> never be unloaded.
> 
> I can also merge these via the ARM SoC tree if you ack and have
> no other fixes for the -rc cycle.

merged this to linux-phy now. I have a couple of other fixes for this -rc
cycle. Will send this along with the other fixes.

Thanks
Kishon

> 
> Regards,
> 
> Tony
> 
>> Tony Lindgren (2):
>>   phy: twl4030-usb: Relase usb phy on unload
>>   phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload
>>
>>  drivers/phy/phy-twl4030-usb.c | 14 +++++++++-----
>>  1 file changed, 9 insertions(+), 5 deletions(-)
>>
>> -- 
>> 2.6.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module
@ 2016-02-09  5:11     ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 9+ messages in thread
From: Kishon Vijay Abraham I @ 2016-02-09  5:11 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-kernel, linux-usb, linux-omap, Pavel Machek

Hi Tony,

On Tuesday 09 February 2016 01:21 AM, Tony Lindgren wrote:
> Hi Kishon,
> 
> * Tony Lindgren <tony@atomide.com> [151130 21:40]:
>> Hi,
>>
>> Here are two fixes for rmmod and PM. These can be merged separately after
>> the review from the MUSB related changes.
> 
> Looks like these two fixes never got merged. Care to merge
> these for v4.5-rc cycle with Cc stable v4.4?
> 
> Without these omap3 PM is blocked as the USB modules can
> never be unloaded.
> 
> I can also merge these via the ARM SoC tree if you ack and have
> no other fixes for the -rc cycle.

merged this to linux-phy now. I have a couple of other fixes for this -rc
cycle. Will send this along with the other fixes.

Thanks
Kishon

> 
> Regards,
> 
> Tony
> 
>> Tony Lindgren (2):
>>   phy: twl4030-usb: Relase usb phy on unload
>>   phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload
>>
>>  drivers/phy/phy-twl4030-usb.c | 14 +++++++++-----
>>  1 file changed, 9 insertions(+), 5 deletions(-)
>>
>> -- 
>> 2.6.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module
@ 2016-02-09 15:46       ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2016-02-09 15:46 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: linux-kernel, linux-usb, linux-omap, Pavel Machek

* Kishon Vijay Abraham I <kishon@ti.com> [160208 21:13]:
> Hi Tony,
> 
> On Tuesday 09 February 2016 01:21 AM, Tony Lindgren wrote:
> > Hi Kishon,
> > 
> > * Tony Lindgren <tony@atomide.com> [151130 21:40]:
> >> Hi,
> >>
> >> Here are two fixes for rmmod and PM. These can be merged separately after
> >> the review from the MUSB related changes.
> > 
> > Looks like these two fixes never got merged. Care to merge
> > these for v4.5-rc cycle with Cc stable v4.4?
> > 
> > Without these omap3 PM is blocked as the USB modules can
> > never be unloaded.
> > 
> > I can also merge these via the ARM SoC tree if you ack and have
> > no other fixes for the -rc cycle.
> 
> merged this to linux-phy now. I have a couple of other fixes for this -rc
> cycle. Will send this along with the other fixes.

OK thanks!

Regards,

Tony

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module
@ 2016-02-09 15:46       ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2016-02-09 15:46 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Pavel Machek

* Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org> [160208 21:13]:
> Hi Tony,
> 
> On Tuesday 09 February 2016 01:21 AM, Tony Lindgren wrote:
> > Hi Kishon,
> > 
> > * Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> [151130 21:40]:
> >> Hi,
> >>
> >> Here are two fixes for rmmod and PM. These can be merged separately after
> >> the review from the MUSB related changes.
> > 
> > Looks like these two fixes never got merged. Care to merge
> > these for v4.5-rc cycle with Cc stable v4.4?
> > 
> > Without these omap3 PM is blocked as the USB modules can
> > never be unloaded.
> > 
> > I can also merge these via the ARM SoC tree if you ack and have
> > no other fixes for the -rc cycle.
> 
> merged this to linux-phy now. I have a couple of other fixes for this -rc
> cycle. Will send this along with the other fixes.

OK thanks!

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-09 15:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01  5:39 [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module Tony Lindgren
2015-12-01  5:39 ` [PATCH 1/2] phy: twl4030-usb: Relase usb phy on unload Tony Lindgren
2015-12-01  5:39   ` Tony Lindgren
2015-12-01  5:39 ` [PATCH 2/2] phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload Tony Lindgren
2016-02-08 19:51 ` [PATCH 0/2] Two phy-twl4030-usb fixes for unloading the module Tony Lindgren
2016-02-09  5:11   ` Kishon Vijay Abraham I
2016-02-09  5:11     ` Kishon Vijay Abraham I
2016-02-09 15:46     ` Tony Lindgren
2016-02-09 15:46       ` Tony Lindgren

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.