mbox series

[0/2] prevent undesired de-assertion of phy-reset

Message ID 20220301201502.28026-1-tharvey@gateworks.com
Headers show
Series prevent undesired de-assertion of phy-reset | expand

Message

Tim Harvey March 1, 2022, 8:15 p.m. UTC
Some PHY's have strict requirements on reset timings which can be
violated if the PHY is taken out of reset before a proper reset pulse is
performed.

When gpio_request_by_name is used for reset gpios without
GPIOD_IS_OUT_ACTIVE the GPIO will be de-asserted when requested taking
the PHY out of reset. Resolve this by adding the GPIOD_IS_OUT_ACTIVE
flag.

There are 42 occurances of gpio_request_by_name in U-Boot for gpio's
with 'reset' in their name yet the only one that uses
GPIOD_IS_OUT_ACTIVE is drivers/net/dwc_eth_qos.c. While I think setting
GPIOD_IS_OUT_ACTIVE is the right thing to do, I'm only changing the ones
that I have run into issues with:
 drivers/net/eth-phy-uclass.c
 drivers/net/fec_mxc.c

Both of these have functions that are called that assert, delay,
de-assert, delay such that I know they will properly be taken out of
reset.

The Linux kernel had a similar issue [1]

Tim Harvey (2):
  net: fec: prevent undesired de-assertion of phy-reset on request
  net: eth-phy: prevent undesired de-assertion of phy-reset on request

 drivers/net/eth-phy-uclass.c | 2 +-
 drivers/net/fec_mxc.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)