diff options
author | Rasesh Mody <rmody@brocade.com> | 2012-12-11 07:24:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-11 18:25:51 -0500 |
commit | 215a64a25cd483e54d472987426d78694fc46ed0 (patch) | |
tree | 2711f45ceb775ebb132b752377aa34e8cd023a6f /drivers/net/ethernet/brocade/bna | |
parent | 30f9fc947938d483c48011530973903797e8739f (diff) |
bna: Add RX State
Change Details:
- BNA state machine for Rx in start_wait state moves it to stop_wait on
receipt of RX_E_STOP. In Rx stop_wait state, on receipt of
RX_E_STARTED event does enet stop
RX_E_STOPPED event does rx_cleanup_cbfn
rx_cleanup_cbfn in this case is called without post_cbfn. post_cbfn
happens only after RX_E_STARTED event is received in start_wait. Without
doing post_cbfn, NAPI remains disabled and in cleanup we try to disable
again causing endless wait. ifconfig process and other workers can thus
get stuck.
- Introducing start_stop_wait state for Rx. This state handles the case of
if post_cbfn is not done simply do stop without the cleanup.
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/brocade/bna')
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bna_tx_rx.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c index 4df6d4b50b45..ea6f4a036401 100644 --- a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c +++ b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c | |||
@@ -1355,6 +1355,8 @@ bfa_fsm_state_decl(bna_rx, stopped, | |||
1355 | struct bna_rx, enum bna_rx_event); | 1355 | struct bna_rx, enum bna_rx_event); |
1356 | bfa_fsm_state_decl(bna_rx, start_wait, | 1356 | bfa_fsm_state_decl(bna_rx, start_wait, |
1357 | struct bna_rx, enum bna_rx_event); | 1357 | struct bna_rx, enum bna_rx_event); |
1358 | bfa_fsm_state_decl(bna_rx, start_stop_wait, | ||
1359 | struct bna_rx, enum bna_rx_event); | ||
1358 | bfa_fsm_state_decl(bna_rx, rxf_start_wait, | 1360 | bfa_fsm_state_decl(bna_rx, rxf_start_wait, |
1359 | struct bna_rx, enum bna_rx_event); | 1361 | struct bna_rx, enum bna_rx_event); |
1360 | bfa_fsm_state_decl(bna_rx, started, | 1362 | bfa_fsm_state_decl(bna_rx, started, |
@@ -1432,7 +1434,7 @@ static void bna_rx_sm_start_wait(struct bna_rx *rx, | |||
1432 | { | 1434 | { |
1433 | switch (event) { | 1435 | switch (event) { |
1434 | case RX_E_STOP: | 1436 | case RX_E_STOP: |
1435 | bfa_fsm_set_state(rx, bna_rx_sm_stop_wait); | 1437 | bfa_fsm_set_state(rx, bna_rx_sm_start_stop_wait); |
1436 | break; | 1438 | break; |
1437 | 1439 | ||
1438 | case RX_E_FAIL: | 1440 | case RX_E_FAIL: |
@@ -1488,6 +1490,29 @@ bna_rx_sm_rxf_stop_wait(struct bna_rx *rx, enum bna_rx_event event) | |||
1488 | 1490 | ||
1489 | } | 1491 | } |
1490 | 1492 | ||
1493 | static void | ||
1494 | bna_rx_sm_start_stop_wait_entry(struct bna_rx *rx) | ||
1495 | { | ||
1496 | } | ||
1497 | |||
1498 | static void | ||
1499 | bna_rx_sm_start_stop_wait(struct bna_rx *rx, enum bna_rx_event event) | ||
1500 | { | ||
1501 | switch (event) { | ||
1502 | case RX_E_FAIL: | ||
1503 | case RX_E_STOPPED: | ||
1504 | bfa_fsm_set_state(rx, bna_rx_sm_stopped); | ||
1505 | break; | ||
1506 | |||
1507 | case RX_E_STARTED: | ||
1508 | bna_rx_enet_stop(rx); | ||
1509 | break; | ||
1510 | |||
1511 | default: | ||
1512 | bfa_sm_fault(event); | ||
1513 | } | ||
1514 | } | ||
1515 | |||
1491 | void | 1516 | void |
1492 | bna_rx_sm_started_entry(struct bna_rx *rx) | 1517 | bna_rx_sm_started_entry(struct bna_rx *rx) |
1493 | { | 1518 | { |