[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211206101326.1022527-1-philippe.schenker@toradex.com>
Date: Mon, 6 Dec 2021 11:13:24 +0100
From: Philippe Schenker <philippe.schenker@...adex.com>
To: netdev@...r.kernel.org, Joakim Zhang <qiangqing.zhang@....com>,
Fabio Estevam <festevam@...il.com>,
Fugang Duan <fugang.duan@....com>,
"David S . Miller" <davem@...emloft.net>,
Russell King <linux@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>
Cc: Philippe Schenker <philippe.schenker@...adex.com>,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH 0/2] Reset PHY in fec_resume if it got powered down
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
Powered by blists - more mailing lists