Skip to content

Commit d83ec0b

Browse files
committed
Merge branch 'there-are-some-bugfix-for-hibmcge-driver'
Jijie Shao says: ==================== There are some bugfix for hibmcge driver v1: https://lore.kernel.org/[email protected] ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents b95ed55 + 1b45443 commit d83ec0b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ static int hbg_reset_prepare(struct hbg_priv *priv, enum hbg_reset_type type)
6161
return -EBUSY;
6262
}
6363

64+
netif_device_detach(priv->netdev);
65+
6466
priv->reset_type = type;
6567
set_bit(HBG_NIC_STATE_RESETTING, &priv->state);
6668
clear_bit(HBG_NIC_STATE_RESET_FAIL, &priv->state);
@@ -91,6 +93,8 @@ static int hbg_reset_done(struct hbg_priv *priv, enum hbg_reset_type type)
9193
return ret;
9294
}
9395

96+
netif_device_attach(priv->netdev);
97+
9498
dev_info(&priv->pdev->dev, "reset done\n");
9599
return ret;
96100
}
@@ -117,16 +121,13 @@ void hbg_err_reset(struct hbg_priv *priv)
117121
if (running)
118122
dev_close(priv->netdev);
119123

120-
hbg_reset(priv);
121-
122-
/* in hbg_pci_err_detected(), we will detach first,
123-
* so we need to attach before open
124-
*/
125-
if (!netif_device_present(priv->netdev))
126-
netif_device_attach(priv->netdev);
124+
if (hbg_reset(priv))
125+
goto err_unlock;
127126

128127
if (running)
129128
dev_open(priv->netdev, NULL);
129+
130+
err_unlock:
130131
rtnl_unlock();
131132
}
132133

@@ -160,7 +161,6 @@ static pci_ers_result_t hbg_pci_err_slot_reset(struct pci_dev *pdev)
160161
pci_save_state(pdev);
161162

162163
hbg_err_reset(priv);
163-
netif_device_attach(netdev);
164164
return PCI_ERS_RESULT_RECOVERED;
165165
}
166166

drivers/net/ethernet/hisilicon/hibmcge/hbg_ethtool.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,9 @@ static void hbg_update_stats_by_info(struct hbg_priv *priv,
317317
const struct hbg_ethtool_stats *stats;
318318
u32 i;
319319

320+
if (test_bit(HBG_NIC_STATE_RESETTING, &priv->state))
321+
return;
322+
320323
for (i = 0; i < info_len; i++) {
321324
stats = &info[i];
322325
if (!stats->reg)

0 commit comments

Comments
 (0)