Skip to contentSkip to conversation

ravb: fix the fallout of R-Car gen3 gPTP support

PATCH In review Sergei Shtylyov 2 participants 4 messages Feb 6, 2016 – Feb 16, 2016

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

cover ravb: fix the fallout of R-Car gen3 gPTP support

Hello.

Here's a set of 2 patches against DaveM's 'net.git' repo fixing up the
incomplete commit f5d7837f96e5 ("ravb: ptp: Add CONFIG mode support"). I'm proposing these as fixes but they can be merged as cleanups as well...

[1/2] ravb: kill duplicate setting of CCC.CSEL
[2/2] ravb: skip gPTP start/stop on R-Car gen3

MBR, Sergei

#1 lore raw

PATCH 1/2 ravb: kill duplicate setting of CCC.CSEL

When adding support for the R-Car gen3 gPTP active in configuration mode, the code setting the CCC.CSEL field was duplicated due to an oversight. For R-Car gen 2 it's just redundant and for R-Car gen3 the write at this time is probably ignored due to CCC.GAC bit being already set...

Fixes f5d7837f96e5 ("ravb: ptp: Add CONFIG mode support")
---
 drivers/net/ethernet/renesas/ravb_main.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/net/ethernet/renesas/ravb_main.c +0 -4
Index: net/drivers/net/ethernet/renesas/ravb_main.c
===================================================================
@@ -1814,10 +1814,6 @@ static int ravb_probe(struct platform_de
 			   CCC_OPC_CONFIG | CCC_GAC | CCC_CSEL_HPB, CCC);
 	}
 
-	/* Set CSEL value */
-	ravb_write(ndev, (ravb_read(ndev, CCC) & ~CCC_CSEL) | CCC_CSEL_HPB,
-		   CCC);
-
 	/* Set GTI value */
 	error = ravb_set_gti(ndev);
 	if (error)
#2 lore raw

PATCH 2/2 ravb: skip gPTP start/stop on R-Car gen3

In reply to Sergei Shtylyov

When adding support for the R-Car gen3 gPTP active in configuration mode, some call sites of ravb_ptp_{init|stop}() were missed due to an oversight. Add checks for the R-Car gen2 SoCs around these...

Fixes f5d7837f96e5 ("ravb: ptp: Add CONFIG mode support")
---
 drivers/net/ethernet/renesas/ravb_main.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ethernet/renesas/ravb_main.c +8 -4
Index: net/drivers/net/ethernet/renesas/ravb_main.c
===================================================================
@@ -1139,7 +1139,8 @@ static int ravb_set_ringparam(struct net
 	if (netif_running(ndev)) {
 		netif_device_detach(ndev);
 		/* Stop PTP Clock driver */
-		ravb_ptp_stop(ndev);
+		if (priv->chip_id == RCAR_GEN2)
+			ravb_ptp_stop(ndev);
 		/* Wait for DMA stopping */
 		error = ravb_stop_dma(ndev);
 		if (error) {
@@ -1170,7 +1171,8 @@ static int ravb_set_ringparam(struct net
 		ravb_emac_init(ndev);
 
 		/* Initialise PTP Clock driver */
-		ravb_ptp_init(ndev, priv->pdev);
+		if (priv->chip_id == RCAR_GEN2)
+			ravb_ptp_init(ndev, priv->pdev);
 
 		netif_device_attach(ndev);
 	}
@@ -1298,7 +1300,8 @@ static void ravb_tx_timeout_work(struct
 	netif_tx_stop_all_queues(ndev);
 
 	/* Stop PTP Clock driver */
-	ravb_ptp_stop(ndev);
+	if (priv->chip_id == RCAR_GEN2)
+		ravb_ptp_stop(ndev);
 
 	/* Wait for DMA stopping */
 	ravb_stop_dma(ndev);
@@ -1311,7 +1314,8 @@ static void ravb_tx_timeout_work(struct
 	ravb_emac_init(ndev);
 
 	/* Initialise PTP Clock driver */
-	ravb_ptp_init(ndev, priv->pdev);
+	if (priv->chip_id == RCAR_GEN2)
+		ravb_ptp_init(ndev, priv->pdev);
 
 	netif_tx_start_all_queues(ndev);
 }
maintainer
#3 lore raw
In reply to Sergei Shtylyov

From: Sergei Shtylyov <[email protected]>
Date: Sat, 06 Feb 2016 17:45:37 +0300

Quoted 6 lines

Here's a set of 2 patches against DaveM's 'net.git' repo fixing up the
incomplete commit f5d7837f96e5 ("ravb: ptp: Add CONFIG mode support"). I'm proposing these as fixes but they can be merged as cleanups as well...

[1/2] ravb: kill duplicate setting of CCC.CSEL
[2/2] ravb: skip gPTP start/stop on R-Car gen3

Series applied, thanks Sergei.