linux/drivers/mmc/host
Bartlomiej Zolnierkiewicz 221414db19 mmc: sdhci-s3c: fix runtime PM handling on sdhci_add_host() failure
Runtime Power Management handling for the sdhci_add_host() failure
case in sdhci_s3c_probe() should match the code in sdhci_s3c_remove()
(which uses pm_runtime_disable() call which matches the earlier
pm_runtime_enable() one).  Fix it.

This patch fixes "BUG: spinlock bad magic on CPU#0, swapper/0/1" and
"Unbalanced pm_runtime_enable!" warnings.

>From the kernel log:
...
[    1.659631] s3c-sdhci 12530000.sdhci: sdhci_add_host() failed
[    1.665096] BUG: spinlock bad magic on CPU#0, swapper/0/1
[    1.670433]  lock: 0xea01e484, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
[    1.677895] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.16.0-next-20140804-00008-ga59480f-dirty #707
[    1.687037] [<c0013ae4>] (unwind_backtrace) from [<c0010d70>] (show_stack+0x10/0x14)
[    1.694740] [<c0010d70>] (show_stack) from [<c04050c8>] (dump_stack+0x68/0xb8)
[    1.701948] [<c04050c8>] (dump_stack) from [<c0052558>] (do_raw_spin_lock+0x15c/0x1a4)
[    1.709848] [<c0052558>] (do_raw_spin_lock) from [<c040a630>] (_raw_spin_lock_irqsave+0x20/0x28)
[    1.718619] [<c040a630>] (_raw_spin_lock_irqsave) from [<c030d7d0>] (sdhci_do_set_ios+0x1c/0x5cc)
[    1.727464] [<c030d7d0>] (sdhci_do_set_ios) from [<c030ddfc>] (sdhci_runtime_resume_host+0x50/0x104)
[    1.736574] [<c030ddfc>] (sdhci_runtime_resume_host) from [<c02462dc>] (pm_generic_runtime_resume+0x2c/0x40)
[    1.746383] [<c02462dc>] (pm_generic_runtime_resume) from [<c0247898>] (__rpm_callback+0x34/0x70)
[    1.755233] [<c0247898>] (__rpm_callback) from [<c02478fc>] (rpm_callback+0x28/0x88)
[    1.762958] [<c02478fc>] (rpm_callback) from [<c02486f0>] (rpm_resume+0x384/0x4ec)
[    1.770511] [<c02486f0>] (rpm_resume) from [<c02488b0>] (pm_runtime_forbid+0x58/0x64)
[    1.778325] [<c02488b0>] (pm_runtime_forbid) from [<c030ea70>] (sdhci_s3c_probe+0x4a4/0x540)
[    1.786749] [<c030ea70>] (sdhci_s3c_probe) from [<c02429cc>] (platform_drv_probe+0x2c/0x5c)
[    1.795076] [<c02429cc>] (platform_drv_probe) from [<c02415f0>] (driver_probe_device+0x114/0x234)
[    1.803929] [<c02415f0>] (driver_probe_device) from [<c024179c>] (__driver_attach+0x8c/0x90)
[    1.812347] [<c024179c>] (__driver_attach) from [<c023ffb4>] (bus_for_each_dev+0x54/0x88)
[    1.820506] [<c023ffb4>] (bus_for_each_dev) from [<c0240df8>] (bus_add_driver+0xd8/0x1cc)
[    1.828665] [<c0240df8>] (bus_add_driver) from [<c0241db8>] (driver_register+0x78/0xf4)
[    1.836652] [<c0241db8>] (driver_register) from [<c00088a4>] (do_one_initcall+0x80/0x1d0)
[    1.844816] [<c00088a4>] (do_one_initcall) from [<c059ac94>] (kernel_init_freeable+0x108/0x1d4)
[    1.853503] [<c059ac94>] (kernel_init_freeable) from [<c0401300>] (kernel_init+0x8/0xe4)
[    1.861568] [<c0401300>] (kernel_init) from [<c000e538>] (ret_from_fork+0x14/0x3c)
[    1.869582] platform 12530000.sdhci: Driver s3c-sdhci requests probe deferral
...
[    1.997047] s3c-sdhci 12530000.sdhci: Unbalanced pm_runtime_enable!
...
[    2.027235] s3c-sdhci 12530000.sdhci: sdhci_add_host() failed
[    2.032884] platform 12530000.sdhci: Driver s3c-sdhci requests probe deferral
...

Tested on Hardkernel's Exynos4412 based ODROID-U3 board.

Fixes: 9f4e8151db ("mmc: sdhci-s3c: Enable runtime power management")
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-09-08 10:23:04 +02:00
..
android-goldfish.c mmc: remove unnecessary platform_set_drvdata() 2013-05-26 14:23:23 -04:00
atmel-mci-regs.h mmc: atmel-mci: AP700x PDC is not connected to MCI 2012-10-03 10:05:23 -04:00
atmel-mci.c mmc: atmel-mci: incude asm/cacheclush.h 2014-06-12 10:50:14 +02:00
au1xmmc.c MIPS: Alchemy: au1xmmc: use clk framework 2014-07-30 14:11:42 +02:00
bfin_sdh.c mmc: bfin_sdh: Move away from using deprecated APIs 2013-10-30 20:26:36 -04:00
cb710-mmc.c mmc: cb710: Move away from using deprecated APIs 2013-10-30 20:26:37 -04:00
cb710-mmc.h mmc: host: use platform_{get,set}_drvdata() 2013-06-27 11:13:02 -04:00
davinci_mmc.c mmc: davinci: Remove redundant of_match_ptr 2014-02-25 15:42:55 -05:00
dw_mmc-exynos.c mmc: dw_mmc: exynos: Staticize dw_mci_exynos_pmops 2014-05-12 18:04:30 -04:00
dw_mmc-k3.c mmc: dw_mmc: fix possible build error 2014-03-03 14:00:56 -05:00
dw_mmc-pci.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
dw_mmc-pltfm.c mmc: dw_mmc: Add support for SOCFPGA's platform specific implementation 2014-02-26 21:30:12 -05:00
dw_mmc-pltfm.h mmc: remove use of __devexit 2012-11-28 12:28:18 -08:00
dw_mmc.c mmc: dw_mmc: Slot quirk "disable-wp" is deprecated. 2014-08-11 11:42:39 +02:00
dw_mmc.h mmc: dw_mmc: change to use recommended reset procedure 2014-08-11 09:52:55 +02:00
jz4740_mmc.c mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response 2014-05-12 18:08:22 -04:00
Kconfig mmc: sdhci-msm: Get COMPILE_TEST support 2014-07-26 11:08:17 +02:00
Makefile mmc: sdhci-st: Intial support for ST SDHCI controller 2014-07-10 09:11:18 +02:00
mmc_spi.c drivers/mmc/host/mmc_spi.c: Use get/put_unaligned_be32 2014-05-16 14:26:52 -04:00
mmci.c mmc: mmci: Reverse IRQ handling for the arm_variant 2014-08-11 10:24:23 +02:00
mmci.h mmc: mmci: Add Qcom specific rx_fifocnt logic. 2014-07-09 11:25:57 +02:00
moxart-mmc.c mmc: moxart: Remove unneeded version.h inclusion 2014-07-09 11:26:06 +02:00
msm_sdcc.c mmc: msm_sdcc: Move away from using deprecated APIs 2013-10-30 20:26:41 -04:00
msm_sdcc.h
mvsdio.c mmc: mvsdio: avoid compiler warning 2014-06-12 10:50:27 +02:00
mvsdio.h
mxcmmc.c mmc: mxcmmc: Use mmc_regulator_get_supply() API 2014-05-12 18:08:24 -04:00
mxs-mmc.c mmc: mxs: fix card detection in case of 'broken-cd' flag set 2014-07-09 11:26:12 +02:00
of_mmc_spi.c mmc: mmc_spi: Support CD/RO GPIOs 2013-08-24 23:45:22 -04:00
omap_hsmmc.c mmc: omap_hsmmc: Pin remux workaround to support SDIO interrupt on AM335x 2014-07-09 11:26:06 +02:00
omap.c mmc: omap: Use DIV_ROUND_UP instead of open coded 2014-05-22 08:33:31 -04:00
pxamci.c mmc: pxamci: Remove redundant suspend and resume callbacks 2013-10-30 20:28:29 -04:00
pxamci.h
rtsx_pci_sdmmc.c mmc: rtsx: add support for async request 2014-07-09 14:17:15 +01:00
rtsx_usb_sdmmc.c mmc: rtsx: fix possible linking error if built-in 2014-05-12 18:08:23 -04:00
s3cmci.c mmc: s3cmci: port DMA code to dmaengine API 2014-07-09 11:26:13 +02:00
s3cmci.h mmc: s3cmci: port DMA code to dmaengine API 2014-07-09 11:26:13 +02:00
sdhci-acpi.c mmc: sdhci: add DDR50 1.8V mode support for BayTrail eMMC Controller 2014-07-10 14:58:29 +02:00
sdhci-bcm2835.c mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function 2014-05-22 08:33:11 -04:00
sdhci-bcm-kona.c mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function 2014-05-22 08:33:11 -04:00
sdhci-cns3xxx.c mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function 2014-05-22 08:33:11 -04:00
sdhci-dove.c mmc: sdhci-dove: use mmc_of_parse() and remove card_tasklet CD handler 2014-05-23 08:42:02 -04:00
sdhci-esdhc-imx.c mmc: sdhci-esdhc-imx: fix mmc ddr mode regression issue 2014-05-22 08:40:45 -04:00
sdhci-esdhc.h mmc: sdhci: convert sdhci_set_clock() into a library function 2014-05-22 07:26:32 -04:00
sdhci-msm.c mmc: sdhci-msm: Remove unnecessary header file inclusion 2014-07-26 11:08:11 +02:00
sdhci-of-arasan.c mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function 2014-05-22 08:33:11 -04:00
sdhci-of-esdhc.c mmc: sdhci-of-esdhc: Fixup compile error 2014-05-23 09:16:53 -04:00
sdhci-of-hlwd.c mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function 2014-05-22 08:33:11 -04:00
sdhci-pci-data.c
sdhci-pci-o2micro.c mmc: sdhci-pci-o2micro: Add SeaBird SeaEagle SD3 support 2014-05-22 08:40:44 -04:00
sdhci-pci-o2micro.h mmc: sdhci-pci-o2micro: Add SeaBird SeaEagle SD3 support 2014-05-22 08:40:44 -04:00
sdhci-pci.c mmc: sdhci-pci: remove PCI PM functions in suspend/resume callback 2014-07-26 11:23:41 +02:00
sdhci-pci.h mmc: sdhci-pci: SDIO host controller support for Intel Quark X1000 2014-07-09 11:26:10 +02:00
sdhci-pltfm.c mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function 2014-05-22 08:33:11 -04:00
sdhci-pltfm.h mmc: sdhci-pltfm: export pltfm suspend/resume api 2014-01-13 12:48:06 -05:00
sdhci-pxav2.c mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function 2014-05-22 08:33:11 -04:00
sdhci-pxav3.c mmc: sdhci-pxav3: Use devm_* managed helpers 2014-08-11 08:53:04 +02:00
sdhci-s3c-regs.h mmc: sdhci-s3c: remove platform dependencies 2013-04-19 13:51:23 +02:00
sdhci-s3c.c mmc: sdhci-s3c: fix runtime PM handling on sdhci_add_host() failure 2014-09-08 10:23:04 +02:00
sdhci-sirf.c mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function 2014-05-22 08:33:11 -04:00
sdhci-spear.c mmc: sdhci: convert sdhci_set_uhs_signaling() into a library function 2014-05-22 08:33:11 -04:00
sdhci-st.c mmc: sdhci-st: Intial support for ST SDHCI controller 2014-07-10 09:11:18 +02:00
sdhci-tegra.c mmc: tegra: Do not include asm/gpio.h 2014-07-09 11:26:13 +02:00
sdhci.c mmc: sdhci: Replace host->mmc with mmc where possible 2014-07-09 11:26:11 +02:00
sdhci.h mmc: sdhci: remove platform_suspend/platform_resume callbacks 2014-05-22 08:33:28 -04:00
sdricoh_cs.c mmc: sdricoh_cs: Move away from using deprecated APIs 2013-10-30 20:28:32 -04:00
sh_mmcif.c mmc: sh_mmcif: Configure DMA slave bus width 2014-07-26 11:38:19 +02:00
sh_mobile_sdhi.c mmc: sdhi: update sh_mobile_sdhi_of_data for r8a7791 2014-02-22 13:06:23 -05:00
sunxi-mmc.c mmc: sunxi: Add driver for SD/MMC hosts found on Allwinner sunxi SoCs 2014-06-03 16:52:34 -07:00
tifm_sd.c mmc: tifm_sd: Move away from using deprecated APIs 2013-10-30 20:28:23 -04:00
tmio_mmc_dma.c mmc: tmio: Configure DMA slave bus width 2014-07-26 11:38:19 +02:00
tmio_mmc_pio.c mmc: tmio: Adapt to proper PM configs for exported functions 2014-02-13 22:58:09 -05:00
tmio_mmc.c mmc: tmio_mmc: Convert from legacy to modern PM ops 2014-02-13 22:58:01 -05:00
tmio_mmc.h mmc: tmio: Adapt to proper PM configs for exported functions 2014-02-13 22:58:09 -05:00
usdhi6rol0.c mmc: usdhi6rol0: fix compiler warnings 2014-06-12 10:38:50 +02:00
ushc.c mmc: ushc: Fix incorrect parameter in sizeof 2014-02-25 15:42:20 -05:00
via-sdmmc.c mmc: via-sdmmc: Move away from using deprecated APIs 2013-10-30 20:28:36 -04:00
vub300.c mmc: vub300: Move away from using deprecated APIs 2013-10-30 20:26:43 -04:00
wbsd.c mmc: wbsd: Silence compiler warning 2013-11-08 14:32:03 -05:00
wbsd.h
wmt-sdmmc.c mmc: wmt-sdmmc: Remove deprecated IRQF_DISABLED 2014-07-09 11:26:08 +02:00