From: Arnd Hannemann Date: Wed, 5 Jan 2011 22:36:14 +0000 (-0500) Subject: mmc: tmio_mmc: handle missing HW interrupts X-Git-Tag: v2.6.38-rc1~418^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ff56e0d8e02df023440ea65774cf1d15e669ece;p=pandora-kernel.git mmc: tmio_mmc: handle missing HW interrupts When doing excessive hotplug, e.g., repeated insert/eject operations, the hardware may get confused to a point where no CMDTIMEOUT/CMDRESPEND interrupts are generated any more. As a result requests get stuck, e.g.: [ 360.351562] INFO: task kworker/u:0:5 blocked for more than 120 seconds. [ 360.351562] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 360.359375] kworker/u:0 D c020c2b4 0 5 2 0x00000000 [ 360.367187] Backtrace: [ 360.367187] [] (schedule+0x0/0x340) from [] (schedule_timeout+0x20/0x190) [ 360.375000] r8:c702fd70 r7:00000002 r6:c702e000 r5:c702fdc4 r4:7fffffff [ 360.375000] r3:c701e040 [ 360.382812] [] (schedule_timeout+0x0/0x190) from [] (wait_for_common+0xc4/0x150) [ 360.390625] r6:c702e000 r5:c702fdc4 r4:7fffffff [ 360.390625] [] (wait_for_common+0x0/0x150) from [] (wait_for_completion+0x18/0x1c) [ 360.398437] [] (wait_for_completion+0x0/0x1c) from [] (mmc_wait_for_req+0x214/0x234) [ 360.406250] [] (mmc_wait_for_req+0x0/0x234) from [] (mmc_sd_switch+0xfc/0x114) [ 360.414062] r7:c702fe4c r6:c702fe20 r5:c7179800 r4:00fffff0 [ 360.421875] [] (mmc_sd_switch+0x0/0x114) from [] (mmc_sd_setup_card+0x260/0x384) [ 360.429687] [] (mmc_sd_setup_card+0x0/0x384) from [] (mmc_sd_init_card+0x13c/0x1e0) [ 360.437500] [] (mmc_sd_init_card+0x0/0x1e0) from [] (mmc_attach_sd+0x124/0x1a8) [ 360.445312] r8:c02db404 r7:ffffff92 r6:c702ff34 r5:c6007da8 r4:c6007c00 [ 360.453125] [] (mmc_attach_sd+0x0/0x1a8) from [] (mmc_rescan+0x248/0x2f0) [ 360.460937] r5:c6007da8 r4:c6007c00 [ 360.468750] [] (mmc_rescan+0x0/0x2f0) from [] (process_one_work+0x1ec/0x318) [ 360.476562] r7:c6007da8 r6:00000000 r5:c710ec00 r4:c701bde0 [ 360.484375] [] (process_one_work+0x0/0x318) from [] (worker_thread+0x1b0/0x2cc) [ 360.492187] [] (worker_thread+0x0/0x2cc) from [] (kthread+0x8c/0x94) [ 360.500000] [] (kthread+0x0/0x94) from [] (do_exit+0x0/0x590) [ 360.507812] r7:00000013 r6:c0037fc4 r5:c004b2ac r4:c7021f00 This patch addresses this problem by introducing timeouts for outstanding interrupts. If a hardware interrupt is missing, a soft reset will be performed to bring the hardware back to a working state. Tested with the SDHI hardware block in sh7372 / AP4EVB. Signed-off-by: Arnd Hannemann Signed-off-by: Chris Ball --- Reading git-diff-tree failed