]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00227835 imx6q: gpmi: fix the warning when no NAND chip exits
authorHuang Shijie <b32955@freescale.com>
Thu, 11 Oct 2012 01:50:13 +0000 (09:50 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:13:11 +0000 (14:13 +0200)
commit187fc8de0c9cdfbb52dbece26408df3fbe7d66a0
treed5c762b3c98b7d22c487b0cfe77eb57357a82f68
parentc61aca1793f8d4e031c96b8240bbcb2452967957
ENGR00227835 imx6q: gpmi: fix the warning when no NAND chip exits

If there is no nand chip in the board, the kernel will prints out the
following warning message:

------------[ cut here ]------------
WARNING: at arch/arm/plat-mxc/clock.c:63 clk_disable+0x48/0x90()
clock enable/disable mismatch! clk  apbh_dma_clk
Modules linked in:
[<80044f48>] (unwind_backtrace+0x0/0xfc) from
[<80070ac0>] (warn_slowpath_common+0x4c/0x64)
[<80070ac0>] (warn_slowpath_common+0x4c/0x64) from
[<80070b6c>] (warn_slowpath_fmt+0x30/0x40)
[<80070b6c>] (warn_slowpath_fmt+0x30/0x40) from
[<8005ee60>] (clk_disable+0x48/0x90)
[<8005ee60>] (clk_disable+0x48/0x90) from
[<80255e48>] (dma_chan_put+0x4c/0x50)
[<80255e48>] (dma_chan_put+0x4c/0x50) from
[<80255f18>] (dma_release_channel+0x24/0x94)
[<80255f18>] (dma_release_channel+0x24/0x94) from
[<802ad8ec>] (release_resources+0x58/0x6c)
[<802ad8ec>] (release_resources+0x58/0x6c) from
[<80445964>] (gpmi_nand_probe+0x44c/0x4ec)
[<80445964>] (gpmi_nand_probe+0x44c/0x4ec) from
[<80281868>] (platform_drv_probe+0x18/0x1c)
[<80281868>] (platform_drv_probe+0x18/0x1c) from
[<80280590>] (driver_probe_device+0x98/0x1a4)
[<80280590>] (driver_probe_device+0x98/0x1a4) from
[<80280728>] (__driver_attach+0x8c/0x90)
[<80280728>] (__driver_attach+0x8c/0x90) from
[<8027fdd0>] (bus_for_each_dev+0x60/0x8c)
[<8027fdd0>] (bus_for_each_dev+0x60/0x8c) from
[<8027f75c>] (bus_add_driver+0x184/0x25c)
[<8027f75c>] (bus_add_driver+0x184/0x25c) from
[<80280d1c>] (driver_register+0x78/0x13c)
[<80280d1c>] (driver_register+0x78/0x13c) from
[<80022d80>] (gpmi_nand_init+0xc/0x3c)
[<80022d80>] (gpmi_nand_init+0xc/0x3c) from
[<80039478>] (do_one_initcall+0x30/0x16c)
[<80039478>] (do_one_initcall+0x30/0x16c) from
[<80008410>] (kernel_init+0x98/0x144)
[<80008410>] (kernel_init+0x98/0x144) from
[<8003ffb4>] (kernel_thread_exit+0x0/0x8)
---[ end trace c28d32057fe33a29 ]---

This mxs_dma_clk's usecount is not correctly changed which causes the kernel
shows this warning.

This patch adds proper clk_disable_unprepare/clk_prepare_enable in
the mxs-dma driver to balance the mxs_dma_clk's usecount.
Also put the mxs_dma_clk when the gpmi exits.

Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/dma/mxs-dma.c
drivers/mtd/nand/gpmi-nand/gpmi-lib.c
drivers/mtd/nand/gpmi-nand/gpmi-nand.c
drivers/mtd/nand/gpmi-nand/gpmi-nand.h