Skip to content

Commit d6718cc

Browse files
committed
Merge branch 'ionic-fixes'
Shannon Nelson says: ==================== ionic fixes These are a couple more fixes after more fw-upgrade testing. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 2c864c7 + ddc5911 commit d6718cc

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,7 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif)
21182118
dev_info(ionic->dev, "FW Up: restarting LIFs\n");
21192119

21202120
ionic_init_devinfo(ionic);
2121+
ionic_port_init(ionic);
21212122
err = ionic_qcqs_alloc(lif);
21222123
if (err)
21232124
goto err_out;
@@ -2348,7 +2349,17 @@ static int ionic_station_set(struct ionic_lif *lif)
23482349
if (is_zero_ether_addr(ctx.comp.lif_getattr.mac))
23492350
return 0;
23502351

2351-
if (!ether_addr_equal(ctx.comp.lif_getattr.mac, netdev->dev_addr)) {
2352+
if (!is_zero_ether_addr(netdev->dev_addr)) {
2353+
/* If the netdev mac is non-zero and doesn't match the default
2354+
* device address, it was set by something earlier and we're
2355+
* likely here again after a fw-upgrade reset. We need to be
2356+
* sure the netdev mac is in our filter list.
2357+
*/
2358+
if (!ether_addr_equal(ctx.comp.lif_getattr.mac,
2359+
netdev->dev_addr))
2360+
ionic_lif_addr(lif, netdev->dev_addr, true);
2361+
} else {
2362+
/* Update the netdev mac with the device's mac */
23522363
memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len);
23532364
addr.sa_family = AF_INET;
23542365
err = eth_prepare_mac_addr_change(netdev, &addr);
@@ -2358,12 +2369,6 @@ static int ionic_station_set(struct ionic_lif *lif)
23582369
return 0;
23592370
}
23602371

2361-
if (!is_zero_ether_addr(netdev->dev_addr)) {
2362-
netdev_dbg(lif->netdev, "deleting station MAC addr %pM\n",
2363-
netdev->dev_addr);
2364-
ionic_lif_addr(lif, netdev->dev_addr, false);
2365-
}
2366-
23672372
eth_commit_mac_addr_change(netdev, &addr);
23682373
}
23692374

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -509,16 +509,16 @@ int ionic_port_init(struct ionic *ionic)
509509
size_t sz;
510510
int err;
511511

512-
if (idev->port_info)
513-
return 0;
514-
515-
idev->port_info_sz = ALIGN(sizeof(*idev->port_info), PAGE_SIZE);
516-
idev->port_info = dma_alloc_coherent(ionic->dev, idev->port_info_sz,
517-
&idev->port_info_pa,
518-
GFP_KERNEL);
519512
if (!idev->port_info) {
520-
dev_err(ionic->dev, "Failed to allocate port info, aborting\n");
521-
return -ENOMEM;
513+
idev->port_info_sz = ALIGN(sizeof(*idev->port_info), PAGE_SIZE);
514+
idev->port_info = dma_alloc_coherent(ionic->dev,
515+
idev->port_info_sz,
516+
&idev->port_info_pa,
517+
GFP_KERNEL);
518+
if (!idev->port_info) {
519+
dev_err(ionic->dev, "Failed to allocate port info\n");
520+
return -ENOMEM;
521+
}
522522
}
523523

524524
sz = min(sizeof(ident->port.config), sizeof(idev->dev_cmd_regs->data));

0 commit comments

Comments
 (0)