netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev <netdev@vger.kernel.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Simon Horman <simon.horman@corigine.com>,
	Christian Marangi <ansuelsmth@gmail.com>,
	SkyLake Huang <SkyLake.Huang@mediatek.com>
Subject: Re: [PATCH v2 net-next 0/3] Support offload LED blinking to PHY.
Date: Sat, 29 Jul 2023 13:38:13 +0100	[thread overview]
Message-ID: <ZMUINa552w1TH16U@makrotopia.org> (raw)
In-Reply-To: <20230624205629.4158216-1-andrew@lunn.ch>

Hi Andrew,

On Sat, Jun 24, 2023 at 10:56:26PM +0200, Andrew Lunn wrote:
> 
> Allow offloading of the LED trigger netdev to PHY drivers and
> implement it for the Marvell PHY driver. Additionally, correct the
> handling of when the initial state of the LED cannot be represented by
> the trigger, and so an error is returned.

I've used this series in my tree and implemented support for all LED-
related features in the mediatek-ge-soc PHY driver:

https://github.com/dangowrt/linux/commit/3b9b30a9a6699d290964fc76c56cfcd1dadf5651

I've noticed there is a problem when setting up the netdev trigger using
the 'linux,default-trigger' property in device tree. In this case
led_classdev_register_ext is called *before* register_netdevice has
completed.
Hence supports_hw_control returns false when the 'netdev' trigger is
initially setup as default trigger.

To resolve this, I've tried wrapping led_classdev_register_ext() and
introducing led_classdev_register_ext_nodefault() which doesn't call
out to led_trigger_set_default, so that can be done later by the
caller. However, there isn't any good existing call from netdev to phy
informing the phy that the netdev has been registered, so the phy_leds
would have to register a netdevice_notifier and wait for the
NETDEV_REGISTER events, matching against the netdev's PHY... And that
seems a bit overkill, just to support netdev trigger offloading to work
when used as a default trigger...

Any better ideas anyone?




> 
> Since v1:
> 
> Add true kerneldoc for the new entries in struct phy_driver
> Add received Reviewed-by: tags
> 
> Since v0:
> 
> Make comments in struct phy_driver look more like kerneldoc
> Add cover letter
> 
> Andrew Lunn (3):
>   led: trig: netdev: Fix requesting offload device
>   net: phy: phy_device: Call into the PHY driver to set LED offload
>   net: phy: marvell: Add support for offloading LED blinking
> 
>  drivers/leds/trigger/ledtrig-netdev.c |   8 +-
>  drivers/net/phy/marvell.c             | 243 ++++++++++++++++++++++++++
>  drivers/net/phy/phy_device.c          |  68 +++++++
>  include/linux/phy.h                   |  33 ++++
>  4 files changed, 349 insertions(+), 3 deletions(-)
> 
> -- 
> 2.40.1
> 
> 

  parent reply	other threads:[~2023-07-29 12:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-24 20:56 [PATCH v2 net-next 0/3] Support offload LED blinking to PHY Andrew Lunn
2023-06-24 20:56 ` [PATCH v2 net-next 1/3] led: trig: netdev: Fix requesting offload device Andrew Lunn
2023-07-18 19:34   ` Daniel Golle
2023-08-07 22:27     ` Andrew Lunn
2023-08-07 22:49       ` Daniel Golle
2023-08-07 23:48         ` Andrew Lunn
2023-06-24 20:56 ` [PATCH v2 net-next 2/3] net: phy: phy_device: Call into the PHY driver to set LED offload Andrew Lunn
2023-06-24 20:56 ` [PATCH v2 net-next 3/3] net: phy: marvell: Add support for offloading LED blinking Andrew Lunn
2023-06-26  3:33   ` Kalesh Anakkur Purayil
2023-07-29 12:38 ` Daniel Golle [this message]
2023-07-29 17:19   ` [PATCH v2 net-next 0/3] Support offload LED blinking to PHY Andrew Lunn

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=ZMUINa552w1TH16U@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=SkyLake.Huang@mediatek.com \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=simon.horman@corigine.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;
as well as URLs for NNTP newsgroup(s).