Article View: linux.kernel.netdev
Article #22064Re: [PATCH net-next v3] net: phy: marvell: add support for PHY LEDs polarity modes
From: Aleksander Jan Bajkowski
Date: Tue, 24 Nov 2026 20:08
Date: Tue, 24 Nov 2026 20:08
57 lines
10775 bytes
10775 bytes
Hi Andrew
On 22/11/2026 22:55, Andrew Lunn wrote:
> On Sun, Nov 22, 2026 at 10:28:55PM +0100, Aleksander Jan Bajkowski wrote:
>> Keep the LED polarization settings and restore them after a hardware
>> reset. This modification is actually only necessary on devices with a
>> wired PHY reset line and a driver that resets the PHY during the
>> link-up/link-down events. I found a single DTS file in OpenWRT
>> (armada-385-fortinet-fg-5xe.dtsi) that matches this hardware configuration.
> Mainline does not really care about OpenWRT. However, why does
> armada-385-fortinet-fg-5xe.dtsi do this? Is it because of an errata in
> the PHY? Such an errata we might care about.
This is not an errata. This is a direct response to sashiko's report[1]:
Take a board with a PHY reset GPIO and a MAC driver that connects the PHY
in ndo_open and disconnects it in ndo_stop. Wouldn't each "ip link set
down" followed by "ip link set up" put the LED pins back to their reset
default polarity and drive state?
This is actually a widespread issue. PHYs from various vendors restore the
default state of the registers after a hardware reset. Phylink does not
restore triggers later.
1.
https://sashiko.dev/#/message/179032601295.2160803.13373677668767022640%40kernel.org
>
>> static int marvell_config_init(struct phy_device *phydev)
>> {
>> + struct marvell_priv *priv = phydev->priv;
>> + int err;
>> +
>> /* Set default LED */
>> marvell_config_led(phydev);
>>
>> + /* Restore the LED polarity settings after a reset. */
>> + if (priv->led_polarity_mask) {
>> + err = phy_modify_paged(phydev, MII_MARVELL_LED_PAGE,
>> + MII_88E1318S_PHY_LED_POL,
>> + priv->led_polarity_mask,
>> + priv->led_polarity_val);
> This does not make much sense to me. If you have lost polarity, you
> have also likely lost the LED blinks modes. So you are only restoring
> part of the state?
>
> And this is for a device which does not even exist in mainline.
>
> I suggest KISS, throw this out.
That makes sense. I'll throw it out in the next iteration. We may
return to this topic once someone adds an dts upstream that requires
such a modification.
Best regards,
Aleksander
Technical Details
Message-ID:
<4dd66fbe-4528-4e88-91d4-87e147aa71cd@wp.pl>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370728-linux-kernel-netdev=dewy.ruReferences:
<20261122213034.548858-1-olek2@wp.pl> <992ef2e7-4334-4b0e-b1ea-5ac1360fefea@lunn.ch>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370728-linux-kernel-netdev=dewy.ru From: olek2@wp.pl (Aleksander Jan Bajkowski) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3] net: phy: marvell: add support for PHY LEDs polarity modes Date: Tue, 24 Nov 2026 21:08:13 +0100 Organization: Usenet Network Message-ID: <4dd66fbe-4528-4e88-91d4-87e147aa71cd@wp.pl> References: <20261122213034.548858-1-olek2@wp.pl> <992ef2e7-4334-4b0e-b1ea-5ac1360fefea@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="28821"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:EEWOgNjNMtqwVh+R6LhNnjljpeU= sha256:g6EzHjcAtkAwLYCsdAbQViMgTOfKHjrrpoa3Lz60soU= sha1:/iae/PBXMqj49UqjWnFPifBhReQ= sha256:TL6lyI+9WYwtlcAiDrGyyik73ppJJFFFuPNiJtdEzNo= Content-Language: pl 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 5ECE1125E2D; Tue, 24 Nov 2026 23:08:54 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.049 X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, 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=pass (2048-bit key) header.d=wp.pl 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 zdo0c0b3-Ncd; Tue, 24 Nov 2026 23:08:46 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370728-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=wp.pl X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id EC196125E2B; Tue, 24 Nov 2026 23:08:37 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 96F9B31C06; Tue, 24 Nov 2026 20:08:35 +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=1795550915; b=29kwNJ0+z1uXpDmcLLPLcge8hdwK9cZ2ypn+d/ogf6EVaBNMngVt/BEpx6YGObrYaI88 Bwm9pOcowRGXCqIkvJa7duB8zJDGby6SIVuaqMPjtKeI7grdDyz2JPO7Jo7/ZGNf0i4W1 bvMtgNHzD7T0vVlEhbhyjdx4U/m92hfNCsUhZz7YRqgCpT6Tu4qjmj5bfFHkO38wutCZm k9oukEPSby5qq+JZL9k9RysZj8cUWaMugTb1rLitwD1l+nYW1lpOVYv8zVbNBpHFwu4Np AnaD72DgrYipFX+rn6sf3qVJxAg6XY3/fzADL+x2UJdBkZu/Og4acoecc+ru5AifrJQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795550915; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Received: Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-WP-MailID:X-WP-AV:X-WP-SPAM; bh=z2zaibnJukNuiC5JwXZOB/K5mbPDbWJDM8nKChrkxvY=; b=yRhOFvP8BKe5NkbCw45zc6K50E0n4dLwYvzu1ne6aGqv8/rT43vqtepsgS5HVcbD/Oe6 hiUgHLamImrSeYXb7nD8jk3RODirF5K3R7hqX7AkOGwGJDX/irXrWU0krBirFEvK5CAam OKu1NlmUxtil6GO5wy8sfi2KkuSnLXO+sHi3XJHCusBu/0tH37GvidWzczLjOCbBA/oey 8hWjElAZ8Zfm6v7YRwph6GUlV/vhIJZraFPn+lZbCvXZEcGMKTPUeFOtpbblpnCjtdvLI Hkypvo2N+YwCmnyBMxMNnf6NznHOp8li4ezQtx5r4x2EzR6sRyxKhYcBkGDrUUYIYfA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=wp.pl header.i=@wp.pl header.a=rsa-sha256 header.s=s20261001 header.b=icpQTCG1; dmarc=pass header.from=wp.pl; spf=pass smtp.mailfrom=wp.pl; 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 68DAE606A32A; Tue, 24 Nov 2026 20:08:35 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wp.pl header.i=@wp.pl header.a=rsa-sha256 header.s=s20261001 header.b=icpQTCG1 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=212.77.101.11 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795550914; b=AocNUuUqBv3b5sy0tjUIK0qbDmKXe2bL9uv30IOHKLWu4KiSjQcoJ0doojRnchL//+bk L27B0HnN6kiaOI+1uk7G+wtntgUq2AcnQBWWD/AJW7RGonq1lMCbz0cieMODx1krx2EXV UvPZ0Bah0B2EQO2Hrsc25T2uFvJosf04lCtNo9w3BO+ib7edQs62bicoFGjFCYOU8vV/K KL75YyEETc6riwqZlzCpi7P7opj1SKf1R13twhrgtvp1uD+1FBPOYSdHRWry6cY8uAnU7 6/nZLs0KIEQH2OPydM6c51d/gBoP3aMQxBczk993a/DqdAWWyi1RZ/bTg/5OE/Zguvg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795550914; h=DMARC-Filter:Received:DKIM-Signature:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-WP-MailID: X-WP-AV:X-WP-SPAM; bh=z2zaibnJukNuiC5JwXZOB/K5mbPDbWJDM8nKChrkxvY=; b=HOG6GZ6s9lMrBuYuYn77isO6i+p4DvYKLNRLsuHsMvIMVEWkjSE/Ba5rUXk6TlX/JKR0 Wmzy/m2KP8I/6wIVXYtzib+1CRwzBHqRWA0DhsYWKckz102oAYK9VveHcam9GP9GPgZvF iN2B/aP36jTqovsqKJWgybtRiDyIHMu1RgBRKgPhzQ7s3WjKAw2beIsxj0LQJUln98+Gn Bu/k/99v8pxIPiVWDecvCRvM17DnFkJIrlIlw68Up75XB9lk5JSeASrEJrWGJ4qUPK82D w49SZXupPA7+q1eCUSL+WU2z0ujrZsJLD6s/PWaKyS/Q4Ph8ZlswthQNxVvTfEQs3Rw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=wp.pl; spf=pass smtp.mailfrom=wp.pl; dkim=pass header.d=wp.pl header.i=@wp.pl header.a=rsa-sha256 header.s=s20261001 header.b=icpQTCG1; arc=none smtp.remote-ip=212.77.101.11 X-Received: from mx4.wp.pl (mx4.wp.pl [212.77.101.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68947606A31E for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 20:08:33 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 68947606A31E X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wp.pl X-Received: (wp-smtpd smtp.wp.pl 17810 invoked from network); 24 Nov 2026 21:08:19 +0100 X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=s20261001; t=1795550899; bh=z2zaibnJukNuiC5JwXZOB/K5mbPDbWJDM8nKChrkxvY=; h=Subject:To:Cc:From; b=icpQTCG1YoURKiCWt2nEAeqitFSP5H98//xyEWy1XYbiHy3mBPV9ZMg36KlriNUlf 4YYvYd+6vlEDNgpCYFb5i+lRAi80m5FKuYSXUQuOU5KYwbKtWlpOkzQeMMsLSMqzUa 1B/r5bJkxUAsv8uh59UOqZQvmvR2J93kmf5z+1b1vAkYTcbZoMfiGW/vzh0EB53EQU tVhdiWypa2ziEV0Wynj8szZX3Tj+4ePPfTtojAZwXdwmJnhpVrl43/rbEC9LsQJJcc E+4kycviCk0OK+3ekGhIOLyrXwimHtLEJ+sULzZ3jwiZ2bnm3GZAnUWI/uoIhT7cR1 1QSiZXp0nCQsA== X-Received: from [192.168.3.224] (83.5.167.37.ipv4.supernova.orange.pl [83.5.167.37]) (envelope-sender <olek2@wp.pl>) by smtp.wp.pl (WP-SMTPD) with TLS_AES_256_GCM_SHA384 encrypted SMTP for <andrew@lunn.ch>; 24 Nov 2026 21:08:19 +0100 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-User-Agent: Mozilla Thunderbird X-Cc: skyline@mail.ru, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org X-In-Reply-To: <992ef2e7-4334-4b0e-b1ea-5ac1360fefea@lunn.ch> X-WP-MailID: a678dafce487f5e36b6837f41410cc96 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 000000A [IfME]