lkml.org 
[lkml]   [2021]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC PATCH 0/2] Reset PHY in fec_resume if it got powered down
Date

If a hardware-design is able to control power to the Ethernet PHY and
relying on software to do a reset, the PHY does no longer work after
resuming from suspend, given the PHY does need a hardware-reset.
The Freescale fec driver does currently control the reset-signal of a
phy but does not issue a reset on resume.

On Toradex Apalis iMX8 board we do have such a design where we also
don't place the RC circuit to delay the reset-line by hardware. Hence
we fully rely on software to do so.
Since I didn't manage to get the needed parts of Apalis iMX8 working
with mainline this patchset was only tested on the downstream kernel
toradex_5.4-2.3.x-imx. [1]
This kernel is based on NXP's release imx_5.4.70_2.3.0. [2]
The affected code is still the same on mainline kernel, which would
actually make me comfortable merging this patch, but due to this fact
I'm sending this as RFC maybe someone else is able to test this code.

This patchset aims to change the behavior by resetting the ethernet PHY
in fec_resume. A short description of the patches can be found below,
please find a detailed description in the commit-messages of the
respective patches.

[PATCH 2/2] net: fec: reset phy in resume if it was powered down

This patch calls fec_reset_phy just after regulator enable in
fec_resume, when the phy is resumed

[PATCH 1/2] net: fec: make fec_reset_phy not only usable once

This patch prepares the function fec_reset_phy to be called multiple
times. It stores the data around the reset-gpio in fec_enet_private.
This patch aims to do no functional changes.

[1] http://git.toradex.com/cgit/linux-toradex.git/log/?h=toradex_5.4-2.3.x-imx
[2] https://source.codeaurora.org/external/imx/linux-imx/log/?h=imx_5.4.70_2.3.0


Philippe Schenker (2):
net: fec: make fec_reset_phy not only usable once
net: fec: reset phy in resume if it was powered down

drivers/net/ethernet/freescale/fec.h | 6 ++
drivers/net/ethernet/freescale/fec_main.c | 98 ++++++++++++++++-------
2 files changed, 73 insertions(+), 31 deletions(-)

--
2.34.0

\
 
 \ /
  Last update: 2021-12-06 11:14    [W:1.989 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site