Skip to contentSkip to conversation

phy: for 4.7 -rc cycle

GIT PULL New Kishon Vijay Abraham I 2 participants 4 messages Jun 10, 2016 – Jun 11, 2016

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

Hi Greg,

Please find the pull request for this -rc cycle below. It consists of a couple of fixes in the phy drivers. Consider merging this in this -rc.

Let me know if you want me to change something.

Cheers
Kishon

The following changes since commit 1a695a905c18548062509178b98bc91e67510864:

Linux 4.7-rc1 (2016-05-29 09:29:24 -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.7-rc

for you to fetch changes up to 31b2a32f708bb33b3f35b03ce3d2cb31f7d1e684:

phy: ti-pipe3: Program the DPLL even if it was already locked (2016-06-03 12:06:41 +0530)

----------------------------------------------------------------
phy: for 4.7-rc

*) Fix compiler warning in exynos-mipi-video
*) Fix in ti-pipe3 PHY to program the DPLL
even if it was already locked

----------------------------------------------------------------
Arnd Bergmann (1):
phy: exynos-mipi-video: avoid uninitialized variable use

Roger Quadros (1):
phy: ti-pipe3: Program the DPLL even if it was already locked

 drivers/phy/phy-exynos-mipi-video.c |    6 +++++-
 drivers/phy/phy-ti-pipe3.c          |   15 +++++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 phy: ti-pipe3: Program the DPLL even if it was already locked

From: Roger Quadros <[email protected]>

If bootloader has set a wrong DPLL then we must trash those values and re-program it anyways. This fixes USB3 devices not being enumerated on beagle-x15 if usb was started in u-boot.

We don't re-program SATA DPLL if it is locked as it was causing SATA failures if device was hotpluged after boot.

---
 drivers/phy/phy-ti-pipe3.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/phy/phy-ti-pipe3.c +11 -4
index 0a477d2..bf46844 100644
@@ -293,11 +293,18 @@ static int ti_pipe3_init(struct phy *x)
 		ret = ti_pipe3_dpll_wait_lock(phy);
 	}
 
-	/* Program the DPLL only if not locked */
+	/* SATA has issues if re-programmed when locked */
 	val = ti_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS);
-	if (!(val & PLL_LOCK))
-		if (ti_pipe3_dpll_program(phy))
-			return -EINVAL;
+	if ((val & PLL_LOCK) && of_device_is_compatible(phy->dev->of_node,
+							"ti,phy-pipe3-sata"))
+		return ret;
+
+	/* Program the DPLL */
+	ret = ti_pipe3_dpll_program(phy);
+	if (ret) {
+		ti_pipe3_disable_clocks(phy);
+		return -EINVAL;
+	}
 
 	return ret;
 }
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 phy: exynos-mipi-video: avoid uninitialized variable use

In reply to Kishon Vijay Abraham I

From: Arnd Bergmann <[email protected]>

A rework of the exynos-mipi-video driver caused a warning about the new __set_phy_state function potentially accessing a variable before its initialization:

drivers/phy/phy-exynos-mipi-video.c: In function '__set_phy_state':
drivers/phy/phy-exynos-mipi-video.c:238:13: error: 'val' may be used uninitialized in this function [-Werror=maybe-uninitialized]

  return val & data->resetn_val;
         ~~~~^~~~~~~~~~~~~~~~~~

drivers/phy/phy-exynos-mipi-video.c:235:6: note: 'val' was declared here
u32 val;

The failure scenario here is the offset passed into a the stub regmap_read() function that does not modify its output, however regmap_read() can also fail for other reasons, so adding error handling (in this case, returning zero from is_running) seems the best solution.

Note that this warning showed up with the ARM s5pv210_defconfig, indicating that we most likely want to either enable CONFIG_REGMAP in that defconfig as well, or disable the phy-exynos-mipi-video driver.

Fixes 97a3042f7616 ("phy: exynos-mipi-video: Rewrite handling of phy registers")
---
 drivers/phy/phy-exynos-mipi-video.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/phy/phy-exynos-mipi-video.c +5 -1
index cc093eb..8b851f7 100644
@@ -233,8 +233,12 @@ static inline int __is_running(const struct exynos_mipi_phy_desc *data,
 			struct exynos_mipi_video_phy *state)
 {
 	u32 val;
+	int ret;
+
+	ret = regmap_read(state->regmaps[data->resetn_map], data->resetn_reg, &val);
+	if (ret)
+		return 0;
 
-	regmap_read(state->regmaps[data->resetn_map], data->resetn_reg, &val);
 	return val & data->resetn_val;
 }
 
Signature · 1 line
1.7.9.5
#3 lore raw
In reply to Kishon Vijay Abraham I
Quoted 10 lines · Kishon Vijay Abraham I

Hi Greg,

Please find the pull request for this -rc cycle below. It consists of a couple of fixes in the phy drivers. Consider merging this in this -rc.

Let me know if you want me to change something.

Cheers
Kishon

Quoted 7 lines

The following changes since commit 1a695a905c18548062509178b98bc91e67510864:

Linux 4.7-rc1 (2016-05-29 09:29:24 -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.7-rc

Pulled and pushed out, thanks.

greg k-h