Commit d83ec0b2 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'there-are-some-bugfix-for-hibmcge-driver'

Jijie Shao says:

====================
There are some bugfix for hibmcge driver

v1: https://lore.kernel.org/20250430093127.2400813-1-shaojijie@huawei.com
====================

Link: https://patch.msgid.link/20250517095828.1763126-1-shaojijie@huawei.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents b95ed551 1b45443b
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ static int hbg_reset_prepare(struct hbg_priv *priv, enum hbg_reset_type type)
		return -EBUSY;
	}

	netif_device_detach(priv->netdev);

	priv->reset_type = type;
	set_bit(HBG_NIC_STATE_RESETTING, &priv->state);
	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)
		return ret;
	}

	netif_device_attach(priv->netdev);

	dev_info(&priv->pdev->dev, "reset done\n");
	return ret;
}
@@ -117,16 +121,13 @@ void hbg_err_reset(struct hbg_priv *priv)
	if (running)
		dev_close(priv->netdev);

	hbg_reset(priv);

	/* in hbg_pci_err_detected(), we will detach first,
	 * so we need to attach before open
	 */
	if (!netif_device_present(priv->netdev))
		netif_device_attach(priv->netdev);
	if (hbg_reset(priv))
		goto err_unlock;

	if (running)
		dev_open(priv->netdev, NULL);

err_unlock:
	rtnl_unlock();
}

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

	hbg_err_reset(priv);
	netif_device_attach(netdev);
	return PCI_ERS_RESULT_RECOVERED;
}

+3 −0
Original line number Diff line number Diff line
@@ -317,6 +317,9 @@ static void hbg_update_stats_by_info(struct hbg_priv *priv,
	const struct hbg_ethtool_stats *stats;
	u32 i;

	if (test_bit(HBG_NIC_STATE_RESETTING, &priv->state))
		return;

	for (i = 0; i < info_len; i++) {
		stats = &info[i];
		if (!stats->reg)