Skip to contentSkip to conversation

phy: ti-pipe3: Do not overwrite the whole PROGRAMMABILITY register

PATCH In review Rolf Evers-Fischer 2 participants 3 messages Feb 26, 2019 Generic PHY framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: ti-pipe3: Do not overwrite the whole PROGRAMMABILITY register

From: Rolf Evers-Fischer <[email protected]>

Previously, ti_pipe3_calibrate() wrote all bits in the PCIEPHYRX_ANA_PROGRAMMABILITY register, thus overwriting bits, which should not be modified.
Fix ti_pipe3_calibrate() so that it only modifies LOSD and INTERFACE bits.

---
 drivers/phy/ti/phy-ti-pipe3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/ti/phy-ti-pipe3.c +1 -1
index 68ce4a082b9b..693acc167351 100644
@@ -303,7 +303,7 @@ static void ti_pipe3_calibrate(struct ti_pipe3 *phy)
 
 	val = ti_pipe3_readl(phy->phy_rx, PCIEPHYRX_ANA_PROGRAMMABILITY);
 	val &= ~(INTERFACE_MASK | LOSD_MASK | MEM_PLLDIV);
-	val = (0x1 << INTERFACE_SHIFT | 0xA << LOSD_SHIFT);
+	val |= (0x1 << INTERFACE_SHIFT | 0xA << LOSD_SHIFT);
 	ti_pipe3_writel(phy->phy_rx, PCIEPHYRX_ANA_PROGRAMMABILITY, val);
 
 	val = ti_pipe3_readl(phy->phy_rx, PCIEPHYRX_DIGITAL_MODES);
Signature · 1 line
2.21.0
#1 lore raw

Rolf,

Quoted 7 lines · Rolf Evers-Fischer

From: Rolf Evers-Fischer <[email protected]>

Previously, ti_pipe3_calibrate() wrote all bits in the PCIEPHYRX_ANA_PROGRAMMABILITY register, thus overwriting bits, which should not be modified.
Fix ti_pipe3_calibrate() so that it only modifies LOSD and INTERFACE bits.

A patch to fix this was sent a week earlier by Colin
https://lkml.org/lkml/2019/2/19/459

Thanks
Kishon

Quoted 20 lines
---
 drivers/phy/ti/phy-ti-pipe3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/ti/phy-ti-pipe3.c +1 -1
index 68ce4a082b9b..693acc167351 100644
@@ -303,7 +303,7 @@ static void ti_pipe3_calibrate(struct ti_pipe3 *phy)
 
 	val = ti_pipe3_readl(phy->phy_rx, PCIEPHYRX_ANA_PROGRAMMABILITY);
 	val &= ~(INTERFACE_MASK | LOSD_MASK | MEM_PLLDIV);
-	val = (0x1 << INTERFACE_SHIFT | 0xA << LOSD_SHIFT);
+	val |= (0x1 << INTERFACE_SHIFT | 0xA << LOSD_SHIFT);
 	ti_pipe3_writel(phy->phy_rx, PCIEPHYRX_ANA_PROGRAMMABILITY, val);
 
 	val = ti_pipe3_readl(phy->phy_rx, PCIEPHYRX_DIGITAL_MODES);
#2 lore raw

Kishon,

Quoted 28 lines · Kishon Vijay Abraham I

Rolf,

Quoted 7 lines · Rolf Evers-Fischer

From: Rolf Evers-Fischer <[email protected]>

Previously, ti_pipe3_calibrate() wrote all bits in the PCIEPHYRX_ANA_PROGRAMMABILITY register, thus overwriting bits, which should not be modified.
Fix ti_pipe3_calibrate() so that it only modifies LOSD and INTERFACE bits.

A patch to fix this was sent a week earlier by Colin
https://lkml.org/lkml/2019/2/19/459

Thanks
Kishon

Quoted 12 lines
---
 drivers/phy/ti/phy-ti-pipe3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/ti/phy-ti-pipe3.c +0 -0
index 68ce4a082b9b..693acc167351 100644
@@ -303,7 +303,7 @@ static void ti_pipe3_calibrate(struct ti_pipe3 *phy)
 
Quoted 9 lines

drivers/phy/ti/phy-ti-pipe3.c static void ti_pipe3_calibrate(struct ti_pipe3 *phy) · line 309

Quoted 8 lines
drivers/phy/ti/phy-ti-pipe3.c +1 -1
 	val = ti_pipe3_readl(phy->phy_rx, PCIEPHYRX_ANA_PROGRAMMABILITY);
 	val &= ~(INTERFACE_MASK | LOSD_MASK | MEM_PLLDIV);
-	val = (0x1 << INTERFACE_SHIFT | 0xA << LOSD_SHIFT);
+	val |= (0x1 << INTERFACE_SHIFT | 0xA << LOSD_SHIFT);
 	ti_pipe3_writel(phy->phy_rx, PCIEPHYRX_ANA_PROGRAMMABILITY, val);
 
 	val = ti_pipe3_readl(phy->phy_rx, PCIEPHYRX_DIGITAL_MODES);

please excuse me. I must have missed that one.
Therefore please forget about my previous mail.

Thanks
Rolf