mbox series

[net-next,v8,0/5] net: dsa: microchip: provide Wake on LAN support (part 2)

Message ID 20231026051051.2316937-1-o.rempel@pengutronix.de
Headers show
Series net: dsa: microchip: provide Wake on LAN support (part 2) | expand

Message

Oleksij Rempel Oct. 26, 2023, 5:10 a.m. UTC
This patch series introduces extensive Wake on LAN (WoL) support for the
Microchip KSZ9477 family of switches, coupled with some code refactoring
and error handling enhancements. The principal aim is to enable and
manage Wake on Magic Packet and other PHY event triggers for waking up
the system, whilst ensuring that the switch isn't reset during a
shutdown if WoL is active.

The Wake on LAN functionality is optional and is particularly beneficial
if the PME pins are connected to the SoC as a wake source or to a PMIC
that can enable or wake the SoC.

changes v8:
- rebase on top of net-next and s/slave/user/

changes v7:
- move wakeup-source after reset-gpios
- update "Wake event on port.." debug message
- add and use ksz_is_port_mac_global_usable() instead of
  ksz_switch_macaddr_get/put.

changes v6:
- add variables magic_switched_off and magic_switched_on for readability
- EXPORT_SYMBOL(ksz_switch_shutdown); to fix build as module 

changes v5:
- rework Wake on Magic Packet support.
- Make sure we show more or less realistic information on get_wol by
  comparing refcounted mac address against the ports address
- fix mac address refcounting on set_wol()
- rework shutdown sequence by to handle PMIC related issues. Make sure
  PME pin is net frequently toggled.
- use wakeup_source variable instead of reading PME pin register.

changes v4:
- add ksz_switch_shutdown() and do not skip dsa_switch_shutdown() and
  etc.
- try to configure MAC address on WAKE_MAGIC. If not possible, prevent
  WAKE_MAGIC configuration
- use ksz_switch_macaddr_get() for WAKE_MAGIC.
- prevent ksz_port_set_mac_address if WAKE_MAGIC is active
- do some more refactoring and patch reordering

changes v3:
- use ethernet address of DSA master instead from devicetree
- use dev_ops->wol* instead of list of supported switch
- don't shutdown the switch if WoL is enabled
- rework on top of latest HSR changes

changes v2:
- rebase against latest next

Oleksij Rempel (5):
  net: dsa: microchip: ksz9477: Add Wake on Magic Packet support
  net: dsa: microchip: Refactor comment for ksz_switch_macaddr_get()
    function
  net: dsa: microchip: Add error handling for ksz_switch_macaddr_get()
  net: dsa: microchip: Refactor switch shutdown routine for WoL
    preparation
  net: dsa: microchip: Ensure Stable PME Pin State for Wake-on-LAN

 drivers/net/dsa/microchip/ksz9477.c     | 103 ++++++++++++++++++++++-
 drivers/net/dsa/microchip/ksz9477.h     |   1 +
 drivers/net/dsa/microchip/ksz9477_i2c.c |   5 +-
 drivers/net/dsa/microchip/ksz_common.c  | 104 +++++++++++++++++++++---
 drivers/net/dsa/microchip/ksz_common.h  |   6 ++
 drivers/net/dsa/microchip/ksz_spi.c     |   5 +-
 6 files changed, 200 insertions(+), 24 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 27, 2023, 9:50 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 26 Oct 2023 07:10:46 +0200 you wrote:
> This patch series introduces extensive Wake on LAN (WoL) support for the
> Microchip KSZ9477 family of switches, coupled with some code refactoring
> and error handling enhancements. The principal aim is to enable and
> manage Wake on Magic Packet and other PHY event triggers for waking up
> the system, whilst ensuring that the switch isn't reset during a
> shutdown if WoL is active.
> 
> [...]

Here is the summary with links:
  - [net-next,v8,1/5] net: dsa: microchip: ksz9477: Add Wake on Magic Packet support
    https://git.kernel.org/netdev/net-next/c/3b454b6390c3
  - [net-next,v8,2/5] net: dsa: microchip: Refactor comment for ksz_switch_macaddr_get() function
    https://git.kernel.org/netdev/net-next/c/78c21fca0b39
  - [net-next,v8,3/5] net: dsa: microchip: Add error handling for ksz_switch_macaddr_get()
    https://git.kernel.org/netdev/net-next/c/818cdb0f4b38
  - [net-next,v8,4/5] net: dsa: microchip: Refactor switch shutdown routine for WoL preparation
    https://git.kernel.org/netdev/net-next/c/77c819cb493a
  - [net-next,v8,5/5] net: dsa: microchip: Ensure Stable PME Pin State for Wake-on-LAN
    https://git.kernel.org/netdev/net-next/c/8afb91acc4a3

You are awesome, thank you!