2010/12/21 Chris Ball <cjb@xxxxxxxxxx>: > Hi Linus, > > On Wed, Nov 03, 2010 at 10:22:50AM +0100, Linus Walleij wrote: >> +/* >> + * mmc_host_clk_exit - shut down clock gating code >> + * @host: host with potential clock to control >> + */ >> +static inline void mmc_host_clk_exit(struct mmc_host *host) >> +{ >> + /* >> + * Wait for any outstanding gate and then make sure we're >> + * ungated before exiting. >> + */ >> + if (cancel_work_sync(&host->clk_disable_work)) >> + mmc_host_clk_gate_delayed(host); >> + if (host->clk_gated) >> + mmc_host_clk_ungate(host); >> + BUG_ON(host->clk_requests > 0); >> +} > > I just hit the BUG_ON() above, when doing "rmmod sdhci-pci" on my x86 > laptop running today's linux-next. There was *no* SD card inserted, > and hadn't been one inserted all boot. Hm, it's a plain bug... We make sure it's ungated the line above so clk_requests is always == 1. It should be BUG_ON(host->clk_requests > 1) Can you try the below: From: Linus Walleij <linus.walleij@xxxxxxxxxxxxxx> Date: Wed, 22 Dec 2010 09:10:04 +0100 Subject: [PATCH] mmc: check for > 1 clk_requests Since we make sure the clock is enabled in the mmc_host_clk_exit() function we should expect a reference counter of 1, not 0. Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxxxxxx> --- drivers/mmc/core/host.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 92e3370..072d29c 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -235,7 +235,7 @@ static inline void mmc_host_clk_exit(struct mmc_host *host) mmc_host_clk_gate_delayed(host); if (host->clk_gated) mmc_host_clk_ungate(host); - BUG_ON(host->clk_requests > 0); + BUG_ON(host->clk_requests > 1); } #else -- 1.7.3.3 Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html