Subject: Re: [PATCH v2 1/1 net] enet: fec: fix fail resume from suspend state

From: Markus Niebel <[email-masked]>
Date: Fri, 12 Apr 2013 17:32:33 +0200

Hello,

Am 12.04.2013 15:23, wrote Fabio Estevam:
> Hi Frank,
> 
> On Tue, Mar 26, 2013 at 11:12 PM, Frank Li <[email-masked]> wrote:
>> Without this patch
>> 1. boot with nfs (no_console_suspend)
>> 2. echo mem >/sys/power/state
>> 3. wakeup by wakesource
>> 4. print "eth0: tx queue full"
> 
> I still have issues with suspend/resume with your patch applied:
> 
> $ echo enabled >
> /sys/devices/80000000.apb/80040000.apbx/80074000.serial/tty/ttyAMA0/power/wakeup
> $ echo mem > /sys/power/state
> 
> [   31.577857] PM: Syncing filesystems ... done.
> [   31.604332] Freezing user space processes ... (elapsed 0.01 seconds) done.
> [   31.622160] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) do.
> [   31.642018] Suspending console(s) (use no_console_suspend to debug)
> [   31.666914] PM: suspend of devices complete after 12.672 msecs
> [   31.671975] PM: late suspend of devices complete after 5.007 msecs
> [   31.678542] PM: noirq suspend of devices complete after 6.521 msecs
> [   31.682147] PM: noirq resume of devices complete after 3.186 msecs
> [   31.687396] PM: early resume of devices complete after 3.464 msecs
> [   31.759982] PM: resume of devices complete after 2432.562 msecs
> 
> (Then send any char via DUART to wakeup the system)
> 
> [   31.802673] Restarting tasks ... done.
> [   33.829493] libphy: 800f0000.etherne:00 - Link is Down
> [   36.859102] FEC: MDIO read timeout
> [   38.889180] FEC: MDIO read timeout
> 

Which clock is connected to the PHY? Is it the enet_clock generated by i.MX28? Is the connection between PHY and i.MX28 RMII?

If the FEC goes through a reset the clock generated by i.MX28 may switched to MII (25 MHz). Maybe the PHY gets confused if it is working in RMII mode.

> It does not fail 100%: there are times that suspend works just fine.
>