* [GIT PULL] phy: for-4.5 -rc cycle
@ 2016-02-10 6:45 Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 1/4] phy: Restrict phy-hi6220-usb to HiSilicon arm64 Kishon Vijay Abraham I
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-02-10 6:45 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel
Hi Greg,
Please find the pull request for this -rc cycle below. It contains a fix in
phy core, twl4030-usb phy driver and a fix in Kconfig.
Consider merging it to this -rc cycle. Let me know if you want me to change
anything.
Cheers
Kishon
The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d:
Linux 4.5-rc1 (2016-01-24 13:06:47 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git tags/phy-for-4.5-rc
for you to fetch changes up to 58a66dba1beac2121d931cda4682ae4d40816af5:
phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload (2016-02-10 11:46:01 +0530)
----------------------------------------------------------------
phy: for 4.5-rc
*) Fix error handling code in phy core [phy_power_on()]
*) phy-twl4030-usb fixes for unloading the module
*) Restrict phy-hi6220-usb to HiSilicon arm64
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
----------------------------------------------------------------
Geert Uytterhoeven (1):
phy: Restrict phy-hi6220-usb to HiSilicon arm64
Shawn Lin (1):
phy: core: fix wrong err handle for phy_power_on
Tony Lindgren (2):
phy: twl4030-usb: Relase usb phy on unload
phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload
drivers/phy/Kconfig | 1 +
drivers/phy/phy-core.c | 16 +++++++++-------
drivers/phy/phy-twl4030-usb.c | 14 +++++++++-----
3 files changed, 19 insertions(+), 12 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] phy: Restrict phy-hi6220-usb to HiSilicon arm64
2016-02-10 6:45 [GIT PULL] phy: for-4.5 -rc cycle Kishon Vijay Abraham I
@ 2016-02-10 6:45 ` Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 2/4] phy: core: fix wrong err handle for phy_power_on Kishon Vijay Abraham I
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-02-10 6:45 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel
From: Geert Uytterhoeven <geert@linux-m68k.org>
The HiSilicon Hi6220 USB PHY is available in HiSilicon Hi6220 SoCs only.
Restrict it to HiSilicon arm64, unless compile-testing.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index e7e117d..0124d17 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -224,6 +224,7 @@ config PHY_MT65XX_USB3
config PHY_HI6220_USB
tristate "hi6220 USB PHY support"
+ depends on (ARCH_HISI && ARM64) || COMPILE_TEST
select GENERIC_PHY
select MFD_SYSCON
help
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] phy: core: fix wrong err handle for phy_power_on
2016-02-10 6:45 [GIT PULL] phy: for-4.5 -rc cycle Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 1/4] phy: Restrict phy-hi6220-usb to HiSilicon arm64 Kishon Vijay Abraham I
@ 2016-02-10 6:45 ` Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 3/4] phy: twl4030-usb: Relase usb phy on unload Kishon Vijay Abraham I
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-02-10 6:45 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel
From: Shawn Lin <shawn.lin@rock-chips.com>
If phy_pm_runtime_get_sync failed but we already
enable regulator, current code return directly without
doing regulator_disable. This patch fix this problem
and cleanup err handle of phy_power_on to be more readable.
Fixes: 3be88125d85d ("phy: core: Support regulator ...")
Cc: <stable@vger.kernel.org> # v3.18+
Cc: Roger Quadros <rogerq@ti.com>
Cc: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-core.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 8c7f27d..e7e574d 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -275,20 +275,21 @@ EXPORT_SYMBOL_GPL(phy_exit);
int phy_power_on(struct phy *phy)
{
- int ret;
+ int ret = 0;
if (!phy)
- return 0;
+ goto out;
if (phy->pwr) {
ret = regulator_enable(phy->pwr);
if (ret)
- return ret;
+ goto out;
}
ret = phy_pm_runtime_get_sync(phy);
if (ret < 0 && ret != -ENOTSUPP)
- return ret;
+ goto err_pm_sync;
+
ret = 0; /* Override possible ret == -ENOTSUPP */
mutex_lock(&phy->mutex);
@@ -296,19 +297,20 @@ int phy_power_on(struct phy *phy)
ret = phy->ops->power_on(phy);
if (ret < 0) {
dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
- goto out;
+ goto err_pwr_on;
}
}
++phy->power_count;
mutex_unlock(&phy->mutex);
return 0;
-out:
+err_pwr_on:
mutex_unlock(&phy->mutex);
phy_pm_runtime_put_sync(phy);
+err_pm_sync:
if (phy->pwr)
regulator_disable(phy->pwr);
-
+out:
return ret;
}
EXPORT_SYMBOL_GPL(phy_power_on);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] phy: twl4030-usb: Relase usb phy on unload
2016-02-10 6:45 [GIT PULL] phy: for-4.5 -rc cycle Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 1/4] phy: Restrict phy-hi6220-usb to HiSilicon arm64 Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 2/4] phy: core: fix wrong err handle for phy_power_on Kishon Vijay Abraham I
@ 2016-02-10 6:45 ` Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 4/4] phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload Kishon Vijay Abraham I
2016-02-12 4:12 ` [GIT PULL] phy: for-4.5 -rc cycle Greg KH
4 siblings, 0 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-02-10 6:45 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel
From: Tony Lindgren <tony@atomide.com>
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: stable@vger.kernel.org
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>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.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 4a3fc6e..fe5538f 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);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload
2016-02-10 6:45 [GIT PULL] phy: for-4.5 -rc cycle Kishon Vijay Abraham I
` (2 preceding siblings ...)
2016-02-10 6:45 ` [PATCH 3/4] phy: twl4030-usb: Relase usb phy on unload Kishon Vijay Abraham I
@ 2016-02-10 6:45 ` Kishon Vijay Abraham I
2016-02-12 4:12 ` [GIT PULL] phy: for-4.5 -rc cycle Greg KH
4 siblings, 0 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-02-10 6:45 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel
From: Tony Lindgren <tony@atomide.com>
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: stable@vger.kernel.org
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>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.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 fe5538f..840f3ea 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;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [GIT PULL] phy: for-4.5 -rc cycle
2016-02-10 6:45 [GIT PULL] phy: for-4.5 -rc cycle Kishon Vijay Abraham I
` (3 preceding siblings ...)
2016-02-10 6:45 ` [PATCH 4/4] phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload Kishon Vijay Abraham I
@ 2016-02-12 4:12 ` Greg KH
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2016-02-12 4:12 UTC (permalink / raw)
To: Kishon Vijay Abraham I; +Cc: linux-kernel
On Wed, Feb 10, 2016 at 12:15:04PM +0530, Kishon Vijay Abraham I wrote:
> Hi Greg,
>
> Please find the pull request for this -rc cycle below. It contains a fix in
> phy core, twl4030-usb phy driver and a fix in Kconfig.
>
> Consider merging it to this -rc cycle. Let me know if you want me to change
> anything.
>
> Cheers
> Kishon
>
> The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d:
>
> Linux 4.5-rc1 (2016-01-24 13:06:47 -0800)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git tags/phy-for-4.5-rc
Pulled and pushed out, thanks.
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-02-12 4:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-10 6:45 [GIT PULL] phy: for-4.5 -rc cycle Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 1/4] phy: Restrict phy-hi6220-usb to HiSilicon arm64 Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 2/4] phy: core: fix wrong err handle for phy_power_on Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 3/4] phy: twl4030-usb: Relase usb phy on unload Kishon Vijay Abraham I
2016-02-10 6:45 ` [PATCH 4/4] phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload Kishon Vijay Abraham I
2016-02-12 4:12 ` [GIT PULL] phy: for-4.5 -rc cycle Greg KH
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).