aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/efx.c4
-rw-r--r--drivers/net/sfc/falcon.c4
-rw-r--r--drivers/net/sfc/falcon_boards.c13
-rw-r--r--drivers/net/sfc/nic.h2
-rw-r--r--drivers/net/sfc/siena.c13
5 files changed, 20 insertions, 16 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index bc75ef683c9f..156460527231 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1870,6 +1870,7 @@ out:
1870 } 1870 }
1871 1871
1872 if (disabled) { 1872 if (disabled) {
1873 dev_close(efx->net_dev);
1873 EFX_ERR(efx, "has been disabled\n"); 1874 EFX_ERR(efx, "has been disabled\n");
1874 efx->state = STATE_DISABLED; 1875 efx->state = STATE_DISABLED;
1875 } else { 1876 } else {
@@ -1893,8 +1894,7 @@ static void efx_reset_work(struct work_struct *data)
1893 } 1894 }
1894 1895
1895 rtnl_lock(); 1896 rtnl_lock();
1896 if (efx_reset(efx, efx->reset_pending)) 1897 (void)efx_reset(efx, efx->reset_pending);
1897 dev_close(efx->net_dev);
1898 rtnl_unlock(); 1898 rtnl_unlock();
1899} 1899}
1900 1900
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index f7df24dce38a..655b697b45b2 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -1326,7 +1326,9 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
1326 1326
1327 EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad); 1327 EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad);
1328 1328
1329 falcon_probe_board(efx, board_rev); 1329 rc = falcon_probe_board(efx, board_rev);
1330 if (rc)
1331 goto fail2;
1330 1332
1331 kfree(nvconfig); 1333 kfree(nvconfig);
1332 return 0; 1334 return 0;
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c
index 5712fddd72f2..c7a933a3292e 100644
--- a/drivers/net/sfc/falcon_boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -728,15 +728,7 @@ static const struct falcon_board_type board_types[] = {
728 }, 728 },
729}; 729};
730 730
731static const struct falcon_board_type falcon_dummy_board = { 731int falcon_probe_board(struct efx_nic *efx, u16 revision_info)
732 .init = efx_port_dummy_op_int,
733 .init_phy = efx_port_dummy_op_void,
734 .fini = efx_port_dummy_op_void,
735 .set_id_led = efx_port_dummy_op_set_id_led,
736 .monitor = efx_port_dummy_op_int,
737};
738
739void falcon_probe_board(struct efx_nic *efx, u16 revision_info)
740{ 732{
741 struct falcon_board *board = falcon_board(efx); 733 struct falcon_board *board = falcon_board(efx);
742 u8 type_id = FALCON_BOARD_TYPE(revision_info); 734 u8 type_id = FALCON_BOARD_TYPE(revision_info);
@@ -754,8 +746,9 @@ void falcon_probe_board(struct efx_nic *efx, u16 revision_info)
754 (efx->pci_dev->subsystem_vendor == EFX_VENDID_SFC) 746 (efx->pci_dev->subsystem_vendor == EFX_VENDID_SFC)
755 ? board->type->ref_model : board->type->gen_type, 747 ? board->type->ref_model : board->type->gen_type,
756 'A' + board->major, board->minor); 748 'A' + board->major, board->minor);
749 return 0;
757 } else { 750 } else {
758 EFX_ERR(efx, "unknown board type %d\n", type_id); 751 EFX_ERR(efx, "unknown board type %d\n", type_id);
759 board->type = &falcon_dummy_board; 752 return -ENODEV;
760 } 753 }
761} 754}
diff --git a/drivers/net/sfc/nic.h b/drivers/net/sfc/nic.h
index 5825f37b51bd..bbc2c0c2f843 100644
--- a/drivers/net/sfc/nic.h
+++ b/drivers/net/sfc/nic.h
@@ -158,7 +158,7 @@ extern struct efx_nic_type siena_a0_nic_type;
158 ************************************************************************** 158 **************************************************************************
159 */ 159 */
160 160
161extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info); 161extern int falcon_probe_board(struct efx_nic *efx, u16 revision_info);
162 162
163/* TX data path */ 163/* TX data path */
164extern int efx_nic_probe_tx(struct efx_tx_queue *tx_queue); 164extern int efx_nic_probe_tx(struct efx_tx_queue *tx_queue);
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c
index 7bf93faff3ab..727b4228e081 100644
--- a/drivers/net/sfc/siena.c
+++ b/drivers/net/sfc/siena.c
@@ -475,8 +475,17 @@ static int siena_try_update_nic_stats(struct efx_nic *efx)
475 475
476static void siena_update_nic_stats(struct efx_nic *efx) 476static void siena_update_nic_stats(struct efx_nic *efx)
477{ 477{
478 while (siena_try_update_nic_stats(efx) == -EAGAIN) 478 int retry;
479 cpu_relax(); 479
480 /* If we're unlucky enough to read statistics wduring the DMA, wait
481 * up to 10ms for it to finish (typically takes <500us) */
482 for (retry = 0; retry < 100; ++retry) {
483 if (siena_try_update_nic_stats(efx) == 0)
484 return;
485 udelay(100);
486 }
487
488 /* Use the old values instead */
480} 489}
481 490
482static void siena_start_nic_stats(struct efx_nic *efx) 491static void siena_start_nic_stats(struct efx_nic *efx)