ionic: call ionic_port_init after fw-upgrade

Since the fw has been re-inited, we need to refresh the port
information dma address so we can see fresh port information.
Let's call ionic_port_init again, and tweak it to allow for
a call to simply refresh the existing dma address.

Fixes: c672412f61 ("ionic: remove lifs on fw reset")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Shannon Nelson 2020-05-11 14:04:45 -07:00 committed by David S. Miller
parent f20a4d4041
commit ddc5911b9b
2 changed files with 10 additions and 9 deletions

View File

@ -2118,6 +2118,7 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif)
dev_info(ionic->dev, "FW Up: restarting LIFs\n");
ionic_init_devinfo(ionic);
ionic_port_init(ionic);
err = ionic_qcqs_alloc(lif);
if (err)
goto err_out;

View File

@ -509,16 +509,16 @@ int ionic_port_init(struct ionic *ionic)
size_t sz;
int err;
if (idev->port_info)
return 0;
idev->port_info_sz = ALIGN(sizeof(*idev->port_info), PAGE_SIZE);
idev->port_info = dma_alloc_coherent(ionic->dev, idev->port_info_sz,
&idev->port_info_pa,
GFP_KERNEL);
if (!idev->port_info) {
dev_err(ionic->dev, "Failed to allocate port info, aborting\n");
return -ENOMEM;
idev->port_info_sz = ALIGN(sizeof(*idev->port_info), PAGE_SIZE);
idev->port_info = dma_alloc_coherent(ionic->dev,
idev->port_info_sz,
&idev->port_info_pa,
GFP_KERNEL);
if (!idev->port_info) {
dev_err(ionic->dev, "Failed to allocate port info\n");
return -ENOMEM;
}
}
sz = min(sizeof(ident->port.config), sizeof(idev->dev_cmd_regs->data));