This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Suspend hangs with mounted SD card using OMAP_03.00.01.06 on DM37x

I've added code to support SD card, and can use the card quite happily.  However if a card is mounted and I suspend it hangs and I eventually see:

[  392.989898] INFO: task sh:832 blocked for more than 120 seconds.
[  392.995941] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  393.003814] sh            D c034093c     0   832      1 0x00000001
[  393.010101] [<c034093c>] (schedule+0x270/0x2b4) from [<c00cdb70>] (bdi_sched_wait+0x8/0x10)
[  393.018554] [<c00cdb70>] (bdi_sched_wait+0x8/0x10) from [<c0340d0c>] (__wait_on_bit+0x5c/0xa8)
[  393.027221] [<c0340d0c>] (__wait_on_bit+0x5c/0xa8) from [<c0340dcc>] (out_of_line_wait_on_bit+0x74/0x80)
[  393.036804] [<c0340dcc>] (out_of_line_wait_on_bit+0x74/0x80) from [<c00cdc00>] (sync_inodes_sb+0x88/0x124)
[  393.046539] [<c00cdc00>] (sync_inodes_sb+0x88/0x124) from [<c00d180c>] (__sync_filesystem+0x5c/0x88)
[  393.055755] [<c00d180c>] (__sync_filesystem+0x5c/0x88) from [<c00d98d0>] (fsync_bdev+0x18/0x38)
[  393.064514] [<c00d98d0>] (fsync_bdev+0x18/0x38) from [<c0180108>] (invalidate_partition+0x18/0x34)
[  393.073547] [<c0180108>] (invalidate_partition+0x18/0x34) from [<c00f80b4>] (del_gendisk+0x28/0xcc)
[  393.082672] [<c00f80b4>] (del_gendisk+0x28/0xcc) from [<c0284c28>] (mmc_blk_remove+0x24/0x44)
[  393.091278] [<c0284c28>] (mmc_blk_remove+0x24/0x44) from [<c027f8c4>] (mmc_bus_remove+0x18/0x20)
[  393.100158] [<c027f8c4>] (mmc_bus_remove+0x18/0x20) from [<c01db370>] (__device_release_driver+0x64/0xa4)
[  393.109802] [<c01db370>] (__device_release_driver+0x64/0xa4) from [<c01db454>] (device_release_driver+0x1c/0x28)
[  393.120056] [<c01db454>] (device_release_driver+0x1c/0x28) from [<c01daa58>] (bus_remove_device+0x6c/0x7c)
[  393.129791] [<c01daa58>] (bus_remove_device+0x6c/0x7c) from [<c01d9310>] (device_del+0x110/0x168)
[  393.138732] [<c01d9310>] (device_del+0x110/0x168) from [<c027f97c>] (mmc_remove_card+0x50/0x64)
[  393.147521] [<c027f97c>] (mmc_remove_card+0x50/0x64) from [<c0281218>] (mmc_sd_remove+0x24/0x30)
[  393.156372] [<c0281218>] (mmc_sd_remove+0x24/0x30) from [<c027f29c>] (mmc_suspend_host+0xf4/0x170)
[  393.165405] [<c027f29c>] (mmc_suspend_host+0xf4/0x170) from [<c028616c>] (omap_hsmmc_suspend+0x6c/0x108)
[  393.174957] [<c028616c>] (omap_hsmmc_suspend+0x6c/0x108) from [<c01dc4ec>] (platform_pm_suspend+0x50/0x5c)
[  393.184692] [<c01dc4ec>] (platform_pm_suspend+0x50/0x5c) from [<c01de1ac>] (pm_op+0x30/0x74)
[  393.193206] [<c01de1ac>] (pm_op+0x30/0x74) from [<c01de690>] (dpm_suspend_start+0x300/0x42c)
[  393.201721] [<c01de690>] (dpm_suspend_start+0x300/0x42c) from [<c008a7ec>] (suspend_devices_and_enter+0x3c/0x1c4)
[  393.212066] [<c008a7ec>] (suspend_devices_and_enter+0x3c/0x1c4) from [<c008aa54>] (enter_state+0xe0/0x138)
[  393.221801] [<c008aa54>] (enter_state+0xe0/0x138) from [<c008a1c4>] (state_store+0x94/0xbc)
[  393.230224] [<c008a1c4>] (state_store+0x94/0xbc) from [<c0188d28>] (kobj_attr_store+0x18/0x1c)
[  393.238922] [<c0188d28>] (kobj_attr_store+0x18/0x1c) from [<c00f97a8>] (sysfs_write_file+0x108/0x13c)
[  393.248229] [<c00f97a8>] (sysfs_write_file+0x108/0x13c) from [<c00b5114>] (vfs_write+0xac/0x154)
[  393.257080] [<c00b5114>] (vfs_write+0xac/0x154) from [<c00b5268>] (sys_write+0x3c/0x68)
[  393.265167] [<c00b5268>] (sys_write+0x3c/0x68) from [<c0036ec0>] (ret_fast_syscall+0x0/0x2c)

I sprinkled printks into the suspend path and get the following when I suspend with an SD card mounted (if SD not mounted it succeeds fine):

[   45.837005] PM: Preparing system for mem sleep
[   45.867248] Freezing user space processes ... (elapsed 0.01 seconds) done.
[   45.890380] Freezing remaining freezable tasks ... bdi_writeback_task:944
[   45.897338] bdi_writeback_task:944
[   45.911193] (elapsed 0.01 seconds) done.
[   45.915130] PM: Entering mem sleep
[   45.921661] Remux DSS sync pins as gpio and pull low
[   46.045074] omap_hsmmc_suspend:1990 Enter host cf878180
[   46.050323] omap_hsmmc_suspend:1999 suspend c004ba88
[   46.055328] omap_hsmmc_suspend:2003 ret 0
[   46.059356] omap_hsmmc_enable_fclk:1576
[   46.063446] omap_hsmmc_context_restore:209
[   46.067596] omap_hsmmc_suspend:2015
[   46.071075] mmc_suspend_host:1257
[   46.074432] mmc_suspend_host:1259
[   46.077758] mmc_suspend_host:1261
[   46.081085] mmc_suspend_host:1263
[   46.084442] mmc_suspend_host:1265
[   46.087768] mmc_suspend_host:1267
[   46.091125] mmc_suspend_host:1270
[   46.094451] mmc_suspend_host:1283 remove c02854bc
[   46.099182] mmc_remove_card:279
[   46.102386] mmc_remove_card:283
[   46.105560] mmc_remove_card:286
[   46.108734] mmc0: card 775e removed
[   46.112243] mmc_remove_card:294
[   46.115417] device_del:1085
[   46.118194] device_del:1088
[   46.121002] device_del:1090
[   46.123840] device_del:1092
[   46.126678] device_del:1094
[   46.129486] device_del:1096
[   46.132293] device_del:1098
[   46.135101] device_del:1130
[   46.137939] device_del:1132
[   46.140747] device_del:1134
[   46.143554] bus_remove_device:530
[   46.146911] bus_remove_device:532
[   46.150238] bus_remove_device:534
[   46.153594] bus_remove_device:536
[   46.156921] bus_remove_device:539
[   46.160247] bus_remove_device:541
[   46.163604] bus_remove_device:543
[   46.166931] bus_remove_device:545
[   46.170288] bus_remove_device:550
[   46.173614] device_release_driver:376
[   46.177307] device_release_driver:378
[   46.180999] __device_release_driver:313
[   46.184844] __device_release_driver:316
[   46.188720] __device_release_driver:318
[   46.192596] __device_release_driver:320
[   46.196441] __device_release_driver:323
[   46.200317] __device_release_driver:326
[   46.204162] __device_release_driver:330
[   46.208038] __device_release_driver:334 remove c0283b24
[   46.213287] mmc_bus_remove:112 remove c0288ecc
[   46.217773] mmc_blk_remove:625
[   46.220825] mmc_blk_remove:628
[   46.223937] bdi_queue_work:181 task cf84e700
[   46.228240] bdi_queue_work:183
[   46.231323] sync_inodes_sb:1212
[   46.234497] bdi_sync_writeback:243
[   46.237915] bdi_queue_work:181 task cf84e700
[   46.242248] bdi_queue_work:183
[   46.245300] bdi_sync_writeback:245

Has anyone seen this using OMAPPSP_03.00.01.06?  If so does anyone have a fix?