Skip to content

Commit 8c77534

Browse files
emuslndavem330
authored andcommitted
ionic: block actions during fw reset
Block some actions while the FW is in a reset activity and the queues are not configured. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent acc606d commit 8c77534

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ static int ionic_sriov_configure(struct pci_dev *pdev, int num_vfs)
184184
struct device *dev = ionic->dev;
185185
int ret = 0;
186186

187+
if (ionic->lif &&
188+
test_bit(IONIC_LIF_F_FW_RESET, ionic->lif->state))
189+
return -EBUSY;
190+
187191
if (num_vfs > 0) {
188192
ret = pci_enable_sriov(pdev, num_vfs);
189193
if (ret) {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@
1414
static void ionic_watchdog_cb(struct timer_list *t)
1515
{
1616
struct ionic *ionic = from_timer(ionic, t, watchdog_timer);
17+
struct ionic_lif *lif = ionic->lif;
1718
int hb;
1819

1920
mod_timer(&ionic->watchdog_timer,
2021
round_jiffies(jiffies + ionic->watchdog_period));
2122

22-
if (!ionic->lif)
23+
if (!lif)
2324
return;
2425

2526
hb = ionic_heartbeat_check(ionic);
2627

27-
if (hb >= 0)
28-
ionic_link_status_check_request(ionic->lif, CAN_NOT_SLEEP);
28+
if (hb >= 0 &&
29+
!test_bit(IONIC_LIF_F_FW_RESET, lif->state))
30+
ionic_link_status_check_request(lif, CAN_NOT_SLEEP);
2931
}
3032

3133
void ionic_init_devinfo(struct ionic *ionic)

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,8 @@ static void ionic_tx_timeout_work(struct work_struct *ws)
14771477
{
14781478
struct ionic_lif *lif = container_of(ws, struct ionic_lif, tx_timeout_work);
14791479

1480-
netdev_info(lif->netdev, "Tx Timeout recovery\n");
1480+
if (test_bit(IONIC_LIF_F_FW_RESET, lif->state))
1481+
return;
14811482

14821483
/* if we were stopped before this scheduled job was launched,
14831484
* don't bother the queues as they are already stopped.
@@ -1493,6 +1494,7 @@ static void ionic_tx_timeout(struct net_device *netdev, unsigned int txqueue)
14931494
{
14941495
struct ionic_lif *lif = netdev_priv(netdev);
14951496

1497+
netdev_info(lif->netdev, "Tx Timeout triggered - txq %d\n", txqueue);
14961498
schedule_work(&lif->tx_timeout_work);
14971499
}
14981500

@@ -1834,6 +1836,9 @@ static int ionic_start_queues(struct ionic_lif *lif)
18341836
{
18351837
int err;
18361838

1839+
if (test_bit(IONIC_LIF_F_FW_RESET, lif->state))
1840+
return -EBUSY;
1841+
18371842
if (test_and_set_bit(IONIC_LIF_F_UP, lif->state))
18381843
return 0;
18391844

0 commit comments

Comments
 (0)