<div>Hi, </div><div><br></div><div>I am looking into suspend to RAM on a Freescale MX51 running a 2.6.31 kernel. The</div><div>system suspends and resumes OK except when an SD card is mounted.</div><div><br></div><div>What happens then is that it finds a page which is being written to disk (writeback flag is set), so it waits forever in uninterruptible state for the write to finish, which never happens.</div>

<div><br></div><div>I was expecting the filesystem sync previous to the tasks freezing to have written all page caches to disk.</div><div><br></div><div>Any suggestion as to how to debug this forward?</div><div><br></div>

<div>Thanks in advance, </div><div>Alex </div><div><br></div><div>INFO: task sh:595 blocked for more than 120 seconds. </div><div>&quot;echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs&quot; disables this message. </div>

<div>sh D c02be320 0 595 1 0x00000000 </div><div>[&lt;c02be320&gt;] (schedule+0x300/0x344) from [&lt;c02be388&gt;] (io_schedule+0x24/0x40) </div><div>[&lt;c02be388&gt;] (io_schedule+0x24/0x40) from [&lt;c006fe18&gt;] (sync_page+0x38/0x40) </div>

<div>[&lt;c006fe18&gt;] (sync_page+0x38/0x40) from [&lt;c02be68c&gt;] (__wait_on_bit+0x54/0x9c) </div><div>[&lt;c02be68c&gt;] (__wait_on_bit+0x54/0x9c) from [&lt;c0070070&gt;] (wait_on_page_bit+0xb4/0xcc) </div><div>[&lt;c0070070&gt;] (wait_on_page_bit+0xb4/0xcc) from [&lt;c0075fc8&gt;] (write_cache_pages+0x1fc/0x37c) </div>

<div>[&lt;c0075fc8&gt;] (write_cache_pages+0x1fc/0x37c) from [&lt;c00761ac&gt;] (do_writepages+0x3c/0x54) </div><div>[&lt;c00761ac&gt;] (do_writepages+0x3c/0x54) from [&lt;c0070a80&gt;] (__filemap_fdatawrite_range+0x64/0x6c) </div>

<div>[&lt;c0070a80&gt;] (__filemap_fdatawrite_range+0x64/0x6c) from [&lt;c00714c4&gt;] (filemap_fdatawrite+0x28/0x30) </div><div>[&lt;c00714c4&gt;] (filemap_fdatawrite+0x28/0x30) from [&lt;c00714e4&gt;] (filemap_write_and_wait+0x18/0x3c) </div>

<div>[&lt;c00714e4&gt;] (filemap_write_and_wait+0x18/0x3c) from [&lt;c00b2e68&gt;] (fsync_bdev+0x18/0x38) </div><div>[&lt;c00b2e68&gt;] (fsync_bdev+0x18/0x38) from [&lt;c013d3bc&gt;] (invalidate_partition+0x18/0x34) </div>

<div>[&lt;c013d3bc&gt;] (invalidate_partition+0x18/0x34) from [&lt;c00ca6e0&gt;] (del_gendisk+0x28/0xc8) </div><div>[&lt;c00ca6e0&gt;] (del_gendisk+0x28/0xc8) from [&lt;c01e4c88&gt;] (mmc_blk_remove+0x20/0x3c) </div><div>

[&lt;c01e4c88&gt;] (mmc_blk_remove+0x20/0x3c) from [&lt;c01e0688&gt;] (mmc_bus_remove+0x18/0x20) </div><div>[&lt;c01e0688&gt;] (mmc_bus_remove+0x18/0x20) from [&lt;c01872f8&gt;] (__device_release_driver+0x64/0xa4) </div>
<div>
[&lt;c01872f8&gt;] (__device_release_driver+0x64/0xa4) from [&lt;c01873dc&gt;] (device_release_driver+0x1c/0x28) </div><div>[&lt;c01873dc&gt;] (device_release_driver+0x1c/0x28) from [&lt;c01869f8&gt;] (bus_remove_device+0x9c/0xac) </div>

<div>[&lt;c01869f8&gt;] (bus_remove_device+0x9c/0xac) from [&lt;c01852d0&gt;] (device_del+0x110/0x16c) </div><div>[&lt;c01852d0&gt;] (device_del+0x110/0x16c) from [&lt;c01e073c&gt;] (mmc_remove_card+0x4c/0x60) </div><div>

[&lt;c01e073c&gt;] (mmc_remove_card+0x4c/0x60) from [&lt;c01e1b70&gt;] (mmc_sd_remove+0x24/0x30) </div><div>[&lt;c01e1b70&gt;] (mmc_sd_remove+0x24/0x30) from [&lt;c01e001c&gt;] (mmc_suspend_host+0xc4/0x188) </div><div>[&lt;c01e001c&gt;] (mmc_suspend_host+0xc4/0x188) from [&lt;c01e6860&gt;] (sdhci_suspend+0x58/0x120) </div>

<div>[&lt;c01e6860&gt;] (sdhci_suspend+0x58/0x120) from [&lt;c0188378&gt;] (platform_pm_suspend+0x48/0x54) </div><div>[&lt;c0188378&gt;] (platform_pm_suspend+0x48/0x54) from [&lt;c018a098&gt;] (pm_op+0x30/0x7c) </div><div>

[&lt;c018a098&gt;] (pm_op+0x30/0x7c) from [&lt;c018a86c&gt;] (dpm_suspend_start+0x3ac/0x50c) </div><div>[&lt;c018a86c&gt;] (dpm_suspend_start+0x3ac/0x50c) from [&lt;c006b560&gt;] (suspend_devices_and_enter+0x3c/0x1c4) </div>

<div>[&lt;c006b560&gt;] (suspend_devices_and_enter+0x3c/0x1c4) from [&lt;c006b7a0&gt;] (enter_state+0xb8/0x118) </div><div>[&lt;c006b7a0&gt;] (enter_state+0xb8/0x118) from [&lt;c006afbc&gt;] (state_store+0xa0/0xbc)  [&lt;c006afbc&gt;] (state_store+0xa0/0xbc) from [&lt;c0146cd4&gt;] (kobj_attr_store+0x18/0x1c) </div>

<div>[&lt;c0146cd4&gt;] (kobj_attr_store+0x18/0x1c) from [&lt;c00cbd24&gt;] (sysfs_write_file+0x108/0x13c) </div><div>[&lt;c00cbd24&gt;] (sysfs_write_file+0x108/0x13c) from [&lt;c008f7cc&gt;] (vfs_write+0xac/0x128)  [&lt;c008f7cc&gt;] (vfs_write+0xac/0x128) from [&lt;c008f8f4&gt;] (sys_write+0x3c/0x68) </div>

<div>[&lt;c008f8f4&gt;] (sys_write+0x3c/0x68) from [&lt;c0025e80&gt;] (ret_fast_</div>