Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 441cc52

Browse files
vzapolskiynkskjames
authored andcommitted
net: lpc_eth: fix warnings caused by enabling unprepared clock
If common clock framework is configured, the driver generates warnings, which are fixed by this change: WARNING: CPU: 0 PID: 1 at linux/drivers/clk/clk.c:727 clk_core_enable+0x2c/0xa4() Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.3.0-rc2+ openbmc#141 Hardware name: LPC32XX SoC (Flattened Device Tree) Backtrace: [<>] (dump_backtrace) from [<>] (show_stack+0x18/0x1c) [<>] (show_stack) from [<>] (dump_stack+0x20/0x28) [<>] (dump_stack) from [<>] (warn_slowpath_common+0x90/0xb8) [<>] (warn_slowpath_common) from [<>] (warn_slowpath_null+0x24/0x2c) [<>] (warn_slowpath_null) from [<>] (clk_core_enable+0x2c/0xa4) [<>] (clk_core_enable) from [<>] (clk_enable+0x24/0x38) [<>] (clk_enable) from [<>] (lpc_eth_drv_probe+0xfc/0x99c) [<>] (lpc_eth_drv_probe) from [<>] (platform_drv_probe+0x50/0xa0) [<>] (platform_drv_probe) from [<>] (driver_probe_device+0x18c/0x408) [<>] (driver_probe_device) from [<>] (__driver_attach+0x70/0x94) [<>] (__driver_attach) from [<>] (bus_for_each_dev+0x74/0x98) [<>] (bus_for_each_dev) from [<>] (driver_attach+0x20/0x28) [<>] (driver_attach) from [<>] (bus_add_driver+0x11c/0x248) [<>] (bus_add_driver) from [<>] (driver_register+0xa4/0xe8) [<>] (driver_register) from [<>] (__platform_driver_register+0x50/0x64) [<>] (__platform_driver_register) from [<>] (lpc_eth_driver_init+0x18/0x20) [<>] (lpc_eth_driver_init) from [<>] (do_one_initcall+0x11c/0x1dc) [<>] (do_one_initcall) from [<>] (kernel_init_freeable+0x10c/0x1d4) [<>] (kernel_init_freeable) from [<>] (kernel_init+0x10/0xec) [<>] (kernel_init) from [<>] (ret_from_fork+0x14/0x24) Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bc3d8cf commit 441cc52

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/net/ethernet/nxp/lpc_eth.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,12 @@ static void __lpc_get_mac(struct netdata_local *pldat, u8 *mac)
476476
mac[5] = tmp >> 8;
477477
}
478478

479-
static void __lpc_eth_clock_enable(struct netdata_local *pldat,
480-
bool enable)
479+
static void __lpc_eth_clock_enable(struct netdata_local *pldat, bool enable)
481480
{
482481
if (enable)
483-
clk_enable(pldat->clk);
482+
clk_prepare_enable(pldat->clk);
484483
else
485-
clk_disable(pldat->clk);
484+
clk_disable_unprepare(pldat->clk);
486485
}
487486

488487
static void __lpc_params_setup(struct netdata_local *pldat)
@@ -1494,7 +1493,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
14941493
err_out_iounmap:
14951494
iounmap(pldat->net_base);
14961495
err_out_disable_clocks:
1497-
clk_disable(pldat->clk);
1496+
clk_disable_unprepare(pldat->clk);
14981497
clk_put(pldat->clk);
14991498
err_out_free_dev:
15001499
free_netdev(ndev);
@@ -1519,7 +1518,7 @@ static int lpc_eth_drv_remove(struct platform_device *pdev)
15191518
iounmap(pldat->net_base);
15201519
mdiobus_unregister(pldat->mii_bus);
15211520
mdiobus_free(pldat->mii_bus);
1522-
clk_disable(pldat->clk);
1521+
clk_disable_unprepare(pldat->clk);
15231522
clk_put(pldat->clk);
15241523
free_netdev(ndev);
15251524

@@ -1540,7 +1539,7 @@ static int lpc_eth_drv_suspend(struct platform_device *pdev,
15401539
if (netif_running(ndev)) {
15411540
netif_device_detach(ndev);
15421541
__lpc_eth_shutdown(pldat);
1543-
clk_disable(pldat->clk);
1542+
clk_disable_unprepare(pldat->clk);
15441543

15451544
/*
15461545
* Reset again now clock is disable to be sure

0 commit comments

Comments
 (0)