Commit 50bfd838 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

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

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: f5d7837f ("ravb: ptp: Add CONFIG mode support")
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d0c5f45a
...@@ -1139,7 +1139,8 @@ static int ravb_set_ringparam(struct net_device *ndev, ...@@ -1139,7 +1139,8 @@ static int ravb_set_ringparam(struct net_device *ndev,
if (netif_running(ndev)) { if (netif_running(ndev)) {
netif_device_detach(ndev); netif_device_detach(ndev);
/* Stop PTP Clock driver */ /* Stop PTP Clock driver */
ravb_ptp_stop(ndev); if (priv->chip_id == RCAR_GEN2)
ravb_ptp_stop(ndev);
/* Wait for DMA stopping */ /* Wait for DMA stopping */
error = ravb_stop_dma(ndev); error = ravb_stop_dma(ndev);
if (error) { if (error) {
...@@ -1170,7 +1171,8 @@ static int ravb_set_ringparam(struct net_device *ndev, ...@@ -1170,7 +1171,8 @@ static int ravb_set_ringparam(struct net_device *ndev,
ravb_emac_init(ndev); ravb_emac_init(ndev);
/* Initialise PTP Clock driver */ /* 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); netif_device_attach(ndev);
} }
...@@ -1298,7 +1300,8 @@ static void ravb_tx_timeout_work(struct work_struct *work) ...@@ -1298,7 +1300,8 @@ static void ravb_tx_timeout_work(struct work_struct *work)
netif_tx_stop_all_queues(ndev); netif_tx_stop_all_queues(ndev);
/* Stop PTP Clock driver */ /* Stop PTP Clock driver */
ravb_ptp_stop(ndev); if (priv->chip_id == RCAR_GEN2)
ravb_ptp_stop(ndev);
/* Wait for DMA stopping */ /* Wait for DMA stopping */
ravb_stop_dma(ndev); ravb_stop_dma(ndev);
...@@ -1311,7 +1314,8 @@ static void ravb_tx_timeout_work(struct work_struct *work) ...@@ -1311,7 +1314,8 @@ static void ravb_tx_timeout_work(struct work_struct *work)
ravb_emac_init(ndev); ravb_emac_init(ndev);
/* Initialise PTP Clock driver */ /* 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); netif_tx_start_all_queues(ndev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment