mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jijie Shao <shaojijie@huawei.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: <shaojijie@huawei.com>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<andrew+netdev@lunn.ch>, <horms@kernel.org>,
	<Frank.Sae@motor-comm.com>, <hkallweit1@gmail.com>,
	<linux@armlinux.org.uk>, <shenjian15@huawei.com>,
	<liuyonglong@huawei.com>, <chenhao418@huawei.com>,
	<jonathan.cameron@huawei.com>, <salil.mehta@huawei.com>,
	<shiyongbang@huawei.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC net-next 2/6] net: phy: add support to set default rules
Date: Wed, 7 Jan 2026 17:40:44 +0800	[thread overview]
Message-ID: <e5fb30bf-bf8d-417a-b031-8d706422bee0@huawei.com> (raw)
In-Reply-To: <7d6fd4f6-3cc3-4a42-a726-6cbc4d902cc3@lunn.ch>


on 2025/12/18 18:12, Andrew Lunn wrote:
> On Thu, Dec 18, 2025 at 09:35:44AM +0800, Jijie Shao wrote:
>> on 2025/12/17 21:53, Andrew Lunn wrote:
>>>> Some of our boards have only one LED, and we want to indicate both
>>>> link and active(TX and RX) status simultaneously.
>>> Configuration is generally policy, which is normally done in
>>> userspace. I would suggest a udev rule.
>>>
>>> 	Andrew
>> Yes, the PHY LED framework supports configuration from user space,
>> allowing users to configure their preferred policies according to their own requirements.
>> I believe this is the original intention of the LED framework.
>>
>> However, we cannot require users to actively configure policies,
>> nor can we restrict the types of OS versions they use.
>> Therefore, I personally think that the driver should still provide a reasonable default policy
>> to ensure that the LED behavior meets the needs of most scenarios.
> The DT Maintainers are likely to push back if you add this to the DT
> binding. You are not really describing the hardware.
>
> In your case, it is the MAC driver which has access to the
> configuration you want to use. So please think about how you can add
> an API a MAC driver could use. It is not so easy, since the PHY led is
> just a Linux LED. It can be used for anything, any trigger can be
> assigned to it, like the heartbeat, CPU load, disc activity, etc. You
> also need to look at keeping the state synchronised. The netdev
> trigger will read the state of the LED when it is bound to the
> LED. After that, it assumes it is controlling the LED. Any changes
> which go direct to the LED will not be seen by the LED trigger.

Yes, a feasible approach is for the MAC driver to immediately
call `phydriver->led_hw_control_set()` after `phy_probe()` to configure this rule.
At this point, the netdev trigger for the LED has not yet been activated.

When the netdev trigger is activated, it will retrieve the initial state
from `phydriver->yt8521_led_hw_control_get()`, which is the rule we want to configure.

Thanks,
Jijie Shao



  reply	other threads:[~2026-01-07  9:40 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 12:56 [PATCH RFC net-next 0/6] Support PHY LED for hibmcge driver Jijie Shao
2025-12-15 12:57 ` [PATCH RFC net-next 1/6] net: phy: change of_phy_leds() to fwnode_phy_leds() Jijie Shao
2025-12-17 10:37   ` Jonathan Cameron
2025-12-17 13:18     ` Jijie Shao
2025-12-15 12:57 ` [PATCH RFC net-next 2/6] net: phy: add support to set default rules Jijie Shao
2025-12-16  7:09   ` Andrew Lunn
2025-12-17 12:54     ` Jijie Shao
2025-12-17 13:53       ` Andrew Lunn
2025-12-18  1:35         ` Jijie Shao
2025-12-18 10:12           ` Andrew Lunn
2026-01-07  9:40             ` Jijie Shao [this message]
2026-01-07 13:09           ` Andrew Lunn
2026-01-08  7:00             ` Jijie Shao
2026-01-08 14:31               ` Andrew Lunn
2026-01-02 11:26       ` Russell King (Oracle)
2026-01-07  9:43         ` Jijie Shao
2026-01-07  9:50           ` Russell King (Oracle)
2026-01-07 10:12             ` Jijie Shao
2025-12-15 12:57 ` [PATCH RFC net-next 3/6] net: hibmcge: create a software node for phy_led Jijie Shao
2025-12-16  7:17   ` Andrew Lunn
2025-12-17 12:57     ` Jijie Shao
2026-01-07 10:09     ` Jijie Shao
2026-01-07 13:04       ` Andrew Lunn
2026-01-08  6:57         ` Jijie Shao
2026-01-08 13:59           ` Andrew Lunn
2025-12-15 12:57 ` [PATCH RFC net-next 4/6] net: hibmcge: support get phy_leds_reg from spec register Jijie Shao
2025-12-16  7:19   ` Andrew Lunn
2025-12-17 13:02     ` Jijie Shao
2025-12-15 12:57 ` [PATCH RFC net-next 5/6] net: hibmcge: support get phy device from apci Jijie Shao
2025-12-15 12:57 ` [PATCH RFC net-next 6/6] net: phy: motorcomm: fix duplex setting error for phy leds Jijie Shao
2025-12-16  7:21   ` Andrew Lunn
2025-12-17 13:05     ` Jijie Shao
2025-12-17 13:49       ` Andrew Lunn
2025-12-18  1:39         ` Jijie Shao
2025-12-15 14:46 ` [PATCH RFC net-next 0/6] Support PHY LED for hibmcge driver Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5fb30bf-bf8d-417a-b031-8d706422bee0@huawei.com \
    --to=shaojijie@huawei.com \
    --cc=Frank.Sae@motor-comm.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=chenhao418@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=liuyonglong@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=shiyongbang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®