sfc: Wait at most 10ms for the MC to finish reading out MAC statistics
Subsystems (2)
PATCH 1/3 sfc: Wait at most 10ms for the MC to finish reading out MAC statistics
The original code would wait indefinitely if MAC stats DMA failed.
--- drivers/net/sfc/siena.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
drivers/net/sfc/siena.c +11 -2
@@ -456,8 +456,17 @@ static int siena_try_update_nic_stats(struct efx_nic *efx)static void siena_update_nic_stats (struct efx_nic *efx) { -while (siena_try_update_nic_stats (efx) == -EAGAIN ) -cpu_relax (); +int retry; + +/* If we're unlucky enough to read statistics wduring the DMA, wait +* up to 10ms for it to finish (typically takes <500us) */ +for (retry =0 ; retry <100 ; ++retry) { +if (siena_try_update_nic_stats (efx) ==0 ) +return ; +udelay (100 ); + } + +/* Use the old values instead */ }static void siena_start_nic_stats (struct efx_nic *efx)
Signature · 7 lines
1.6.2.5 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 2/3 sfc: Always close net device at the end of a disabling reset
This fixes a regression introduced by commit eb9f6744cbfa97674c13263802259b5aa0034594 "sfc: Implement ethtool reset operation".
--- drivers/net/sfc/efx.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/sfc/efx.c +2 -2
@@ -1861,6 +1861,7 @@ out: }if (disabled) { +dev_close (efx->net_dev);EFX_ERR (efx,"has been disabled\n" ); efx->state =STATE_DISABLED ; }else {
@@ -1884,8 +1885,7 @@ static void efx_reset_work(struct work_struct *data) }rtnl_lock (); -if (efx_reset (efx, efx->reset_pending)) -dev_close (efx->net_dev); + (void )efx_reset (efx, efx->reset_pending);rtnl_unlock (); }
Signature · 7 lines
1.6.2.5 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 3/3 sfc: Change falcon_probe_board() to fail for unsupported boards
In reply to Ben HutchingsThe driver needs specific PHY and board support code for each SFC4000 board; there is no point trying to continue if it is missing. Currently unsupported boards can trigger an 'oops'.
--- drivers/net/sfc/falcon.c | 4 +++- drivers/net/sfc/falcon_boards.c | 13 +++---------- drivers/net/sfc/nic.h | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-)
drivers/net/sfc/falcon.c +3 -1
@@ -1320,7 +1320,9 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)EFX_LOG (efx,"PHY is %d phy_id %d\n" , efx->phy_type, efx->mdio.prtad); -falcon_probe_board (efx, board_rev); + rc =falcon_probe_board (efx, board_rev); +if (rc) + goto fail2;kfree (nvconfig);return 0 ;
drivers/net/sfc/falcon_boards.c +3 -10
@@ -728,15 +728,7 @@ static const struct falcon_board_type board_types[] = { }, }; -static const struct falcon_board_type falcon_dummy_board = { - .init = efx_port_dummy_op_int, - .init_phy = efx_port_dummy_op_void, - .fini = efx_port_dummy_op_void, - .set_id_led = efx_port_dummy_op_set_id_led, - .monitor = efx_port_dummy_op_int, -}; - -void falcon_probe_board (struct efx_nic *efx,u16 revision_info) +int falcon_probe_board (struct efx_nic *efx,u16 revision_info) {struct falcon_board *board =falcon_board (efx);u8 type_id =FALCON_BOARD_TYPE (revision_info);
@@ -754,8 +746,9 @@ void falcon_probe_board(struct efx_nic *efx, u16 revision_info) (efx->pci_dev->subsystem_vendor ==EFX_VENDID_SFC ) ? board->type->ref_model : board->type->gen_type, 'A' + board->major, board->minor); +return 0 ; }else {EFX_ERR (efx,"unknown board type %d\n" , type_id); - board->type = &falcon_dummy_board; +return -ENODEV ; } }
drivers/net/sfc/nic.h +1 -1
@@ -156,7 +156,7 @@ extern struct efx_nic_type siena_a0_nic_type;************************************************************************** */ -extern void falcon_probe_board (struct efx_nic *efx,u16 revision_info); +extern int falcon_probe_board (struct efx_nic *efx,u16 revision_info);/* TX data path */ extern int efx_nic_probe_tx (struct efx_tx_queue *tx_queue);
Signature · 6 lines
1.6.2.5 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
From: Ben Hutchings <[email protected]>
Date: Wed, 28 Apr 2010 20:00:35 +0100
Quoted 4 lines
The original code would wait indefinitely if MAC stats DMA failed.
Signed-off-by Ben Hutchings <[email protected]>
Applied.
Re: [PATCH net-2.6 2/3] sfc: Always close net device at the end of a disabling reset
In reply to Ben HutchingsFrom: Ben Hutchings <[email protected]>
Date: Wed, 28 Apr 2010 20:01:33 +0100
Quoted 6 lines
This fixes a regression introduced by commit
eb9f6744cbfa97674c13263802259b5aa0034594"sfc: Implement ethtool reset operation".Signed-off-by Ben Hutchings <[email protected]>
Applied.
Re: [PATCH net-2.6 3/3] sfc: Change falcon_probe_board() to fail for unsupported boards
In reply to Ben HutchingsFrom: Ben Hutchings <[email protected]>
Date: Wed, 28 Apr 2010 20:01:50 +0100
Quoted 6 lines
The driver needs specific PHY and board support code for each SFC4000 board; there is no point trying to continue if it is missing. Currently unsupported boards can trigger an 'oops'.
Signed-off-by Ben Hutchings <[email protected]>
Applied.