ravb: fix the fallout of R-Car gen3 gPTP support
Subsystems (3)
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
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...
--- drivers/net/ethernet/renesas/ravb_main.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ethernet/renesas/ravb_main.c +0 -4
@@ -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)
PATCH 2/2 ravb: skip gPTP start/stop on R-Car gen3
In reply to Sergei ShtylyovWhen 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...
--- drivers/net/ethernet/renesas/ravb_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ethernet/renesas/ravb_main.c +8 -4
@@ -1139,7 +1139,8 @@ static int ravb_set_ringparam(struct netif (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 netravb_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(structnetif_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(structravb_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); }
David Miller
maintainerFrom: 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 commitf5d7837f96e5("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.