Skip to contentSkip to conversation

sdhci-s3c suspends immediately

DISCUSSION Alexander Varnin 2 participants 2 messages Apr 12, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hello. I'm trying to bring up sdhci-s3c driver on S3C2443 SOC.
It seems to initialize correctly, but immediately after that it get suspended by some force. This turns off all interrupts, so SD controller doesn't work. I don't know, where suspend command comes from, but whole system stay in working state. I've recorded some boot log with extended verbose for a driver. It is attached.

I want to understand, why and where does this command come from. And how to turn it off. Now there is no suspend support working on my board, but i don't want to turn suspend (PM runtime) off at all, because it may be need to set it up in future. Please, help.

sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
s3c-sdhci s3c-sdhci.1: clock source 0: mmc_busclk.0 (133500000 Hz)
s3c-sdhci s3c-sdhci.1: clock source 2: mmc_busclk.2 (96000000 Hz)
sdhci_add_host
sdhci_clear_set_irqs clear -1 set 16711683
sdhci_clear_set_irqs clear -1 set 16711683
sdhci_set_card_detection 1
sdhci_clear_set_irqs clear 0 set 64
mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.1] using PIO
sdhci_set_card_detection 1
sdhci_clear_set_irqs clear 0 set 64
sdhci_runtime_suspend_host
[<c000e820>] (unwind_backtrace+0x0/0x12c) from [<c03948f4>] (dump_stack+0x20/0x24) [<c03948f4>] (dump_stack+0x20/0x24) from [<c02b0a8c>] (sdhci_runtime_suspend_host+0x24/0x90) [<c02b0a8c>] (sdhci_runtime_suspend_host+0x24/0x90) from [<c02b24a0>] (sdhci_s3c_runtime_suspend+0x24/0x48) [<c02b24a0>] (sdhci_s3c_runtime_suspend+0x24/0x48) from [<c01f4560>] (pm_generic_runtime_suspend+0x40/0x54) [<c01f4560>] (pm_generic_runtime_suspend+0x40/0x54) from [<c01f85c0>] (__rpm_callback+0x40/0x5c) [<c01f85c0>] (__rpm_callback+0x40/0x5c) from [<c01f8c38>] (rpm_suspend+0x2b0/0x498) [<c01f8c38>] (rpm_suspend+0x2b0/0x498) from [<c01f9b08>] (__pm_runtime_suspend+0x50/0x60) [<c01f9b08>] (__pm_runtime_suspend+0x50/0x60) from [<c01f4c08>] (pm_generic_runtime_idle+0x58/0x60) [<c01f4c08>] (pm_generic_runtime_idle+0x58/0x60) from [<c01f85c0>] (__rpm_callback+0x40/0x5c) [<c01f85c0>] (__rpm_callback+0x40/0x5c) from [<c01f902c>] (rpm_idle+0x1a4/0x23c) [<c01f902c>] (rpm_idle+0x1a4/0x23c) from [<c01f9180>] (__pm_runtime_idle+0x50/0x60) [<c01f9180>] (__pm_runtime_idle+0x50/0x60) from [<c01ef91c>] (driver_probe_device+0x2f0/0x34c) [<c01ef91c>] (driver_probe_device+0x2f0/0x34c) from [<c01ef9e4>] (__driver_attach+0x6c/0x8c) [<c01ef9e4>] (__driver_attach+0x6c/0x8c) from [<c01edccc>] (bus_for_each_dev+0x64/0x94) [<c01edccc>] (bus_for_each_dev+0x64/0x94) from [<c01ef260>] (driver_attach+0x28/0x30) [<c01ef260>] (driver_attach+0x28/0x30) from [<c01eec40>] (bus_add_driver+0xd0/0x24c) [<c01eec40>] (bus_add_driver+0xd0/0x24c) from [<c01eff9c>] (driver_register+0xac/0x13c) [<c01eff9c>] (driver_register+0xac/0x13c) from [<c01f1110>] (platform_driver_register+0x54/0x68) [<c01f1110>] (platform_driver_register+0x54/0x68) from [<c0517fc0>] (sdhci_s3c_driver_init+0x14/0x1c) [<c0517fc0>] (sdhci_s3c_driver_init+0x14/0x1c) from [<c00085c8>] (do_one_initcall+0xb8/0x188) [<c00085c8>] (do_one_initcall+0xb8/0x188) from [<c0391228>] (kernel_init+0xfc/0x2a4) [<c0391228>] (kernel_init+0xfc/0x2a4) from [<c0009250>] (ret_from_fork+0x14/0x20) sdhci_clear_set_irqs clear -1 set 0
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
sdhci_clear_set_irqs clear -1 set 16711683
sdhci_set_card_detection 1
sdhci_clear_set_irqs clear 0 set 64
oprofile: hardware counters not available
oprofile: using timer interrupt.
TCP: cubic registered
NET: Registered protocol family 17
rtc-ds1307 0-0068: setting system clock to 2013-04-12 11:56:23 UTC (1365767783)
ALSA device list:
No soundcards found.
RAMDISK: cramfs filesystem found at block 0
RAMDISK: Loading 11468KiB [1 disk] into ram disk... sdhci_runtime_suspend_host [<c000e820>] (unwind_backtrace+0x0/0x12c) from [<c03948f4>] (dump_stack+0x20/0x24) [<c03948f4>] (dump_stack+0x20/0x24) from [<c02b0a8c>] (sdhci_runtime_suspend_host+0x24/0x90) [<c02b0a8c>] (sdhci_runtime_suspend_host+0x24/0x90) from [<c02b24a0>] (sdhci_s3c_runtime_suspend+0x24/0x48) [<c02b24a0>] (sdhci_s3c_runtime_suspend+0x24/0x48) from [<c01f4560>] (pm_generic_runtime_suspend+0x40/0x54) [<c01f4560>] (pm_generic_runtime_suspend+0x40/0x54) from [<c01f85c0>] (__rpm_callback+0x40/0x5c) [<c01f85c0>] (__rpm_callback+0x40/0x5c) from [<c01f8c38>] (rpm_suspend+0x2b0/0x498) [<c01f8c38>] (rpm_suspend+0x2b0/0x498) from [<c01f9c38>] (pm_runtime_work+0x80/0x9c) [<c01f9c38>] (pm_runtime_work+0x80/0x9c) from [<c0032fc0>] (process_one_work+0x26c/0x3e8) [<c0032fc0>] (process_one_work+0x26c/0x3e8) from [<c00349d8>] (worker_thread+0x290/0x394) [<c00349d8>] (worker_thread+0x290/0x394) from [<c0039444>] (kthread+0xb8/0xc4) [<c0039444>] (kthread+0xb8/0xc4) from [<c0009250>] (ret_from_fork+0x14/0x20) sdhci_clear_set_irqs clear -1 set 0
usb 1-1: new full-speed USB device number 2 using s3c2410-ohci
sdhci_clear_set_irqs clear -1 set 16711683
sdhci_set_card_detection 1
sdhci_clear_set_irqs clear 0 set 64
sdhci_clear_set_irqs clear -1 set 16711683
sdhci_set_card_detection 1
sdhci_clear_set_irqs clear 0 set 64
sdhci_clear_set_irqs clear -1 set 16711683
sdhci_set_card_detection 1
sdhci_clear_set_irqs clear 0 set 64
usb 1-1: New USB device found, idVendor=0451, idProduct=2046
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 sdhci_runtime_suspend_host
[<c000e820>] (unwind_backtrace+0x0/0x12c) from [<c03948f4>] (dump_stack+0x20/0x24) [<c03948f4>] (dump_stack+0x20/0x24) from [<c02b0a8c>] (sdhci_runtime_suspend_host+0x24/0x90) [<c02b0a8c>] (sdhci_runtime_suspend_host+0x24/0x90) from [<c02b24a0>] (sdhci_s3c_runtime_suspend+0x24/0x48) [<c02b24a0>] (sdhci_s3c_runtime_suspend+0x24/0x48) from [<c01f4560>] (pm_generic_runtime_suspend+0x40/0x54) [<c01f4560>] (pm_generic_runtime_suspend+0x40/0x54) from [<c01f85c0>] (__rpm_callback+0x40/0x5c) [<c01f85c0>] (__rpm_callback+0x40/0x5c) from [<c01f8c38>] (rpm_suspend+0x2b0/0x498) [<c01f8c38>] (rpm_suspend+0x2b0/0x498) from [<c01f9c38>] (pm_runtime_work+0x80/0x9c) [<c01f9c38>] (pm_runtime_work+0x80/0x9c) from [<c0032fc0>] (process_one_work+0x26c/0x3e8) [<c0032fc0>] (process_one_work+0x26c/0x3e8) from [<c00349d8>] (worker_thread+0x290/0x394) [<c00349d8>] (worker_thread+0x290/0x394) from [<c0039444>] (kthread+0xb8/0xc4) [<c0039444>] (kthread+0xb8/0xc4) from [<c0009250>] (ret_from_fork+0x14/0x20) sdhci_clear_set_irqs clear -1 set 0

#1 lore raw

Hi Alexander,

Am Freitag, 12. April 2013, 14:20:45 schrieb Alexander Varnin:

Quoted 8 lines

Hello. I'm trying to bring up sdhci-s3c driver on S3C2443 SOC. It seems to initialize correctly, but immediately after that it get suspended by some force. This turns off all interrupts, so SD controller doesn't work. I don't know, where suspend command comes from, but whole system stay in working state.
I've recorded some boot log with extended verbose for a driver. It is attached.

Quoted 5 lines

I want to understand, why and where does this command come from. And how to turn it off. Now there is no suspend support working on my board, but i don't want to turn suspend (PM runtime) off at all, because it may be need to set it up in future.
Please, help.

This is called runtime-suspend and is meant to put the hardware block in a low power mode when it's not used. While suspend-to-ram puts the whole system to sleep the runtime-powermanagement is meant to reduce the power consumption of the running system by turning of unused components.

Normally the controller will be woken up, when a card detect event is found, but in the mach-smdk2443.c there does not seem to be any configured.

Try adding something like the attached diff (only compile-tested) to your board file, which simply tells the driver that the card is always present for testing purposes.

To finalze this you will need to determine how the card detect is really managed for the channel on your board (via a gpio or similar)

Good luck
Heiko

------------ 8< -----------------

arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-smdk2443.c +0 -0

s3c24xx/mach-smdk2443.c
index 9435c3b..499d048 100644

arch/arm/mach-s3c24xx/mach-smdk2443.c +1 -0
@@ -42,6 +42,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/samsung-time.h>
+#include <plat/sdhci.h>
 
 #include "common.h"
 #include "common-smdk.h"
@@ -108,6 +109,11 @@ static struct s3c2410_uartcfg smdk2443_uartcfgs[] 
__initdata = {
        }

};

+static struct s3c_sdhci_platdata smdk2443_hsmmc1_pdata __initdata = {

+       .max_width              = 4,
+       .cd_type                = S3C_SDHCI_CD_PERMANENT,
+};
+
 static struct platform_device *smdk2443_devices[] __initdata = {
        &s3c_device_wdt,
        &s3c_device_i2c0,
@@ -133,6 +139,8 @@ static void __init smdk2443_machine_init(void)
        s3c24xx_ac97_setup_gpio(S3C24XX_AC97_GPE0);

#endif

+ s3c_sdhci1_set_platdata(&smdk2443_hsmmc1_pdata);
+

        platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices));
        smdk_machine_init();

}