OSDN Git Service

net: ethernet: stmmac: dwmac-rk: make clk enablement first in powerup
authorHeiko Stübner <heiko@sntech.de>
Tue, 20 Dec 2016 16:17:06 +0000 (17:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Dec 2016 18:25:39 +0000 (13:25 -0500)
commitf217bfde24077b6684e625dd618e3a522e6f272a
treeda84521ef31b1a870db892a972379806f7cbff77
parent76b15923b777aa2660029629179550124c1fc40e
net: ethernet: stmmac: dwmac-rk: make clk enablement first in powerup

Right now the dwmac-rk tries to set up the GRF-specific speed and link
options before enabling clocks, phys etc and on previous socs this works
because the GRF is supplied on the whole by one clock.

On the rk3399 however the GRF (General Register Files) clock-supply
has been split into multiple clocks and while there is no specific
grf-gmac clock like for other sub-blocks, it seems the mac-specific
portions are actually supplied by the general mac clock.

This results in hangs on rk3399 boards if the driver is build as module.
When built in te problem of course doesn't surface, as the clocks
are of course still on at the stage before clock_disable_unused.

To solve this, simply move the clock enablement to the first position
in the powerup callback. This is also a good idea in general to
enable clocks before everything else.

Tested on rk3288, rk3368 and rk3399 the dwmac still works on all of them.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c