Skip to content

Commit 9e8eaf8

Browse files
emuslndavem330
authored andcommitted
ionic: stop watchdog when in broken state
Up to now we've been ignoring any error return from the queue starting in the link status check, so we fix that here. If the driver had to reset and couldn't get things running properly again, for example after a Tx Timeout and the FW is not responding to commands, don't let the link watchdog try to restart the queues. At this point the user can try to DOWN and UP the device to clear the errors. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8c77534 commit 9e8eaf8

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,31 @@ static void ionic_link_status_check(struct ionic_lif *lif)
120120
if (!test_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state))
121121
return;
122122

123+
/* Don't put carrier back up if we're in a broken state */
124+
if (test_bit(IONIC_LIF_F_BROKEN, lif->state)) {
125+
clear_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state);
126+
return;
127+
}
128+
123129
link_status = le16_to_cpu(lif->info->status.link_status);
124130
link_up = link_status == IONIC_PORT_OPER_STATUS_UP;
125131

126132
if (link_up) {
133+
int err = 0;
134+
127135
if (netdev->flags & IFF_UP && netif_running(netdev)) {
128136
mutex_lock(&lif->queue_lock);
129-
ionic_start_queues(lif);
137+
err = ionic_start_queues(lif);
138+
if (err) {
139+
netdev_err(lif->netdev,
140+
"Failed to start queues: %d\n", err);
141+
set_bit(IONIC_LIF_F_BROKEN, lif->state);
142+
netif_carrier_off(lif->netdev);
143+
}
130144
mutex_unlock(&lif->queue_lock);
131145
}
132146

133-
if (!netif_carrier_ok(netdev)) {
147+
if (!err && !netif_carrier_ok(netdev)) {
134148
ionic_port_identify(lif->ionic);
135149
netdev_info(netdev, "Link up - %d Gbps\n",
136150
le32_to_cpu(lif->info->status.link_speed) / 1000);
@@ -1836,6 +1850,9 @@ static int ionic_start_queues(struct ionic_lif *lif)
18361850
{
18371851
int err;
18381852

1853+
if (test_bit(IONIC_LIF_F_BROKEN, lif->state))
1854+
return -EIO;
1855+
18391856
if (test_bit(IONIC_LIF_F_FW_RESET, lif->state))
18401857
return -EBUSY;
18411858

@@ -1857,6 +1874,10 @@ static int ionic_open(struct net_device *netdev)
18571874
struct ionic_lif *lif = netdev_priv(netdev);
18581875
int err;
18591876

1877+
/* If recovering from a broken state, clear the bit and we'll try again */
1878+
if (test_and_clear_bit(IONIC_LIF_F_BROKEN, lif->state))
1879+
netdev_info(netdev, "clearing broken state\n");
1880+
18601881
err = ionic_txrx_alloc(lif);
18611882
if (err)
18621883
return err;

drivers/net/ethernet/pensando/ionic/ionic_lif.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ enum ionic_lif_state_flags {
139139
IONIC_LIF_F_LINK_CHECK_REQUESTED,
140140
IONIC_LIF_F_FW_RESET,
141141
IONIC_LIF_F_SPLIT_INTR,
142+
IONIC_LIF_F_BROKEN,
142143
IONIC_LIF_F_TX_DIM_INTR,
143144
IONIC_LIF_F_RX_DIM_INTR,
144145

0 commit comments

Comments
 (0)