linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] phy: for 4.9 -rc
@ 2016-11-05 13:43 Kishon Vijay Abraham I
  2016-11-05 13:43 ` [PATCH 1/4] phy: Add reset callback for not generic phy Kishon Vijay Abraham I
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-11-05 13:43 UTC (permalink / raw)
  To: gregkh; +Cc: kishon, linux-kernel

Hi Greg,

Please find the pull request for the phy fixes below. It includes a fix
in phy core to add a static inline function when CONFIG_GENERIC_PHY
is not selected and 3 fixes in different phy drivers. The phy device name
in the phy lookup table used for non-dt boot is fixed for da8xx-usb phy,
NULL pointer dereferencing error is fixed for sun4i phy and an incorrect
programming sequence w.r.t deassert of phy_rst in phy-rockchip-pcie is also
fixed.

Consider merging it in this -rc cyle and let me know if you want me to
change something.

Cheers
Kishon

The following changes since commit 1001354ca34179f3db924eb66672442a173147dc:

  Linux 4.9-rc1 (2016-10-15 12:17:50 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git tags/phy-for-4.9-rc

for you to fetch changes up to 4320f9d4c1831fd4d244a9de8f81bc27ea67699c:

  phy: sun4i: check PMU presence when poking unknown bit of pmu (2016-11-05 13:45:02 +0530)

----------------------------------------------------------------
phy: for 4.9 -rc

phy fixes:
*) Add a empty function for phy_reset when CONFIG_GENERIC_PHY is not set
*) change the phy lookup table for da8xx-usb to match it with the name
   present in the board configuraion file (used for non-dt boot)
*) Fix incorrect programming sequence in w.r.t deassert of phy_rst
   in phy-rockchip-pcie
*) Fix to avoid NULL pointer dereferencing error in sun4i phy

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

----------------------------------------------------------------
Axel Haslam (1):
      phy: da8xx-usb: rename the ohci device to ohci-da8xx

Icenowy Zheng (1):
      phy: sun4i: check PMU presence when poking unknown bit of pmu

Randy Li (1):
      phy: Add reset callback for not generic phy

Shawn Lin (1):
      phy-rockchip-pcie: remove deassert of phy_rst from exit callback

 drivers/phy/phy-da8xx-usb.c     |    5 +++--
 drivers/phy/phy-rockchip-pcie.c |   13 +------------
 drivers/phy/phy-sun4i-usb.c     |    2 +-
 include/linux/phy/phy.h         |    7 +++++++
 4 files changed, 12 insertions(+), 15 deletions(-)
-- 
1.7.9.5

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

* [PATCH 1/4] phy: Add reset callback for not generic phy
  2016-11-05 13:43 [GIT PULL] phy: for 4.9 -rc Kishon Vijay Abraham I
@ 2016-11-05 13:43 ` Kishon Vijay Abraham I
  2016-11-05 13:43 ` [PATCH 2/4] phy: da8xx-usb: rename the ohci device to ohci-da8xx Kishon Vijay Abraham I
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-11-05 13:43 UTC (permalink / raw)
  To: gregkh; +Cc: kishon, linux-kernel

From: Randy Li <ayaka@soulik.info>

Add a dummy function for phy_reset in case the CONFIG_GENERIC_PHY
is disabled.

Signed-off-by: Randy Li <ayaka@soulik.info>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 include/linux/phy/phy.h |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index ee1bed7..78bb0d7 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -253,6 +253,13 @@ static inline int phy_set_mode(struct phy *phy, enum phy_mode mode)
 	return -ENOSYS;
 }
 
+static inline int phy_reset(struct phy *phy)
+{
+	if (!phy)
+		return 0;
+	return -ENOSYS;
+}
+
 static inline int phy_get_bus_width(struct phy *phy)
 {
 	return -ENOSYS;
-- 
1.7.9.5

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

* [PATCH 2/4] phy: da8xx-usb: rename the ohci device to ohci-da8xx
  2016-11-05 13:43 [GIT PULL] phy: for 4.9 -rc Kishon Vijay Abraham I
  2016-11-05 13:43 ` [PATCH 1/4] phy: Add reset callback for not generic phy Kishon Vijay Abraham I
@ 2016-11-05 13:43 ` Kishon Vijay Abraham I
  2016-11-05 13:43 ` [PATCH 3/4] phy-rockchip-pcie: remove deassert of phy_rst from exit callback Kishon Vijay Abraham I
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-11-05 13:43 UTC (permalink / raw)
  To: gregkh; +Cc: kishon, linux-kernel

From: Axel Haslam <ahaslam@baylibre.com>

The ohci device name has changed in the board configuraion files,
hence, change the phy lookup table to match the new name.

Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/phy/phy-da8xx-usb.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/phy-da8xx-usb.c b/drivers/phy/phy-da8xx-usb.c
index 32ae78c..c85fb0b 100644
--- a/drivers/phy/phy-da8xx-usb.c
+++ b/drivers/phy/phy-da8xx-usb.c
@@ -198,7 +198,8 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
 	} else {
 		int ret;
 
-		ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0");
+		ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy",
+					"ohci-da8xx");
 		if (ret)
 			dev_warn(dev, "Failed to create usb11 phy lookup\n");
 		ret = phy_create_lookup(d_phy->usb20_phy, "usb-phy",
@@ -216,7 +217,7 @@ static int da8xx_usb_phy_remove(struct platform_device *pdev)
 
 	if (!pdev->dev.of_node) {
 		phy_remove_lookup(d_phy->usb20_phy, "usb-phy", "musb-da8xx");
-		phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0");
+		phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci-da8xx");
 	}
 
 	return 0;
-- 
1.7.9.5

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

* [PATCH 3/4] phy-rockchip-pcie: remove deassert of phy_rst from exit callback
  2016-11-05 13:43 [GIT PULL] phy: for 4.9 -rc Kishon Vijay Abraham I
  2016-11-05 13:43 ` [PATCH 1/4] phy: Add reset callback for not generic phy Kishon Vijay Abraham I
  2016-11-05 13:43 ` [PATCH 2/4] phy: da8xx-usb: rename the ohci device to ohci-da8xx Kishon Vijay Abraham I
@ 2016-11-05 13:43 ` Kishon Vijay Abraham I
  2016-11-05 13:43 ` [PATCH 4/4] phy: sun4i: check PMU presence when poking unknown bit of pmu Kishon Vijay Abraham I
  2016-11-07  8:56 ` [GIT PULL] phy: for 4.9 -rc Greg KH
  4 siblings, 0 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-11-05 13:43 UTC (permalink / raw)
  To: gregkh; +Cc: kishon, linux-kernel

From: Shawn Lin <shawn.lin@rock-chips.com>

The deassert of phy_rst from exit callback is incorrect as when
doing phy_exit, we expect the phy_rst is on asserted state which was
done by power_off callback, but not deasserted state. Meanwhile when
disabling clk_pciephy_ref, the assert/deassert signal can't actually
take effect on the phy. So let's fix it anyway.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/phy/phy-rockchip-pcie.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/phy/phy-rockchip-pcie.c b/drivers/phy/phy-rockchip-pcie.c
index a2b4c6b..6904633 100644
--- a/drivers/phy/phy-rockchip-pcie.c
+++ b/drivers/phy/phy-rockchip-pcie.c
@@ -249,21 +249,10 @@ static int rockchip_pcie_phy_init(struct phy *phy)
 static int rockchip_pcie_phy_exit(struct phy *phy)
 {
 	struct rockchip_pcie_phy *rk_phy = phy_get_drvdata(phy);
-	int err = 0;
 
 	clk_disable_unprepare(rk_phy->clk_pciephy_ref);
 
-	err = reset_control_deassert(rk_phy->phy_rst);
-	if (err) {
-		dev_err(&phy->dev, "deassert phy_rst err %d\n", err);
-		goto err_reset;
-	}
-
-	return err;
-
-err_reset:
-	clk_prepare_enable(rk_phy->clk_pciephy_ref);
-	return err;
+	return 0;
 }
 
 static const struct phy_ops ops = {
-- 
1.7.9.5

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

* [PATCH 4/4] phy: sun4i: check PMU presence when poking unknown bit of pmu
  2016-11-05 13:43 [GIT PULL] phy: for 4.9 -rc Kishon Vijay Abraham I
                   ` (2 preceding siblings ...)
  2016-11-05 13:43 ` [PATCH 3/4] phy-rockchip-pcie: remove deassert of phy_rst from exit callback Kishon Vijay Abraham I
@ 2016-11-05 13:43 ` Kishon Vijay Abraham I
  2016-11-07  8:56 ` [GIT PULL] phy: for 4.9 -rc Greg KH
  4 siblings, 0 replies; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2016-11-05 13:43 UTC (permalink / raw)
  To: gregkh; +Cc: kishon, linux-kernel

From: Icenowy Zheng <icenowy@aosc.xyz>

Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
The code that poke some unknown bit of PMU for H3/A64 didn't check
the PHY, and will cause kernel oops when PHY 0 is used.

This patch will check whether the pmu is not NULL before poking.

Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/phy/phy-sun4i-usb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index b9342a2..fec34f5 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -264,7 +264,7 @@ static int sun4i_usb_phy_init(struct phy *_phy)
 		return ret;
 	}
 
-	if (data->cfg->enable_pmu_unk1) {
+	if (phy->pmu && data->cfg->enable_pmu_unk1) {
 		val = readl(phy->pmu + REG_PMU_UNK1);
 		writel(val & ~2, phy->pmu + REG_PMU_UNK1);
 	}
-- 
1.7.9.5

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

* Re: [GIT PULL] phy: for 4.9 -rc
  2016-11-05 13:43 [GIT PULL] phy: for 4.9 -rc Kishon Vijay Abraham I
                   ` (3 preceding siblings ...)
  2016-11-05 13:43 ` [PATCH 4/4] phy: sun4i: check PMU presence when poking unknown bit of pmu Kishon Vijay Abraham I
@ 2016-11-07  8:56 ` Greg KH
  4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2016-11-07  8:56 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: linux-kernel

On Sat, Nov 05, 2016 at 07:13:22PM +0530, Kishon Vijay Abraham I wrote:
> Hi Greg,
> 
> Please find the pull request for the phy fixes below. It includes a fix
> in phy core to add a static inline function when CONFIG_GENERIC_PHY
> is not selected and 3 fixes in different phy drivers. The phy device name
> in the phy lookup table used for non-dt boot is fixed for da8xx-usb phy,
> NULL pointer dereferencing error is fixed for sun4i phy and an incorrect
> programming sequence w.r.t deassert of phy_rst in phy-rockchip-pcie is also
> fixed.
> 
> Consider merging it in this -rc cyle and let me know if you want me to
> change something.

Pulled and pushed out, thanks.

greg k-h

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

end of thread, other threads:[~2016-11-07  8:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-05 13:43 [GIT PULL] phy: for 4.9 -rc Kishon Vijay Abraham I
2016-11-05 13:43 ` [PATCH 1/4] phy: Add reset callback for not generic phy Kishon Vijay Abraham I
2016-11-05 13:43 ` [PATCH 2/4] phy: da8xx-usb: rename the ohci device to ohci-da8xx Kishon Vijay Abraham I
2016-11-05 13:43 ` [PATCH 3/4] phy-rockchip-pcie: remove deassert of phy_rst from exit callback Kishon Vijay Abraham I
2016-11-05 13:43 ` [PATCH 4/4] phy: sun4i: check PMU presence when poking unknown bit of pmu Kishon Vijay Abraham I
2016-11-07  8:56 ` [GIT PULL] phy: for 4.9 -rc 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).