From fa0c328343c6314364d3678334f5a8854e086f11 Mon Sep 17 00:00:00 2001 From: Doug Anderson Date: Wed, 25 Feb 2015 10:11:51 -0800 Subject: [PATCH] mmc: dw_mmc: Only enable CD after setup and only if needed We really don't want to get a card detect interrupt during probe time since it can confuse things. Let's disable the card detect interrupt until we're in a really good place: the end of probe. Let's also simply avoid enabling the card detect interrupt if it's not used. It appears that (at least on rk3288) when vqmmc is turned on it can cause a bogus "card detect" interrupt. That meant that we were getting a predictable card detect interrupt while we were in mmc_add_host(). On the version of the kernel I'm working with at least (3.14), this is not a great time to get a card detect interrupt since I think that we don't grab all the needed locks in mmc_add_host() and children. I put stack dumps in dw_mci_setup_bus() and found that I could see two distinct stack crawls that looked like: Caller one: * dw_mci_setup_bus * dw_mci_set_ios * mmc_power_up * mmc_start_host * mmc_add_host Caller two: * dw_mci_setup_bus * dw_mci_set_ios * mmc_set_chip_select * mmc_go_idle * mmc_rescan * process_one_work * worker_thread * kthread Signed-off-by: Doug Anderson Tested-by: Javier Martinez Canillas Signed-off-by: Jaehoon Chung Signed-off-by: Ulf Hansson --- Reading git-format-patch failed