From nobody Mon Feb 9 02:15:48 2026 Received: from canpmsgout02.his.huawei.com (canpmsgout02.his.huawei.com [113.46.200.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FDF933B962; Tue, 21 Oct 2025 14:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.217 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761055251; cv=none; b=Ku85qkGeaSUcEAKtmSuCmAAeKyfw0hNgixjTmwxi6n1kd/oYclVtcbthxGGVbLoOBMAqHml/PRnkxn4Ac7lHVTxgELrgv9F8soBR02mnaAoLYZ1l5c/nSdu/rJGqUL6bcivJ+U1caKEZJQkxPn2Aa0NdjMH5F5I7VRzb86+DC6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761055251; c=relaxed/simple; bh=EnfkgqqK3xwtWurI53NBT0VHCNA4DyaNgjxfw0MCWLg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lCbQ3rPIssY5Uje3/h0o8KO/6esscCcJFB6AZ9rgSWgpZZIhW6EZw7vs0uNPH8R60i7wUI8tsgcNZYyzo0itI4rUFRe+mSg37rVc99wPtKvKV5y2yZY7H1VCorJJtWMKjYuO15ERGwXad0i/1EDTFlsf96jB8HH8KsG244+Y/kE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=f3rOvkGP; arc=none smtp.client-ip=113.46.200.217 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="f3rOvkGP" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=tLIoJWBipdWp8OO0fBqhvZFWq5wU9ioxaDDeO6NlDpg=; b=f3rOvkGP5Us3mzzQiKWUYHxOxVP66IN00w/sKk+nsKF9/1fwjrsGSkLE4GLzVt8VDQaIHL224 /avRp0kNSwU8r0XQd29s6n3kUkF5AtLLi47NuEnwYEYOmvZnU015+3MJLNSQLPypOtWBIh5LMDi yGZXa6+LrLbNqEFG73UD/Ds= Received: from mail.maildlp.com (unknown [172.19.88.105]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4crYnf6zghzcb1s; Tue, 21 Oct 2025 21:59:34 +0800 (CST) Received: from kwepemk100013.china.huawei.com (unknown [7.202.194.61]) by mail.maildlp.com (Postfix) with ESMTPS id 97369140155; Tue, 21 Oct 2025 22:00:44 +0800 (CST) Received: from localhost.localdomain (10.90.31.46) by kwepemk100013.china.huawei.com (7.202.194.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Oct 2025 22:00:43 +0800 From: Jijie Shao To: , , , , , CC: , , , , , , , , , , Subject: [PATCH net 1/3] net: hibmcge: fix rx buf avl irq is not re-enabled in irq_handle issue Date: Tue, 21 Oct 2025 22:00:14 +0800 Message-ID: <20251021140016.3020739-2-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20251021140016.3020739-1-shaojijie@huawei.com> References: <20251021140016.3020739-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100001.china.huawei.com (7.221.188.238) To kwepemk100013.china.huawei.com (7.202.194.61) Content-Type: text/plain; charset="utf-8" irq initialized with the macro HBG_ERR_IRQ_I will automatically be re-enabled, whereas those initialized with the macro HBG_IRQ_I will not be re-enabled. Since the rx buf avl irq is initialized using the macro HBG_IRQ_I, it needs to be actively re-enabled. Fixes: fd394a334b1c ("net: hibmcge: Add support for abnormal irq handling f= eature") Signed-off-by: Jijie Shao --- drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c b/drivers/net= /ethernet/hisilicon/hibmcge/hbg_irq.c index 8af0bc4cca21..ae4cb35186d8 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c @@ -32,6 +32,7 @@ static void hbg_irq_handle_rx_buf_val(struct hbg_priv *pr= iv, const struct hbg_irq_info *irq_info) { priv->stats.rx_fifo_less_empty_thrsld_cnt++; + hbg_hw_irq_enable(priv, irq_info->mask, true); } =20 #define HBG_IRQ_I(name, handle) \ --=20 2.33.0 From nobody Mon Feb 9 02:15:48 2026 Received: from canpmsgout06.his.huawei.com (canpmsgout06.his.huawei.com [113.46.200.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B922533CEBF; Tue, 21 Oct 2025 14:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.221 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761055255; cv=none; b=aC3mfaGqZ9mlX3jyCQ+WtrN1w3Exm6fwQ82l3ALFU7eDkjGZV6dlmFdTBfLdVpheb5Y5XTrtI8YscNNYvjSk06UfLjhEWxiSj6mBK8HbaKpI3tMwAKfKtbs/ez1LaL6AtSVgefOG01/ZRcFXdEX0x926gXGxQ+6U3RQzcU7AYZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761055255; c=relaxed/simple; bh=gMIsksCQwqW2WOBKE1WoapjqbMI/EM72ZloxIN93b7I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cwd9hb9r+a2SED7ZvdSLG/SvMuLUHxyvNxDNYTisWceZ4oDD0NcCK+kmHLTp+5yxXZ7le993lkCsc+RXR5Q5MA3rEWIQQatmgqQ+xDSHp/Jc/9CHeE4zgNBLnMbtGPUIRfNszYERaeov2tWfiODV7DErxWbw/q2rRjWgH1i97f0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=ECwFJ8/z; arc=none smtp.client-ip=113.46.200.221 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="ECwFJ8/z" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=aaFhJKGeApZV5kHQ1f9y5s5XqI9oMdC5Ee/Le7sF7BY=; b=ECwFJ8/zyMcNEApe4Dd6/mHOX4vTrIAMlxcshIoxD5e5O/v8lHq7/H2bON+ZMExJD3gq4axpH LyEzYB79L8jV+e/i9yE7eahQ2lv+iNvxl3HX5fZYIyax8CQgwyil3xHDn6ei9gSyxvT2xXMZPnf gRblb0uXpRLsA+m12NdytkU= Received: from mail.maildlp.com (unknown [172.19.163.252]) by canpmsgout06.his.huawei.com (SkyGuard) with ESMTPS id 4crYpX5t6GzRhR0; Tue, 21 Oct 2025 22:00:20 +0800 (CST) Received: from kwepemk100013.china.huawei.com (unknown [7.202.194.61]) by mail.maildlp.com (Postfix) with ESMTPS id 24714180B5A; Tue, 21 Oct 2025 22:00:45 +0800 (CST) Received: from localhost.localdomain (10.90.31.46) by kwepemk100013.china.huawei.com (7.202.194.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Oct 2025 22:00:44 +0800 From: Jijie Shao To: , , , , , CC: , , , , , , , , , , Subject: [PATCH net 2/3] net: hibmcge: remove unnecessary check for np_link_fail in scenarios without phy. Date: Tue, 21 Oct 2025 22:00:15 +0800 Message-ID: <20251021140016.3020739-3-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20251021140016.3020739-1-shaojijie@huawei.com> References: <20251021140016.3020739-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100001.china.huawei.com (7.221.188.238) To kwepemk100013.china.huawei.com (7.202.194.61) Content-Type: text/plain; charset="utf-8" hibmcge driver uses fixed_phy to configure scenarios without PHY, where the driver is always in a linked state. However, there might be no link in hardware, so the np_link error is detected in hbg_hw_adjust_link(), which can cause abnormal logs. Therefore, in scenarios without a PHY, the driver no longer checks the np_link status. Fixes: 1d7cd7a9c69c ("net: hibmcge: support scenario without PHY") Signed-off-by: Jijie Shao --- drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h | 1 + drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c | 3 +++ drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h b/drivers/= net/ethernet/hisilicon/hibmcge/hbg_common.h index ea09a09c451b..2097e4c2b3d7 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h @@ -17,6 +17,7 @@ #define HBG_PCU_CACHE_LINE_SIZE 32 #define HBG_TX_TIMEOUT_BUF_LEN 1024 #define HBG_RX_DESCR 0x01 +#define HBG_NO_PHY 0xFF =20 #define HBG_PACKET_HEAD_SIZE ((HBG_RX_SKIP1 + HBG_RX_SKIP2 + \ HBG_RX_DESCR) * HBG_PCU_CACHE_LINE_SIZE) diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c b/drivers/net/= ethernet/hisilicon/hibmcge/hbg_hw.c index d0aa0661ecd4..d6e8ce8e351a 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c @@ -244,6 +244,9 @@ void hbg_hw_adjust_link(struct hbg_priv *priv, u32 spee= d, u32 duplex) =20 hbg_hw_mac_enable(priv, HBG_STATUS_ENABLE); =20 + if (priv->mac.phy_addr =3D=3D HBG_NO_PHY) + return; + /* wait MAC link up */ ret =3D readl_poll_timeout(priv->io_base + HBG_REG_AN_NEG_STATE_ADDR, link_status, diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c b/drivers/ne= t/ethernet/hisilicon/hibmcge/hbg_mdio.c index 37791de47f6f..b6f0a2780ea8 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c @@ -20,7 +20,6 @@ #define HBG_MDIO_OP_INTERVAL_US (5 * 1000) =20 #define HBG_NP_LINK_FAIL_RETRY_TIMES 5 -#define HBG_NO_PHY 0xFF =20 static void hbg_mdio_set_command(struct hbg_mac *mac, u32 cmd) { --=20 2.33.0 From nobody Mon Feb 9 02:15:48 2026 Received: from canpmsgout01.his.huawei.com (canpmsgout01.his.huawei.com [113.46.200.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F58633B958; Tue, 21 Oct 2025 14:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.216 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761055251; cv=none; b=fASuYrDMcUbdT3d0T7OQoTE/DUZQWAcjdFcI940tlU4uORiRdOvbAe0za0735pAFlACmnJ9Qdwry2p9P3WzGIXTukxtgs0X1N6DfEI6gEOfjU1BEneoXg6Kl8VJNYUWLjdbEvGVl0gnFvCtMXmWuAB+yLWNe3BK+2/1xNHl8olw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761055251; c=relaxed/simple; bh=Z4e+Rda2bYfjLOZMWdTklKDon1bvj8FeVYa8pl1efVc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Y+PqoIYbv5BXgoFRtkRY6f3pt6pZ2IXbVPzD4FdV8X/AIwMiCOId96xLp+nTMTfYswzj2HnaevWb1eMT4gelhIUh5e3+EAOvLyAYeIkhGeQrV+kdRfrMdKSW6pUIrtVByeZ1em/iTbh/soSfFWe3Enb3X86C82QCNmXD3mQkYvo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=I+ERaNQe; arc=none smtp.client-ip=113.46.200.216 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="I+ERaNQe" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=opBLMIIAqFH/C9JqHJAmW6L6I2eQ3SJbotO5tszdkkw=; b=I+ERaNQevgxnbk0VcY7vk1EyDWj5hZ8e1WqC3F+EYXUFBWEfYX+f4RpWr4qcmryBYiGgO82gy p8ZZqwYykXuR7NKWF9a6YSdwqNSI8PN59ADJFyWyOquVbn0MLbJMo28Y0QIdZL5EZ+pmFc53jFp ufGyDdtKdkbcSgMb0K02Yf8= Received: from mail.maildlp.com (unknown [172.19.88.105]) by canpmsgout01.his.huawei.com (SkyGuard) with ESMTPS id 4crYp047dgz1T4Kh; Tue, 21 Oct 2025 21:59:52 +0800 (CST) Received: from kwepemk100013.china.huawei.com (unknown [7.202.194.61]) by mail.maildlp.com (Postfix) with ESMTPS id 9B950140155; Tue, 21 Oct 2025 22:00:45 +0800 (CST) Received: from localhost.localdomain (10.90.31.46) by kwepemk100013.china.huawei.com (7.202.194.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Oct 2025 22:00:44 +0800 From: Jijie Shao To: , , , , , CC: , , , , , , , , , , Subject: [PATCH net 3/3] net: hibmcge: fix the inappropriate netif_device_detach() Date: Tue, 21 Oct 2025 22:00:16 +0800 Message-ID: <20251021140016.3020739-4-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20251021140016.3020739-1-shaojijie@huawei.com> References: <20251021140016.3020739-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100001.china.huawei.com (7.221.188.238) To kwepemk100013.china.huawei.com (7.202.194.61) Content-Type: text/plain; charset="utf-8" current, driver will call netif_device_detach() in pci_error_handlers.error_detected() and do reset in pci_error_handlers.slot_reset(). However, if pci_error_handlers.slot_reset() is not called after pci_error_handlers.error_detected(), driver will be detached and unable to recover. drivers/pci/pcie/err.c/report_error_detected() says: If any device in the subtree does not have an error_detected callback, PCI_ERS_RESULT_NO_AER_DRIVER prevents subsequent error callbacks of any device in the subtree, and will exit in the disconnected error state. Therefore, when the hibmcge device and other devices that do not support the error_detected callback are under the same subtree, hibmcge will be unable to do slot_reset. This path move netif_device_detach from error_detected to slot_reset, ensuring that detach and reset are always executed together. Fixes: fd394a334b1c ("net: hibmcge: Add support for abnormal irq handling f= eature") Signed-off-by: Jijie Shao --- drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c b/drivers/net= /ethernet/hisilicon/hibmcge/hbg_err.c index 83cf75bf7a17..e11495b7ee98 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c @@ -136,12 +136,11 @@ static pci_ers_result_t hbg_pci_err_detected(struct p= ci_dev *pdev, { struct net_device *netdev =3D pci_get_drvdata(pdev); =20 - netif_device_detach(netdev); - - if (state =3D=3D pci_channel_io_perm_failure) + if (state =3D=3D pci_channel_io_perm_failure) { + netif_device_detach(netdev); return PCI_ERS_RESULT_DISCONNECT; + } =20 - pci_disable_device(pdev); return PCI_ERS_RESULT_NEED_RESET; } =20 @@ -150,6 +149,9 @@ static pci_ers_result_t hbg_pci_err_slot_reset(struct p= ci_dev *pdev) struct net_device *netdev =3D pci_get_drvdata(pdev); struct hbg_priv *priv =3D netdev_priv(netdev); =20 + netif_device_detach(netdev); + pci_disable_device(pdev); + if (pci_enable_device(pdev)) { dev_err(&pdev->dev, "failed to re-enable PCI device after reset\n"); --=20 2.33.0