🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5543

Re: [PATCH net v2] net: usb: lan78xx: avoid NULL PHY dereference in WoL setup

#5543
From: Andrew Lunn
Date: Tue, 20 Oct 2026 14:02
26 lines
9300 bytes
On Tue, Oct 20, 2026 at 06:23:56PM +0530, Prashant Sengar wrote:
> Thanks, Andrew.
> 
> I understand that LAN78xx needs to advertise its MAC WoL capabilities and
> implement mac_wol_set() for phylink to handle controller-managed WoL.
> 
> Since this would involve additional changes and testing, I would like to keep
> v3 focused on preventing the NULL dereference by calling
> phylink_ethtool_set_wol() unconditionally.

So there are two different things.

1) Avoid the crash.
2) Make it actually work with a fixed link.

For net, you can do a quick and simple fix, which makes ethtool set
wol/get_wol return EOPNOTSUPP if there is no PHY. It did not work
before, it still does not work, so no regression. But the crash is
gone. And keep calling phylib, rather than phylink.

For net-next, you can add proper WoL support using phylink, and make
fixed-link work. Since it never worked, this is new development, so
should be for net-next.

	   Andrew
Technical Details
Message-ID: <3a48b21c-0209-4dde-9356-b127eb5fa58e@lunn.ch>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349338-linux-kernel-netdev=dewy.ru
References: <20261019193148.1381545-1-prashantsengar25031@gmail.com> <d9177176-75c2-4273-b5ba-d0c6afdad6c5@lunn.ch> <CABW1sBkKtBt0gipBNsNRWbwYy3GSDbe2d0TMBX8=whwu4WQmJg@mail.gmail.com> <7bff1292-9371-4e3e-8062-31a554aeee17@lunn.ch> <CABW1sB=n--dJDK2zieM1bzOjG3AEwfZLTZ6HJrXLG+F1R1LB1A@mail.gmail.com>

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-349338-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] net: usb: lan78xx: avoid NULL PHY dereference in
 WoL setup
Date: Tue, 20 Oct 2026 16:02:00 +0200
Organization: Usenet Network
Message-ID: <3a48b21c-0209-4dde-9356-b127eb5fa58e@lunn.ch>
References: <20261019193148.1381545-1-prashantsengar25031@gmail.com>
 <d9177176-75c2-4273-b5ba-d0c6afdad6c5@lunn.ch>
 <CABW1sBkKtBt0gipBNsNRWbwYy3GSDbe2d0TMBX8=whwu4WQmJg@mail.gmail.com>
 <7bff1292-9371-4e3e-8062-31a554aeee17@lunn.ch>
 <CABW1sB=n--dJDK2zieM1bzOjG3AEwfZLTZ6HJrXLG+F1R1LB1A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="3876892"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:B1gH1Hy4mdL2gJEf+iS1alHFabY= sha256:O/6KO2w5Vf0iSYX8+qOtvrq8W5tWatm5CAezOQu+KVQ=
	sha1:Iku7Dw3Z5S57py7oLi1gxztScwA= sha256:fG/syiwi6isUrdJKx2XturvgY8MoBb1SBWKjBzvK1nM=
Content-Disposition: inline
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 2DAAD110D3B; Tue, 20 Oct 2026 17:58:11 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.95
X-Spam-Status: No, score=-1.95 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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=pass (1024-bit key)
	header.d=lunn.ch
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 s3xEjYyLt6nI;
	Tue, 20 Oct 2026 17:58:07 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-349338-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 292B7110D3A; Tue, 20 Oct 2026 17:57:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id BF13F37EC2; Tue, 20 Oct 2026 14:02:11 +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=1792504930;
	b=sedTwxFWSk4IWBra/F9lQcqiX2UjdyuW5ehJzhlqTzn15NnzKgi5aCDLcfGKbmddun1l
	 hbATPnybCeMp1cmqgyws4e/iHfrwrqmkxbKVB0KGw3BdXwgASGaZLOfx1bPue6xVUtFy0
	 stEUxU1pGe/FEyQXxNRWA2DY4lvHUS0Y9GrkVSWTKHCgbHwn5SjJ7enFFC9ARZsM0hOeQ
	 O4Y9LYj9T3zU3IIdfd6uLKgrrG7YkUxD1+J+aiRz6a6yCZhgZQePWHjg7KZPkxcAUAmUG
	 ev8qZ2zxv+RLIP3Vh6eRQryIYhcFL3kBxvNpVvMWZEPTpoKP2qYCWZFqhd9YqrABfKg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792504930;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=3+1HCFOuIMN80iGsOQMwOgwNj3bEV3gIzKqis9v3+sA=;
	b=SR3IuP34U9W9t6sDsdwdNSl3gSrSM0i0iCdD6hh/RXSFQafT1zsvfmoGs/4UZZvIrXAO
	 lPIZ28ZfDFLS6NeG7OuS8nPTXFIUyW57W8uDDij8DpeEGrCGYQcmJbX6FkeI3NseR0udu
	 cbn8Cp0lmKh85BSCqenvcNXP9NNXC7ZToAkSh1uIRtLBR69OUfqf/VdCkrIOO66SpnxCR
	 XMwJtNlj0qjuZkfvZ02fAIqoYdZ/9Bl6aRGGSGP4xc71a2eTj3EUBza5YjNq8uZNFWDbg
	 CuPg1FGf6C3m/1UINXhC5G4vOiaq/+HUzmNvEIi86OTra/X6XQWeVudU/NK5B594UwA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=WmMrUH+L;
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	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 225C8606A324;
	Tue, 20 Oct 2026 14:02:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=WmMrUH+L
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792504926;
	b=BwuL/If2+Hu3IxtohkH2AJKk1ZDWcdG5SpChLxoLBJiZOYSA08TrO3HQPRAi9mSfCLGi
	 DGFY9HQCO4AEgfk1+NbxNUBsS6ovgmMxZLBIIH580ZFvXYWYTAK5TMKarfLMEuw3rQrr/
	 bB9iI4gnrbLl5K2rSb0kyJwiOiWSTR+97oI+vmKyap3RRKt4FaOMWAPGcSJAkR6rbHpW4
	 vsP22AY42WMcU4eRlRjh1UGlz3qSgBW/ELdHJAtNuj68Oxo6xdwBF3sE6BNoGf/cg4N36
	 iGfBdZyV4hM4dRGzH9aHgsNEOiO4KRTy5GY9qZ0Ay+a7evo31xGgFGsvkGJsHFH091g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792504926;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 In-Reply-To;
	bh=3+1HCFOuIMN80iGsOQMwOgwNj3bEV3gIzKqis9v3+sA=;
	b=lRNxkfZMQAh2A0CqmDykqwjZtnWhEqsYwt2owOrgZdifyJNSPyih8MyEjPisApwWXW7D
	 Q/CfqQfjHONw34GTepXbQFuyO4dAsWL9sPSMX17pF/UjX45s2tscMuEA1QpKZcwH9JdCF
	 FLtnc+hfAnjIVWJYPd/d2suGPfWGuhwpXUghsSNXwZsrrgG63TnY/z1G/tCbDxjgdMx9/
	 sx8x1lIyFkj6k8CH8GYaxwTNuMKuEwOPquzu7PzLYVc7r8rCkY28W8TIB/r/moyXNTCL7
	 Q34wkg9Prmtw+O26IdYs+fEoXb1cboI/gQNNzzrTRQbLvMZtYWPnslTlEfXjWFYriYA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=WmMrUH+L;
	arc=none smtp.remote-ip=156.67.10.101
X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id E956E606A31C;
	Tue, 20 Oct 2026 14:02:05 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E956E606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch;
	s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject:
	Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:
	Content-ID:Content-Description:Content-Disposition:In-Reply-To:References;
	bh=3+1HCFOuIMN80iGsOQMwOgwNj3bEV3gIzKqis9v3+sA=; b=WmMrUH+L8ohTFjXap/o2k7dg7m
	EvS6Ao5CrAHMcjflH2TU8T8ro/gCbkyDD4qJ3gNKKHFpOZA3JuHkqb1MHjAP8CTfuUgHhaDF0BkKp
	0Ea5dQyvJ9NJAym8KIXwh0FIDmQLydUohs+yN35I7F1MJ5yZccH17tVGhFzeXVLA2ulE=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xJAPg-00BrVO-Gk; Tue, 20 Oct 2026 16:02:00 +0200
X-Cc: netdev@vger.kernel.org, Thangaraj.S@microchip.com,
	UNGLinuxDriver@microchip.com, andrew+netdev@lunn.ch,
	linux-usb@vger.kernel.org
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-In-Reply-To: <CABW1sB=n--dJDK2zieM1bzOjG3AEwfZLTZ6HJrXLG+F1R1LB1A@mail.gmail.com>