🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20548

Re: [PATCH net-next v3] net: phy: marvell: add support for PHY LEDs polarity modes

#20548
From: Andrew Lunn
Date: Sun, 22 Nov 2026 21:55
46 lines
9925 bytes
On Sun, Nov 22, 2026 at 10:28:55PM +0100, Aleksander Jan Bajkowski wrote:
> Add the led_polarity_set callback for setting LED polarity. Implement
> this callback for the 88E1116R, 88E1318 and 88E1510 PHYs. This should
> also work on other Marvell PHYs, but I don't have access to the TRM or
> the hardware.

Marvell have an SDK called DSDT, which covers their PHYs. It is GPL
licensed, but not widely distributed. If you can find a copy, it will
give you all the details for determining which PHYs this will work
for. Just be warned, the code is horrible.

> 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.

>  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.

  Andrew
Technical Details
Message-ID: <992ef2e7-4334-4b0e-b1ea-5ac1360fefea@lunn.ch>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368847-linux-kernel-netdev=dewy.ru
References: <20261122213034.548858-1-olek2@wp.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368847-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3] net: phy: marvell: add support for PHY LEDs
 polarity modes
Date: Sun, 22 Nov 2026 22:55:31 +0100
Organization: Usenet Network
Message-ID: <992ef2e7-4334-4b0e-b1ea-5ac1360fefea@lunn.ch>
References: <20261122213034.548858-1-olek2@wp.pl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="3732149"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:kYXeXV4ET3hyOuSUVrCUZP61X14= sha256:nbpPtxOgV6VjyIwnZC3EJMO5V4ZZbBPKEfn7qsiXYG0=
	sha1:9lahT7Tuzm+JxEBPMAMqX4F51hQ= sha256:F2np+N3cKlYhRfeX1Xxou+ZteHzNE9j7IaJ83fVGIuI=
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 49342125D86; Mon, 23 Nov 2026 00:56:08 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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, 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 (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 o5-_ogmdEy5T;
	Mon, 23 Nov 2026 00:56:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-368847-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id E5E3B125D83; Mon, 23 Nov 2026 00:55:47 +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 1294722F35; Sun, 22 Nov 2026 21:55:46 +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=1795384545;
	b=BAgJ/KtfjP77iYKH3qwiyQy0GcOcdi6mtT6YmJIp7QGIuW/Kxjwz5rFYKyJztQgDlzh/
	 CKetKI1PFKt0NKZgk3uZpTZPXZpY4VWTigMJ7iGGq/QsrgmTvY9AWx2quM7Ycb1PEGGhq
	 jpdAuYTyxwGEotfmYuDm0XXdw17dASDWTBFtd4cPkoBL+SxLY0S5rkRDUAUUUtSpVAVGc
	 MFlSs7VqQR+1q+UF0K6qNSR1heuE7W7mK0dvGsEyymn4SA5OOT26Hd1XoCrUzM3BtOftB
	 QHvbXsz9W7DOf4Evg5YFJCd2TKM7lNGCecdoPqYVmS8+vfp7HPlJkO4QBSqc113AdtA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795384545;
	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=RArxLci6qXjjHqY3qFip/+FWbz0OrpEmO/qow7ct95M=;
	b=0cds4+PtDkYxE9Bnj309MffrFdoTAtkklggdulSnHNPIqmrCHUvaaKLdE+4Ykg8sYpLk
	 Cl7qZX5oQ8eWe9MDpWsPWONNoCq83mdrnZPVZmHu7XX9//dK9pEvEtqTZRtfUQitsYwt8
	 5ROmFFOtE2H2HXUG4CgfOj2ZgYY5NbfJBZkG9vyJRQe9HRqVRlwsypiiMbhaMOWn0hSpY
	 YQPUf11/NpvOrVn2R3DterwhDiAGSCRATPhb5/GAk3N5pBzqVztsZvryBdtFy5Cc91L9X
	 n5jCmI7irxPCmjGa64v8AW5IDsUW7KkIQn4r7H3bY+LAAOpxyGd0DI8UvlPx7SBYVhA==
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=31vxIvjq;
	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 C53F7606A32C;
	Sun, 22 Nov 2026 21:55:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=31vxIvjq
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=1795384545;
	b=b156QgMdXOoo2GoReuyr9I6T5sdLKiagLgqoILiclcK1rPwygZfT+G/M/9+JKNpsfVlX
	 oxnP68JJ24wLKg5iMd9KGSRkIjd3Ay6Ql/gBLCl8xWJE9fqoe2xyoG1WQDE4yaMtUbwcK
	 qOmZadaNyVym9sGH119MsBGGjKBLuRvU2pYAH/NatUKRJJHWtcb7LsafTLaH0xWryK53G
	 ePD7BDL3jwn2VF+FlBOp5t9AZdRvyrdV/iNUUAXvF5wyULYkoqBlnDChdmHR93OPNl7Uu
	 u2KPX8KSfUe6oAHiaKDz77HwnoWfF4U9E97ycnpBQcF4+XdIV3TvJmfqTcUj5Xb/9mQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795384545;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 In-Reply-To;
	bh=RArxLci6qXjjHqY3qFip/+FWbz0OrpEmO/qow7ct95M=;
	b=3RVr8ZXssVWMjCod+qX/wzpzsZQyaURjeYfvzavW7Srz8w+3Q9CEkk9h4x2ZulsM7B47
	 XfGv8A36pC2hQMbWb9GjGUMnjJORmqVZiGW3qHTEacdq89xEzEZtITAdWgqEdF53BsyoM
	 BVpRuZ47acyDYsxhhU1F38QAcpTWHVD0g7+/EwhwF9RtyCaTCtkMDEEDJjDR/6uR6YSVZ
	 09StI9SOhWjSJc+sQaYub2KxqE8vHTi2SinUyeNCwNIc9nadz7NLQ8WrLrMJIrhSfh1ab
	 ngYGFvTFY6ICN9FQtJwktb4b5U6PTfjuYWsjdEWTQbqKByUEHRUpcwMOp8yTmYF28Kw==
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=31vxIvjq;
	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 A07F5606A31A
	for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 21:55:44 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A07F5606A31A
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=RArxLci6qXjjHqY3qFip/+FWbz0OrpEmO/qow7ct95M=; b=31vxIvjqvjPQaTQ9fygTXkOSwg
	siL5Yz1T5eTUZC1FHg9PZJiuYuWRGdg5785nYiXjGMm01qMZOeILmROuPrGdkewP5A6ovJdrx60kM
	bARbdJla98jFB7RrQ+ojyEUrxOUz1vWGOZ+PALkXxwAxC+9MuX/6PFtF7B4N50LfD6x4=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xVFX1-000cxI-DE; Sun, 22 Nov 2026 22:55:31 +0100
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-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: <20261122213034.548858-1-olek2@wp.pl>