aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/falcon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/sfc/falcon.c')
-rw-r--r--drivers/net/ethernet/sfc/falcon.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/net/ethernet/sfc/falcon.c b/drivers/net/ethernet/sfc/falcon.c
index 3c99b6c2d531..76a9e0dd2308 100644
--- a/drivers/net/ethernet/sfc/falcon.c
+++ b/drivers/net/ethernet/sfc/falcon.c
@@ -131,8 +131,8 @@
131#define XgDmaDone_offset 0xD4 131#define XgDmaDone_offset 0xD4
132#define XgDmaDone_WIDTH 32 132#define XgDmaDone_WIDTH 32
133 133
134#define FALCON_STATS_NOT_DONE 0x00000000 134#define FALCON_XMAC_STATS_DMA_FLAG(efx) \
135#define FALCON_STATS_DONE 0xffffffff 135 (*(u32 *)((efx)->stats_buffer.addr + XgDmaDone_offset))
136 136
137#define FALCON_STAT_OFFSET(falcon_stat) EFX_VAL(falcon_stat, offset) 137#define FALCON_STAT_OFFSET(falcon_stat) EFX_VAL(falcon_stat, offset)
138#define FALCON_STAT_WIDTH(falcon_stat) EFX_VAL(falcon_stat, WIDTH) 138#define FALCON_STAT_WIDTH(falcon_stat) EFX_VAL(falcon_stat, WIDTH)
@@ -1398,10 +1398,7 @@ static void falcon_stats_request(struct efx_nic *efx)
1398 WARN_ON(nic_data->stats_pending); 1398 WARN_ON(nic_data->stats_pending);
1399 WARN_ON(nic_data->stats_disable_count); 1399 WARN_ON(nic_data->stats_disable_count);
1400 1400
1401 if (nic_data->stats_dma_done == NULL) 1401 FALCON_XMAC_STATS_DMA_FLAG(efx) = 0;
1402 return; /* no mac selected */
1403
1404 *nic_data->stats_dma_done = FALCON_STATS_NOT_DONE;
1405 nic_data->stats_pending = true; 1402 nic_data->stats_pending = true;
1406 wmb(); /* ensure done flag is clear */ 1403 wmb(); /* ensure done flag is clear */
1407 1404
@@ -1423,7 +1420,7 @@ static void falcon_stats_complete(struct efx_nic *efx)
1423 return; 1420 return;
1424 1421
1425 nic_data->stats_pending = false; 1422 nic_data->stats_pending = false;
1426 if (*nic_data->stats_dma_done == FALCON_STATS_DONE) { 1423 if (FALCON_XMAC_STATS_DMA_FLAG(efx)) {
1427 rmb(); /* read the done flag before the stats */ 1424 rmb(); /* read the done flag before the stats */
1428 falcon_update_stats_xmac(efx); 1425 falcon_update_stats_xmac(efx);
1429 } else { 1426 } else {
@@ -1706,7 +1703,6 @@ static int falcon_probe_port(struct efx_nic *efx)
1706 (u64)efx->stats_buffer.dma_addr, 1703 (u64)efx->stats_buffer.dma_addr,
1707 efx->stats_buffer.addr, 1704 efx->stats_buffer.addr,
1708 (u64)virt_to_phys(efx->stats_buffer.addr)); 1705 (u64)virt_to_phys(efx->stats_buffer.addr));
1709 nic_data->stats_dma_done = efx->stats_buffer.addr + XgDmaDone_offset;
1710 1706
1711 return 0; 1707 return 0;
1712} 1708}
@@ -2554,8 +2550,7 @@ static void falcon_update_nic_stats(struct efx_nic *efx)
2554 efx->n_rx_nodesc_drop_cnt += 2550 efx->n_rx_nodesc_drop_cnt +=
2555 EFX_OWORD_FIELD(cnt, FRF_AB_RX_NODESC_DROP_CNT); 2551 EFX_OWORD_FIELD(cnt, FRF_AB_RX_NODESC_DROP_CNT);
2556 2552
2557 if (nic_data->stats_pending && 2553 if (nic_data->stats_pending && FALCON_XMAC_STATS_DMA_FLAG(efx)) {
2558 *nic_data->stats_dma_done == FALCON_STATS_DONE) {
2559 nic_data->stats_pending = false; 2554 nic_data->stats_pending = false;
2560 rmb(); /* read the done flag before the stats */ 2555 rmb(); /* read the done flag before the stats */
2561 falcon_update_stats_xmac(efx); 2556 falcon_update_stats_xmac(efx);
@@ -2588,7 +2583,7 @@ void falcon_stop_nic_stats(struct efx_nic *efx)
2588 /* Wait enough time for the most recent transfer to 2583 /* Wait enough time for the most recent transfer to
2589 * complete. */ 2584 * complete. */
2590 for (i = 0; i < 4 && nic_data->stats_pending; i++) { 2585 for (i = 0; i < 4 && nic_data->stats_pending; i++) {
2591 if (*nic_data->stats_dma_done == FALCON_STATS_DONE) 2586 if (FALCON_XMAC_STATS_DMA_FLAG(efx))
2592 break; 2587 break;
2593 msleep(1); 2588 msleep(1);
2594 } 2589 }