Re: [PATCH 1/2] mmc: dw_mmc: Cleanup disable of low power mode w/SDIO interrupts
From: Doug Anderson
Date: Thu Oct 24 2013 - 03:28:35 EST
Seungwon,
On Wed, Oct 23, 2013 at 12:25 PM, Seungwon Jeon <tgih.jun@xxxxxxxxxxx> wrote:
>> >> + if (card->type == MMC_TYPE_SDIO ||
>> >> + card->type == MMC_TYPE_SD_COMBO) {
> && card->quirks & MMC_QUIRK_BROKEN_CLK_GATING
> How about considering MMC_QUIRK_BROKEN_CLK_GATING?
> Some sdio device can work with gating clock.
> For this, mmc_fixup_device() should be called prior to init_card() in core(sdio.c).
> I guess you found that.
By SDIO devices, are you referring to actual SDIO cards or some
implementations of dw_mmc?
As far as I understand in the CLKENA description in the generic
documentation from Synopsys it say that for SDIO cards you must not
stop the clock if interrupts must be detected. To me, that means that
all dw_mmc implementations require this change if they support SDIO
interrupts (hence checking for MMC_CAP_SDIO_IRQ).
I guess I did make the assumption in this change that all (reasonable)
SDIO cards would be using SDIO interrupts if they are available. If
we could find out ahead of time if a given SDIO driver was planning to
use interrupts we could do better. The old solution did better in
this way and we could probably make it work (and still fix the
read-modify-write race) if we thought this was really important. The
code gets a little more twisted to try to avoid holding the IRQ-safe
spinlock while updating the clock, but I could attempt it...
NOTE: We've recently found that there are still occasions when we lose
SDIO interrupts with dw_mmc and our Marvell WiFi driver, especially
when those interrupts happen back-to-back. That problem appears
unrelated to this one (it's what Bing was investigating when he found
the original race). Anyone that has any thoughts, please let me
know...
-Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/