Skip to content

Commit a1664b9

Browse files
shinas-marvellkuba-moo
authored andcommitted
octeon_ep: initialise control mbox tasks before using APIs
Initialise various workqueue tasks and queue interrupt poll task before the first invocation of any control net APIs. Since octep_ctrl_net_get_info was called before the control net receive work task was initialised or even the interrupt poll task was queued, the function call wasn't returning actual firmware info queried from Octeon. Fixes: 8d6198a ("octeon_ep: support to fetch firmware info") Signed-off-by: Shinas Rasheed <[email protected]> Reviewed-by: Michal Schmidt <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c12296b commit a1664b9

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

drivers/net/ethernet/marvell/octeon_ep/octep_main.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,13 @@ int octep_device_setup(struct octep_device *oct)
11931193
if (ret)
11941194
return ret;
11951195

1196+
INIT_WORK(&oct->tx_timeout_task, octep_tx_timeout_task);
1197+
INIT_WORK(&oct->ctrl_mbox_task, octep_ctrl_mbox_task);
1198+
INIT_DELAYED_WORK(&oct->intr_poll_task, octep_intr_poll_task);
1199+
oct->poll_non_ioq_intr = true;
1200+
queue_delayed_work(octep_wq, &oct->intr_poll_task,
1201+
msecs_to_jiffies(OCTEP_INTR_POLL_TIME_MSECS));
1202+
11961203
atomic_set(&oct->hb_miss_cnt, 0);
11971204
INIT_DELAYED_WORK(&oct->hb_task, octep_hb_timeout_task);
11981205

@@ -1325,21 +1332,18 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
13251332
goto err_octep_config;
13261333
}
13271334

1328-
octep_ctrl_net_get_info(octep_dev, OCTEP_CTRL_NET_INVALID_VFID,
1329-
&octep_dev->conf->fw_info);
1335+
err = octep_ctrl_net_get_info(octep_dev, OCTEP_CTRL_NET_INVALID_VFID,
1336+
&octep_dev->conf->fw_info);
1337+
if (err) {
1338+
dev_err(&pdev->dev, "Failed to get firmware info\n");
1339+
goto register_dev_err;
1340+
}
13301341
dev_info(&octep_dev->pdev->dev, "Heartbeat interval %u msecs Heartbeat miss count %u\n",
13311342
octep_dev->conf->fw_info.hb_interval,
13321343
octep_dev->conf->fw_info.hb_miss_count);
13331344
queue_delayed_work(octep_wq, &octep_dev->hb_task,
13341345
msecs_to_jiffies(octep_dev->conf->fw_info.hb_interval));
13351346

1336-
INIT_WORK(&octep_dev->tx_timeout_task, octep_tx_timeout_task);
1337-
INIT_WORK(&octep_dev->ctrl_mbox_task, octep_ctrl_mbox_task);
1338-
INIT_DELAYED_WORK(&octep_dev->intr_poll_task, octep_intr_poll_task);
1339-
octep_dev->poll_non_ioq_intr = true;
1340-
queue_delayed_work(octep_wq, &octep_dev->intr_poll_task,
1341-
msecs_to_jiffies(OCTEP_INTR_POLL_TIME_MSECS));
1342-
13431347
netdev->netdev_ops = &octep_netdev_ops;
13441348
octep_set_ethtool_ops(netdev);
13451349
netif_carrier_off(netdev);

0 commit comments

Comments
 (0)