[PATCH net-next v3 0/3] Support for Wake-on-LAN for Broadcom PHYs

Florian Fainelli posted 3 patches 2 years, 9 months ago
.../ethernet/broadcom/genet/bcmgenet_wol.c    |  14 ++
drivers/net/phy/bcm-phy-lib.c                 | 212 ++++++++++++++++++
drivers/net/phy/bcm-phy-lib.h                 |   5 +
drivers/net/phy/broadcom.c                    | 126 ++++++++++-
drivers/net/phy/phy_device.c                  |   5 +-
include/linux/brcmphy.h                       |  55 +++++
include/linux/phy.h                           |   4 +
7 files changed, 416 insertions(+), 5 deletions(-)
[PATCH net-next v3 0/3] Support for Wake-on-LAN for Broadcom PHYs
Posted by Florian Fainelli 2 years, 9 months ago
This patch series adds support for Wake-on-LAN to the Broadcom PHY
driver. Specifically the BCM54210E/B50212E are capable of supporting
Wake-on-LAN using an external pin typically wired up to a system's GPIO.

These PHY operate a programmable Ethernet MAC destination address
comparator which will fire up an interrupt whenever a match is received.
Because of that, it was necessary to introduce patch #1 which allows the
PHY driver's ->suspend() routine to be called unconditionally. This is
necessary in our case because we need a hook point into the device
suspend/resume flow to enable the wake-up interrupt as late as possible.

Patch #2 adds support for the Broadcom PHY library and driver for
Wake-on-LAN proper with the WAKE_UCAST, WAKE_MCAST, WAKE_BCAST,
WAKE_MAGIC and WAKE_MAGICSECURE. Note that WAKE_FILTER is supportable,
however this will require further discussions and be submitted as a RFC
series later on.

Patch #3 updates the GENET driver to defer to the PHY for Wake-on-LAN if
the PHY supports it, thus allowing the MAC to be powered down to
conserve power.

Changes in v3:

- collected Reviewed-by tags
- explicitly use return 0 in bcm54xx_phy_probe() (Paolo)

Changes in v2:

- introduce PHY_ALWAYS_CALL_SUSPEND and only have the Broadcom PHY
  driver set this flag to minimize changes to the suspend flow to only
  drivers that need it

- corrected possibly uninitialized variable in bcm54xx_set_wakeup_irq
  (Simon)

Florian Fainelli (3):
  net: phy: Allow drivers to always call into ->suspend()
  net: phy: broadcom: Add support for Wake-on-LAN
  net: bcmgenet: Add support for PHY-based Wake-on-LAN

 .../ethernet/broadcom/genet/bcmgenet_wol.c    |  14 ++
 drivers/net/phy/bcm-phy-lib.c                 | 212 ++++++++++++++++++
 drivers/net/phy/bcm-phy-lib.h                 |   5 +
 drivers/net/phy/broadcom.c                    | 126 ++++++++++-
 drivers/net/phy/phy_device.c                  |   5 +-
 include/linux/brcmphy.h                       |  55 +++++
 include/linux/phy.h                           |   4 +
 7 files changed, 416 insertions(+), 5 deletions(-)

-- 
2.34.1
Re: [PATCH net-next v3 0/3] Support for Wake-on-LAN for Broadcom PHYs
Posted by patchwork-bot+netdevbpf@kernel.org 2 years, 9 months ago
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 11 May 2023 10:21:07 -0700 you wrote:
> This patch series adds support for Wake-on-LAN to the Broadcom PHY
> driver. Specifically the BCM54210E/B50212E are capable of supporting
> Wake-on-LAN using an external pin typically wired up to a system's GPIO.
> 
> These PHY operate a programmable Ethernet MAC destination address
> comparator which will fire up an interrupt whenever a match is received.
> Because of that, it was necessary to introduce patch #1 which allows the
> PHY driver's ->suspend() routine to be called unconditionally. This is
> necessary in our case because we need a hook point into the device
> suspend/resume flow to enable the wake-up interrupt as late as possible.
> 
> [...]

Here is the summary with links:
  - [net-next,v3,1/3] net: phy: Allow drivers to always call into ->suspend()
    https://git.kernel.org/netdev/net-next/c/a7e3448086d5
  - [net-next,v3,2/3] net: phy: broadcom: Add support for Wake-on-LAN
    https://git.kernel.org/netdev/net-next/c/8baddaa9d4ba
  - [net-next,v3,3/3] net: bcmgenet: Add support for PHY-based Wake-on-LAN
    https://git.kernel.org/netdev/net-next/c/7e400ff35cbe

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html