Skip to contentSkip to conversation

phy: for 4.9 -rc

GIT PULL New Kishon Vijay Abraham I 2 participants 6 messages Nov 5, 2016 – Nov 7, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

----------------------------------------------------------------
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(-)
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/4 phy-rockchip-pcie: remove deassert of phy_rst from exit callback

From: Shawn Lin <[email protected]>

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.

---
 drivers/phy/phy-rockchip-pcie.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/phy/phy-rockchip-pcie.c +1 -12
index a2b4c6b..6904633 100644
@@ -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 = {
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/4 phy: da8xx-usb: rename the ohci device to ohci-da8xx

In reply to Kishon Vijay Abraham I

From: Axel Haslam <[email protected]>

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

---
 drivers/phy/phy-da8xx-usb.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/phy/phy-da8xx-usb.c +3 -2
index 32ae78c..c85fb0b 100644
@@ -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;
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/4 phy: Add reset callback for not generic phy

In reply to Kishon Vijay Abraham I

From: Randy Li <[email protected]>

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

---
 include/linux/phy/phy.h |    7 +++++++
 1 file changed, 7 insertions(+)
include/linux/phy/phy.h +7 -0
index ee1bed7..78bb0d7 100644
@@ -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;
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 4/4 phy: sun4i: check PMU presence when poking unknown bit of pmu

In reply to Kishon Vijay Abraham I

From: Icenowy Zheng <[email protected]>

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)
---
 drivers/phy/phy-sun4i-usb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/phy-sun4i-usb.c +1 -1
index b9342a2..fec34f5 100644
@@ -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);
 	}
Signature · 1 line
1.7.9.5
#5 lore raw
In reply to Kishon Vijay Abraham I
Quoted 10 lines · Kishon Vijay Abraham I

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.

Quoted 2 lines

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