summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/gianfar_ethtool.c
diff options
context:
space:
mode:
authorClaudiu Manoil <claudiu.manoil@freescale.com>2014-02-17 10:53:18 (GMT)
committerMadalin-Cristian Bucur <madalin.bucur@freescale.com>2014-02-25 14:14:37 (GMT)
commitcf03c44ec4a431b0e755e6696a355f7f959f08e1 (patch)
tree5cc99bb8d8bc2e4089a53eb8dbcd5f3c5dd18ddb /drivers/net/ethernet/freescale/gianfar_ethtool.c
parent43d708cd6ff248988bf69edaacd72574f50841ae (diff)
downloadlinux-fsl-qoriq-cf03c44ec4a431b0e755e6696a355f7f959f08e1.tar.xz
gianfar: Add missing graceful reset steps and fixes
gfar_halt() and gfar_start() are responsible for stopping and starting the DMA and the Rx/Tx hw rings. They implement the support for the "graceful Rx/Tx stop/start" hw procedure, and also disable/enable eTSEC's hw interrupts in the process. The GRS/GTS procedure requires however to have the RQUEUE/TQUEUE registers cleared first and to wait for a period of time for the current frame to pass through the interface (around ~10ms for a jumbo frame). Only then may the GTS and GRS bits from DMACTRL be set to shut down the DMA, and finally the Tx_EN and Rx_EN bits in MACCFG1 may be cleared to disable the Tx/Rx blocks. The same register programming order applies to start the Rx/Tx: enabling the RQUEUE/TQUEUE *before* clearing the GRS/GTS bits. This is a HW recommendation in order to avoid a possible controller "lock up" during graceful reset. Cleanup the gfar_halt()/start() prototypes, to take priv instead of ndev as their purpose is to operate on HW. Enabling the RQUEUE/TQUEUE in the hw_init() is not needed anymore since that's the job of gfar_start(). Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net> Change-Id: Idd62100c52aca887f743298c63df15bf54f38308 Reviewed-on: http://git.am.freescale.net:8181/9053 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Madalin-Cristian Bucur <madalin.bucur@freescale.com> Tested-by: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar_ethtool.c')
-rw-r--r--drivers/net/ethernet/freescale/gianfar_ethtool.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 5900dba..86bb12d 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -45,7 +45,6 @@
#include "gianfar.h"
-extern void gfar_start(struct net_device *dev);
extern int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue,
int rx_work_limit);
@@ -505,7 +504,7 @@ static int gfar_sringparam(struct net_device *dev,
lock_tx_qs(priv);
lock_rx_qs(priv);
- gfar_halt(dev);
+ gfar_halt(priv);
unlock_rx_qs(priv);
unlock_tx_qs(priv);
@@ -628,7 +627,7 @@ int gfar_set_features(struct net_device *dev, netdev_features_t features)
lock_tx_qs(priv);
lock_rx_qs(priv);
- gfar_halt(dev);
+ gfar_halt(priv);
unlock_tx_qs(priv);
unlock_rx_qs(priv);