🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #9596

Re: [PATCH net] net: usb: lan78xx: only stop phylink if the interface is running

#9596
From: YuanZhe Liu
Date: Mon, 02 Nov 2026 11:29
54 lines
12003 bytes
Hi Oleksij,

Thanks for testing this on real hardware - that is worth much more than
what I can do here.

To answer your question first: I have no LAN7800/LAN7850/LAN7801 board.
I test on a virtual device that closely matches this driver, generated by
an automated virtual-device generation tool we are developing for this
purpose; our plan is to run targeted tests against all USB drivers in the
Linux kernel with it. The WARN reproduces reliably there, but I cannot
tell you how the patch behaves with a real PHY.

You are right about the interrupt path, and it is a better explanation
than the one I gave. 30a41ed32d30 removed config_intr() and
handle_interrupt() from the internal LAN88xx driver, so
phy_drv_supports_irq() is false and phy_attach_direct() overwrites the
irq that lan78xx_phy_init() has just set:

  drivers/net/usb/lan78xx.c:2896	phydev->irq = dev->domain_data.phyirq;
  drivers/net/phy/phy_device.c:1854	if (!phy_drv_supports_irq(phydev->drv) &&
  drivers/net/phy/phy_device.c:1855	    phy_interrupt_is_valid(phydev))
  drivers/net/phy/phy_device.c:1855		phydev->irq = PHY_POLL;

phylink_bringup_phy() then skips phy_request_interrupt() because
phy_interrupt_is_valid() is false (phylink.c:2213), so nobody calls
request_threaded_irq() for the mapping, lan78xx_irq_unmask() never runs
for it and the PHY bit is never programmed into INT_EP_CTL through the
irqchip. So for the internal PHY the PHY interrupt path is dead, and my
remark about lan78xx_remove_irq_domain() was describing a path that does
not execute in this configuration. Thank you for pointing it out.

That does not affect this patch. The warning comes from phy_stop()
reaching a PHY that was never started, which has nothing to do with how
the PHY interrupt is delivered, and the patch touches no interrupt
handling at all. It only moves unregister_netdev() ahead of the phylink
teardown, so that the interface is stopped by lan78xx_stop() when it was
running and not stopped when it was not. The dead interrupt path behaves
exactly as before with the patch applied.

It is also only dead for the internal PHY. For LAN7801 with an external
RGMII PHY (lan78xx_get_phy(), is_internal = false) the PHY driver can
provide config_intr and handle_interrupt, and then phyirq is really
requested.

I kept the change small on purpose so it can go to stable. I would
rather remove the dead PHY interrupt plumbing for the internal PHY in a
separate net-next patch than mix it into this fix.

If your test still produces the warning with the patch applied, could you
send me the trace? Then I can see which path it takes on your board.

Thanks,
YuanZhe
Technical Details
Message-ID: <179361899931.4450.17435057020255203640@stu.xidian.edu.cn>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354629-linux-kernel-netdev=dewy.ru
References: <20261029160204.2567-1-25031212351@stu.xidian.edu.cn> <sashiko-outbox-191206@kernel.org> <179346555447.2831.9240931140716315096@stu.xidian.edu.cn> <auhgcS6p-HDFYd7x@pengutronix.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354629-linux-kernel-netdev=dewy.ru
From: 25031212351@stu.xidian.edu.cn (YuanZhe Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: usb: lan78xx: only stop phylink if the interface
 is running
Date: Mon, 02 Nov 2026 19:29:59 +0800
Organization: Usenet Network
Message-ID: <179361899931.4450.17435057020255203640@stu.xidian.edu.cn>
References: <20261029160204.2567-1-25031212351@stu.xidian.edu.cn>
 <sashiko-outbox-191206@kernel.org>
 <179346555447.2831.9240931140716315096@stu.xidian.edu.cn>
 <auhgcS6p-HDFYd7x@pengutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2911610"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:KaGd4vuFiHXJlX1XLtVGdR96He8= sha256:h19JFHepxcC5mWskjmd9bSHYjB1hstIflVZx8BQGZnM=
	sha1:qP/4U0Mhx9YZqj4mYirE2GKhMJQ= sha256:vHJdLf1wQ5l3o8WGVM+P2ta72TX25EBBYQmRk/azlo0=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B464A1124CF; Mon,  2 Nov 2026 14:37:42 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.319
X-Spam-Status: No, score=-1.319 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1,
	DKIM_SIGNED=0.1, FROM_LOCAL_DIGITS=0.001, FROM_LOCAL_HEX=0.331,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=neutral
	reason="invalid (public key: not available)"
	header.d=stu.xidian.edu.cn
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 0zXapZnyPa73;
	Mon,  2 Nov 2026 14:37:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-354629-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=stu.xidian.edu.cn
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 4C48B1124A1; Mon,  2 Nov 2026 14:37:22 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 03BB530452; Mon,  2 Nov 2026 11:31:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793619038;
	b=5Uvw5skJSHHpfLDEAEsi+L9AgBgbHjbP1Ar+HcFVyFIlk15FhCY87ssRZanX8rMJtSiJ
	 3LyMn410FOEAZ5w02mplUewfte+6EMb0mXIH/xr37VCupuW16NQtpf/RIf7eQJSdHXKNY
	 Do9IvxywW8D5qaPASQS8MJVlXytQLsfZgaVRR4snN16iSZ79TDLFZ37D3DlApVStFrw20
	 A3J2fWiCOdI2elNaxZNG60B7KJEXFEKZ/1x/Nj0uzK+4jwzt8XbpO4FxeyxD21kSG5Mq7
	 oa89Jkb4VHemmwVeHS+O3s7I6lNSaT+EoRXYLjvEr4v2woJC64oHnlJBZfuJqvCOmvA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793619038;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To:
	 Cc:Subject:Date:Message-ID:In-Reply-To:References:Content-Type:
	 Content-Transfer-Encoding:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 X-CM-TRANSID:X-Coremail-Antispam:X-CM-SenderInfo;
	bh=Vl3NSKsKg/CSQtal7pauAg6RMNsPj+Y+d5jOU6wQ3IQ=;
	b=EXi7HZs6WUlqNxRZ4UfbrJpmu47EYrGHY58Hwt8x3Ram06FAenlOcu1/4+Emdl5xCsmc
	 PeDpM4HQs7JQxlmMzoQisc/OG+fRUWwYjEue6Zr9cy0SZdt6un6OfgZZmAI9U2dvj52HA
	 YgLDEvzp6ldyhj4OSVBjozkKpuzBzifEbIDoSGYpUggrtEb2Crd6l1rJgXjgLZR7GqH8G
	 PjjC6yi/zsnZyxBRh6c3nCDuOUxycrkQUpyx/Wnx3XCdvJ5Pf3NxuJl+3L7LB7Yt3J6l7
	 aiexYxbk/eSv+QRdZ9I9Wlo/LMTO4ISLtsRvVJ0QEUg+JHL1NfsafxcB06BC+sKVmcg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=pass header.from=stu.xidian.edu.cn;
	spf=pass smtp.mailfrom=stu.xidian.edu.cn;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id B40B960A3824;
	Mon,  2 Nov 2026 11:30:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=162.243.164.118
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793619027;
	b=iAG0HfgBAik/b6iSsj0waQeSKg52BbPT2Yf69Sl4y/GANQ9IKaNEzh5f2enbniksvCVB
	 7yuAVDshHsHWDgmcgFlcC9I7EaHq7Q/VkbQRDG21HapblqrN2H8nu7jQ9gMO/NQO54bXB
	 Oo3k5vJaa7Vrj6kq5fixVYnG7/4xfvpJRxYBQFqtuNxjJQdqcOiXDqH6b8oFdOmidXkdm
	 IrvSECfHvC1q7Ggsn05iPRNL9zSrCusQjBkXYyjPfacgqS6qqczgVkB7MEJUkxxrSvQJx
	 V8LUNEaF9Go3gGJfX4AgEs/yBux957tPVIKVn6aknUCdIqPpa2kdnJMM6Bdw4snf4Vg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793619027;
	h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date:
	 Message-ID:In-Reply-To:References:Content-Type:
	 Content-Transfer-Encoding:MIME-Version:X-CM-TRANSID:
	 X-Coremail-Antispam:X-CM-SenderInfo;
	bh=Vl3NSKsKg/CSQtal7pauAg6RMNsPj+Y+d5jOU6wQ3IQ=;
	b=BWClisRx7J9IKv+Es+oBnR3Q+MzaMzn68XGdfPGPXu3nCbxTSwAaGYIJjh0UGQ9ajHMV
	 lHM0BvxZyS1Elr/gOZIIU68wV1dj8tL/+POJ6Vki+Y3sXOU/pMO/WyiZsM5HKyc+GzqsH
	 1Vc+zAm2a7YdFlSVybN6yulHuCduDKcTFmm4wmBSMg0kxY4U/o2MngjYbwzLW/luCk3gE
	 MVR355W0bPbx0M/B6wuOpk5WbvaKkrwBfoP63m5HCeBi9id6rVhvZ883sGzyPqdRLFMMk
	 LCoWBVtCkSaQlWJ48HvnG9BOnFlrulypI9kvGac7s1CFAOkvwqCkdEx4lpncP04iWpw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=stu.xidian.edu.cn;
	spf=pass smtp.mailfrom=stu.xidian.edu.cn;
	arc=none smtp.remote-ip=162.243.164.118
X-Received: from zg8tmtyylji0my4xnjqumte4.icoremail.net (zg8tmtyylji0my4xnjqumte4.icoremail.net [162.243.164.118])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 5645E60A2604;
	Mon,  2 Nov 2026 11:30:21 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5645E60A2604
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=stu.xidian.edu.cn
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=stu.xidian.edu.cn
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=stu.xidian.edu.cn; s=dkim; h=Received:From:To:Cc:Subject:Date:
	Message-ID:In-Reply-To:References:Content-Type:
	Content-Transfer-Encoding:MIME-Version; bh=Vl3NSKsKg/CSQtal7pauA
	g6RMNsPj+Y+d5jOU6wQ3IQ=; b=L01u+KKXYyEQku6VGiV2GuBf3REy297ILf5NU
	bLzTolHMDe3mS/DBPWaRL5Mpmo3prSwgR2khUX8AK+tSr9ZUp9OSr+a+7d/25kCN
	cqJbgpKSIfI06L0pUD1RzsApSAnlP2c9pvUW3LbMWymTmYYpJBQCm1Tp/tZ9eL1N
	R4H3Zo=
X-Received: from [127.0.1.1] (unknown [113.200.174.101])
	by hzbj-edu-front-3.icoremail.net (Coremail) with UTF8SMTPA id BbQMCkDW2fw3dOhq_AMZAQ--.23074S2;
	Mon, 02 Nov 2026 19:30:01 +0800 (CST)
X-Cc: sashiko-bot@kernel.org, Thangaraj Samynathan <Thangaraj.S@microchip.com>,
 UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
 linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
 Andrew Lunn <andrew+netdev@lunn.ch>, Russell King <linux@armlinux.org.uk>,
 stable@vger.kernel.org, Bin Yu <byu@xidian.edu.cn>,
 Cheng Wen <wencheng@xidian.edu.cn>
X-In-Reply-To: <auhgcS6p-HDFYd7x@pengutronix.de>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-CM-TRANSID: BbQMCkDW2fw3dOhq_AMZAQ--.23074S2
X-Coremail-Antispam: 1UD129KBjvJXoWxWw48Gw1rAF1kWFWfJr4ruFg_yoW5Xr4xpr
	W5G3Z8Cr4DJryaga17Xa1UAFy5uwsFk3y5Cwn8G3yYqw4YgFyaqr9Fva4DA3Z8CrZ5Xa4I
	qr1FvFWrCayUGF7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUU9mb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I2
	0VC2zVCF04k26cxKx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