linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Reset PHY in fec_resume if it got powered down
@ 2021-12-06 10:13 Philippe Schenker
  2021-12-06 10:13 ` [RFC PATCH 1/2] net: fec: make fec_reset_phy not only usable once Philippe Schenker
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Philippe Schenker @ 2021-12-06 10:13 UTC (permalink / raw)
  To: netdev, Joakim Zhang, Fabio Estevam, Fugang Duan,
	David S . Miller, Russell King, Andrew Lunn, Jakub Kicinski
  Cc: Philippe Schenker, linux-kernel


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-12-14 11:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 10:13 [RFC PATCH 0/2] Reset PHY in fec_resume if it got powered down Philippe Schenker
2021-12-06 10:13 ` [RFC PATCH 1/2] net: fec: make fec_reset_phy not only usable once Philippe Schenker
2021-12-06 13:13   ` Andrew Lunn
2021-12-06 10:13 ` [RFC PATCH 2/2] net: fec: reset phy in resume if it was powered down Philippe Schenker
2021-12-07  1:58 ` [RFC PATCH 0/2] Reset PHY in fec_resume if it got " Joakim Zhang
2021-12-10 13:51   ` Philippe Schenker
2021-12-11 13:01     ` [PATCH net-next] net: phy: perform a PHY reset on resume Francesco Dolcini
2021-12-11 14:15       ` Russell King (Oracle)
2021-12-11 14:57         ` Francesco Dolcini
2021-12-14 11:58         ` Francesco Dolcini
2021-12-13  4:40       ` Joakim Zhang
2021-12-13 10:57       ` Philippe Schenker
2021-12-13  4:39     ` [RFC PATCH 0/2] Reset PHY in fec_resume if it got powered down Joakim Zhang

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).