From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-36.mta0.migadu.com [91.218.175.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 532DF3793BD for ; Fri, 28 Aug 2026 13:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787922847; cv=none; b=ibPbQh8P/ycbPtRHxuo6juM8AHb3YE/lbrh+KQV8r4d1va0enObo6H2S0ECmVeG+l9mhUYnh5cw3lj2ugkEjdB6L31q0RRcTr5jm8YUHDdMvyoHmkxGyH5IfeLH0GZMkkXBz7SJjtWsNoqCmaFE7KWFZmyTmVtMWd33AXd0UEQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787922847; c=relaxed/simple; bh=/uU6ExnLVG8tAtofPabSQjz3nnh9Al8RD1/uyGGyRwE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cnqPk04oXQt5sRa73R2k4XZQ9uaCmE5hbmlpAUMYQVfxng8O55k5O7e2bfuVYyMyk09y/Ox6XAmrfV2ZnUZQu6Drm6Ww/zZR5W7dyPufJN5UB2dABOPrRDV96hiMcgp4up7Zn8vIB0h8LLA8bmsx8dDmaJZZGAf6yj9w6CC2Ci4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ab0mLKLS; arc=none smtp.client-ip=91.218.175.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ab0mLKLS" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=/uU6ExnLVG8tAtofPabSQjz3nnh9Al8RD1/uyGGyRwE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1787922842; v=1; x=1788527642; b=ab0mLKLSYKni1Yn1cpe1G22RYFOfCOAqM4B9Gc5qj3+XmMMNXEZRbuVfdTrFsy5o2jPM9/HJ /CMhFaWfH1jxX8uXrwrlmCJqvxrRU8exSqw7AlY/VpdFvNawsF2UevDvtc+sX1EqI0dF1s1OE7W mKOYsJ99ut+ZiAv6p5Cg0eQY= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id ffb82de6059f5183; Fri, 28 Aug 2026 13:13:52 +0000 X-Mizu-Trace-ID: ffb82de6059f5183 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Fri, 28 Aug 2026 21:13:44 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] net: pch_gbe: Propagate device restart errors from resume To: Pengpeng Hou , Andrew Lunn , "David S . Miller" Cc: Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260828105722.29952-1-pengpeng@iscas.ac.cn> From: luoxuanqiang In-Reply-To: <20260828105722.29952-1-pengpeng@iscas.ac.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2026/8/28 18:57, Pengpeng Hou 写道: > pch_gbe_up() can fail while allocating the IRQ or receive and transmit > buffers. The resume path ignores that result and attaches the netdevice > even though restart did not complete. > > Return the restart error, leave the netdevice detached, and restore the > PHY and PCI device to the suspended resource state. pch_gbe_up() > already frees allocations made before its failure. > > The issue was identified via static analysis and manually reviewed. > > Fixes: 77555ee72282 ("net: Add Gigabit Ethernet driver of Topcliff PCH") > > Assisted-by: LLM > Signed-off-by: Pengpeng Hou > --- > drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c > index 88c5c52e0e38..737bdc9d569e 100644 > --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c > +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c > @@ -2449,7 +2449,7 @@ static int pch_gbe_resume(struct device *device) > struct net_device *netdev = pci_get_drvdata(pdev); > struct pch_gbe_adapter *adapter = netdev_priv(netdev); > struct pch_gbe_hw *hw = &adapter->hw; > - u32 err; > + int err; > > err = pci_enable_device(pdev); > if (err) { > @@ -2462,8 +2462,14 @@ static int pch_gbe_resume(struct device *device) > /* Clear wake on lan control and status */ > pch_gbe_mac_set_wol_event(hw, 0); > > - if (netif_running(netdev)) > - pch_gbe_up(adapter); > + if (netif_running(netdev)) { > + err = pch_gbe_up(adapter); > + if (err) { > + pch_gbe_phy_power_down(hw); The comment in pch_gbe_phy_power_down() explicitly says that the PHY cannot be powered down when WoL is enabled or AMT is active. Please do not call it unconditionally here. Thanks, Xuanqiang > + pci_disable_device(pdev); > + return err; > + } > + } > netif_device_attach(netdev); > > return 0;