Skip to content

Commit a21b5d4

Browse files
emuslndavem330
authored andcommitted
ionic: refill lif identity after fw_up
After we do a fw upgrade and refill the ionic->ident.dev, we also need to update the other identity info. Since the lif identity needs to be updated each time the ionic identity is refreshed, we can pull it into ionic_identify(). The debugfs entry is moved so that it doesn't cause an error message when the data is refreshed after the fw upgrade. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ba6ab8a commit a21b5d4

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
266266
dev_err(dev, "Cannot identify device: %d, aborting\n", err);
267267
goto err_out_teardown;
268268
}
269+
ionic_debugfs_add_ident(ionic);
269270

270271
err = ionic_init(ionic);
271272
if (err) {
@@ -286,14 +287,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
286287
goto err_out_reset;
287288
}
288289

289-
/* Configure LIFs */
290-
err = ionic_lif_identify(ionic, IONIC_LIF_TYPE_CLASSIC,
291-
&ionic->ident.lif);
292-
if (err) {
293-
dev_err(dev, "Cannot identify LIFs: %d, aborting\n", err);
294-
goto err_out_port_reset;
295-
}
296-
290+
/* Allocate and init the LIF */
297291
err = ionic_lif_size(ionic);
298292
if (err) {
299293
dev_err(dev, "Cannot size LIF: %d, aborting\n", err);

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2556,7 +2556,15 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif)
25562556
dev_info(ionic->dev, "FW Up: restarting LIFs\n");
25572557

25582558
ionic_init_devinfo(ionic);
2559-
ionic_port_init(ionic);
2559+
err = ionic_identify(ionic);
2560+
if (err)
2561+
goto err_out;
2562+
err = ionic_port_identify(ionic);
2563+
if (err)
2564+
goto err_out;
2565+
err = ionic_port_init(ionic);
2566+
if (err)
2567+
goto err_out;
25602568
err = ionic_qcqs_alloc(lif);
25612569
if (err)
25622570
goto err_out;

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,17 +429,23 @@ int ionic_identify(struct ionic *ionic)
429429
sz = min(sizeof(ident->dev), sizeof(idev->dev_cmd_regs->data));
430430
memcpy_fromio(&ident->dev, &idev->dev_cmd_regs->data, sz);
431431
}
432-
433432
mutex_unlock(&ionic->dev_cmd_lock);
434433

435-
if (err)
436-
goto err_out_unmap;
434+
if (err) {
435+
dev_err(ionic->dev, "Cannot identify ionic: %dn", err);
436+
goto err_out;
437+
}
437438

438-
ionic_debugfs_add_ident(ionic);
439+
err = ionic_lif_identify(ionic, IONIC_LIF_TYPE_CLASSIC,
440+
&ionic->ident.lif);
441+
if (err) {
442+
dev_err(ionic->dev, "Cannot identify LIFs: %d\n", err);
443+
goto err_out;
444+
}
439445

440446
return 0;
441447

442-
err_out_unmap:
448+
err_out:
443449
return err;
444450
}
445451

0 commit comments

Comments
 (0)