lkml.org 
[lkml]   [2021]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH net-next] net: phy: perform a PHY reset on resume
    Date
    On Sat, 2021-12-11 at 14:01 +0100, Francesco Dolcini wrote:
    > Perform a PHY reset in phy_init_hw() to ensure that the PHY is working
    > after resume. This is required if the PHY was powered down in suspend
    > like it is done by the freescale FEC driver in fec_suspend().
    >
    > Link:
    > https://lore.kernel.org/netdev/20211206101326.1022527-1-philippe.schenker@toradex.com/
    > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
    >
    > ---
    >
    > Philippe: what about something like that? Only compile tested, but I
    > see no reason for this not solving the issue.
    >
    > Any delay required on the reset can be specified using reset-assert-
    > us/reset-deassert-us.

    That would of course be the easiest way. However I understand Russel's
    concerns here, as every PHY is again different and this is basically a
    hardware-specific design.

    I like Joakin's idea to add a phy_reset_after_power_on() function in
    phylib similar to phy_reset_after_clk_enable(). I will prepare a
    patchset for that so we can discuss further there.

    Philippe
    >
    > ---
    >  drivers/net/phy/phy_device.c | 3 ++-
    >  1 file changed, 2 insertions(+), 1 deletion(-)
    >
    > diff --git a/drivers/net/phy/phy_device.c
    > b/drivers/net/phy/phy_device.c
    > index 74d8e1dc125f..7eab0c054adf 100644
    > --- a/drivers/net/phy/phy_device.c
    > +++ b/drivers/net/phy/phy_device.c
    > @@ -1158,7 +1158,8 @@ int phy_init_hw(struct phy_device *phydev)
    >  {
    >         int ret = 0;
    >  
    > -       /* Deassert the reset signal */
    > +       /* phy reset required if the phy was powered down during
    > suspend */
    > +       phy_device_reset(phydev, 1);
    >         phy_device_reset(phydev, 0);
    >  
    >         if (!phydev->drv)

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