PHY: for 3.14
Hi Greg,
here's the patches for 3.14. It contains few fixes on phy-core and added a new PHY driver used by SATA in Marvell SoCs.
Let me know if you need any changes.
Thanks
Kishon
The following changes since commit 413541dd66d51f791a0b169d9b9014e4f56be13c:
Linux 3.13-rc5 (2013-12-22 13:08:32 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git tags/for_3.14
for you to fetch changes up to e3eae85773ebd2165d19ca8661cca3b9c60b2ba1:
Phy: Add a PHY driver for Marvell MVEBU SATA PHY. (2013-12-24 23:52:58 +0530)
----------------------------------------------------------------
Pull request for PHY subsystem contains few fixes in PHY-CORE mostly w.r.t PM and reference counting and also a new PHY driver used by SATA in Marvell SoC.
----------------------------------------------------------------
Andrew Lunn (1):
Phy: Add a PHY driver for Marvell MVEBU SATA PHY.
Felipe Balbi (1):
phy: core: properly handle failure of pm_runtime_get functions
Kishon Vijay Abraham I (2):
phy: phy-core: increment refcounting variables only on 'success'
phy: phy-core.c: remove unnecessary initialization of local variables
drivers/phy/Kconfig | 6 ++++++ drivers/phy/Makefile | 1 + drivers/phy/phy-core.c | 44 +++++++++++++++++++++++++++++------------- drivers/phy/phy-mvebu-sata.c | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 13 deletions(-) create mode 100644 drivers/phy/phy-mvebu-sata.c
Signature · 1 line
1.7.10.4
PATCH 1/4 phy: core: properly handle failure of pm_runtime_get functions
From: Felipe Balbi <[email protected]>
In case pm_runtime_get*() fails, it still increments pm usage counter, so we *must* make sure to pm_runtime_put() even in those cases.
This patch fixes that mistake the same way usbcore treats those possible failures.
--- drivers/phy/phy-core.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/phy/phy-core.c +14 -2
@@ -94,19 +94,31 @@ static struct phy_provider *of_phy_provider_lookup(struct device_node *node)int phy_pm_runtime_get (struct phy *phy) { +int ret; +if (!pm_runtime_enabled (&phy->dev))return -ENOTSUPP ; -return pm_runtime_get (&phy->dev); + ret =pm_runtime_get (&phy->dev); +if (ret <0 && ret != -EINPROGRESS ) +pm_runtime_put_noidle (&phy->dev); + +return ret; }EXPORT_SYMBOL_GPL (phy_pm_runtime_get);int phy_pm_runtime_get_sync (struct phy *phy) { +int ret; +if (!pm_runtime_enabled (&phy->dev))return -ENOTSUPP ; -return pm_runtime_get_sync (&phy->dev); + ret =pm_runtime_get_sync (&phy->dev); +if (ret <0 ) +pm_runtime_put_sync (&phy->dev); + +return ret; }EXPORT_SYMBOL_GPL (phy_pm_runtime_get_sync);
Signature · 1 line
1.7.10.4
PATCH 2/4 phy: phy-core: increment refcounting variables only on 'success'
In reply to Kishon Vijay Abraham IIncrement 'init_count' only if the 'init' callback succeeded and decrement 'init_count' only if the 'exit' callback succeded. Increment 'power_count' only if 'power_on' callback succeded and if it failed disable the clocks using phy_pm_runtime_put_sync(). Also decrement 'power_count' only if 'power_off' callback succeded and if it failed do not disable the clocks.
--- drivers/phy/phy-core.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/phy/phy-core.c +14 -8
@@ -167,13 +167,14 @@ int phy_init(struct phy *phy)return ret;mutex_lock (&phy->mutex); -if (phy->init_count++ ==0 && phy->ops->init) { +if (phy->init_count ==0 && phy->ops->init) { ret = phy->ops->init (phy);if (ret <0 ) {dev_err (&phy->dev,"phy init failed --> %d\n" , ret); goto out; } } + ++phy->init_count; out:mutex_unlock (&phy->mutex);
@@ -191,13 +192,14 @@ int phy_exit(struct phy *phy)return ret;mutex_lock (&phy->mutex); -if (--phy->init_count ==0 && phy->ops->exit) { +if (phy->init_count ==1 && phy->ops->exit) { ret = phy->ops->exit (phy);if (ret <0 ) {dev_err (&phy->dev,"phy exit failed --> %d\n" , ret); goto out; } } + --phy->init_count; out:mutex_unlock (&phy->mutex);
@@ -215,16 +217,20 @@ int phy_power_on(struct phy *phy)return ret;mutex_lock (&phy->mutex); -if (phy->power_count++ ==0 && phy->ops->power_on) { +if (phy->power_count ==0 && phy->ops->power_on) { ret = phy->ops->power_on (phy);if (ret <0 ) {dev_err (&phy->dev,"phy poweron failed --> %d\n" , ret); goto out; } } + ++phy->power_count; +mutex_unlock (&phy->mutex); +return 0 ; out:mutex_unlock (&phy->mutex); +phy_pm_runtime_put_sync (phy);return ret; }
@@ -235,19 +241,19 @@ int phy_power_off(struct phy *phy)int ret = -ENOTSUPP ;mutex_lock (&phy->mutex); -if (--phy->power_count ==0 && phy->ops->power_off) { +if (phy->power_count ==1 && phy->ops->power_off) { ret = phy->ops->power_off (phy);if (ret <0 ) {dev_err (&phy->dev,"phy poweroff failed --> %d\n" , ret); - goto out; +mutex_unlock (&phy->mutex); +return ret; } } - -out: + --phy->power_count;mutex_unlock (&phy->mutex);phy_pm_runtime_put (phy); -return ret; +return 0 ; }EXPORT_SYMBOL_GPL (phy_power_off);
Signature · 1 line
1.7.10.4
PATCH 3/4 phy: phy-core.c: remove unnecessary initialization of local variables
In reply to Kishon Vijay Abraham IThere were a few places where variables are initialized unncessarily. Remove those initializations.
--- drivers/phy/phy-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/phy/phy-core.c +3 -3
@@ -210,7 +210,7 @@ EXPORT_SYMBOL_GPL(phy_exit);int phy_power_on (struct phy *phy) { -int ret = -ENOTSUPP ; +int ret; ret =phy_pm_runtime_get_sync (phy);if (ret <0 && ret != -ENOTSUPP )
@@ -238,7 +238,7 @@ EXPORT_SYMBOL_GPL(phy_power_on);int phy_power_off (struct phy *phy) { -int ret = -ENOTSUPP ; +int ret;mutex_lock (&phy->mutex);if (phy->power_count ==1 && phy->ops->power_off) {
@@ -378,7 +378,7 @@ EXPORT_SYMBOL_GPL(of_phy_simple_xlate);struct phy *phy_get (struct device *dev,const char *string) {int index =0 ; -struct phy *phy =NULL ; +struct phy *phy;if (string ==NULL ) {dev_WARN (dev,"missing string\n" );
Signature · 1 line
1.7.10.4
PATCH 4/4 Phy: Add a PHY driver for Marvell MVEBU SATA PHY.
In reply to Kishon Vijay Abraham IFrom: Andrew Lunn <[email protected]>
Kirkwood and Dove can turn the SATA phy on and off. Add a PHY driver to control this.
--- drivers/phy/Kconfig | 6 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-mvebu-sata.c | 137 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 drivers/phy/phy-mvebu-sata.c
drivers/phy/Kconfig +6 -0
@@ -21,6 +21,12 @@ config PHY_EXYNOS_MIPI_VIDEO Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung S5P and EXYNOS SoCs. +config PHY_MVEBU_SATA + def_bool y + depends on ARCH_KIRKWOOD || ARCH_DOVE + depends on OF + select GENERIC_PHY + config OMAP_USB2 tristate "OMAP USB2 PHY Driver" depends on ARCH_OMAP2PLUS
drivers/phy/Makefile +1 -0
@@ -5,5 +5,6 @@ obj-$(CONFIG_GENERIC_PHY) += phy-core.o obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO) += phy-exynos-dp-video.o obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o +obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o obj-$(CONFIG_TWL4030_USB) += phy-twl4030-usb.o
drivers/phy/phy-mvebu-sata.c new file +137 -0
137 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Hi Greg,
Quoted 31 lines · Kishon Vijay Abraham I
Hi Greg,
here's the patches for 3.14. It contains few fixes on phy-core and added a new PHY driver used by SATA in Marvell SoCs.
Let me know if you need any changes.
Thanks
KishonThe following changes since commit
413541dd66d51f791a0b169d9b9014e4f56be13c:Linux 3.13-rc5 (2013-12-22 13:08:32 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.gittags/for_3.14for you to fetch changes up to
e3eae85773ebd2165d19ca8661cca3b9c60b2ba1:Phy: Add a PHY driver for Marvell MVEBU SATA PHY. (2013-12-24 23:52:58 +0530)
----------------------------------------------------------------
Pull request for PHY subsystem contains few fixes in PHY-CORE mostly w.r.t PM and reference counting and also a new PHY driver used by SATA in Marvell SoC.----------------------------------------------------------------
Andrew Lunn (1):
Phy: Add a PHY driver for Marvell MVEBU SATA PHY.
Quoted 6 lines
Felipe Balbi (1):
phy: core: properly handle failure ofpm_runtime_getfunctionsKishon Vijay Abraham I (2):
phy: phy-core: increment refcounting variables only on 'success'
phy:phy-core.c: remove unnecessary initialization of local variables\
Will you be taking these patches?
Thanks
Kishon
Quoted 8 lines
drivers/phy/Kconfig | 6 ++++++ drivers/phy/Makefile | 1 + drivers/phy/phy-core.c | 44 +++++++++++++++++++++++++++++------------- drivers/phy/phy-mvebu-sata.c | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 13 deletions(-) create mode 100644 drivers/phy/phy-mvebu-sata.c
Quoted 37 lines · Kishon Vijay Abraham I
Hi Greg,
Quoted 34 lines · Kishon Vijay Abraham I
Hi Greg,
here's the patches for 3.14. It contains few fixes on phy-core and added a new PHY driver used by SATA in Marvell SoCs.
Let me know if you need any changes.
Thanks
KishonThe following changes since commit
413541dd66d51f791a0b169d9b9014e4f56be13c:Linux 3.13-rc5 (2013-12-22 13:08:32 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.gittags/for_3.14for you to fetch changes up to
e3eae85773ebd2165d19ca8661cca3b9c60b2ba1:Phy: Add a PHY driver for Marvell MVEBU SATA PHY. (2013-12-24 23:52:58 +0530)
----------------------------------------------------------------
Pull request for PHY subsystem contains few fixes in PHY-CORE mostly w.r.t PM and reference counting and also a new PHY driver used by SATA in Marvell SoC.----------------------------------------------------------------
Andrew Lunn (1):
Phy: Add a PHY driver for Marvell MVEBU SATA PHY.Felipe Balbi (1):
phy: core: properly handle failure ofpm_runtime_getfunctions
Quoted 6 lines
Quoted 3 lines
Kishon Vijay Abraham I (2):
phy: phy-core: increment refcounting variables only on 'success'
phy:phy-core.c: remove unnecessary initialization of local variables\Will you be taking these patches?
Yes, sorry, catching up from my vacation backlog...
greg k-h
Quoted 38 lines · Greg KH
Quoted 37 lines · Kishon Vijay Abraham I
Hi Greg,
Quoted 34 lines · Kishon Vijay Abraham I
Hi Greg,
here's the patches for 3.14. It contains few fixes on phy-core and added a new PHY driver used by SATA in Marvell SoCs.
Let me know if you need any changes.
Thanks
KishonThe following changes since commit
413541dd66d51f791a0b169d9b9014e4f56be13c:Linux 3.13-rc5 (2013-12-22 13:08:32 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.gittags/for_3.14for you to fetch changes up to
e3eae85773ebd2165d19ca8661cca3b9c60b2ba1:Phy: Add a PHY driver for Marvell MVEBU SATA PHY. (2013-12-24 23:52:58 +0530)
----------------------------------------------------------------
Pull request for PHY subsystem contains few fixes in PHY-CORE mostly w.r.t PM and reference counting and also a new PHY driver used by SATA in Marvell SoC.----------------------------------------------------------------
Andrew Lunn (1):
Phy: Add a PHY driver for Marvell MVEBU SATA PHY.Felipe Balbi (1):
phy: core: properly handle failure ofpm_runtime_getfunctions
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Kishon Vijay Abraham I (2):
phy: phy-core: increment refcounting variables only on 'success'
phy:phy-core.c: remove unnecessary initialization of local variables\Will you be taking these patches?
Yes, sorry, catching up from my vacation backlog...
no problem, thanks.
-Kishon
Quoted 3 lines
greg k-h
Quoted 10 lines · Kishon Vijay Abraham I
Hi Greg,
here's the patches for 3.14. It contains few fixes on phy-core and added a new PHY driver used by SATA in Marvell SoCs.
Let me know if you need any changes.
Thanks
Kishon
Quoted 7 lines
The following changes since commit
413541dd66d51f791a0b169d9b9014e4f56be13c:Linux 3.13-rc5 (2013-12-22 13:08:32 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.gittags/for_3.14
Pulled and pushed out, sorry for the delay.
greg k-h