Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753353AbZGANip (ORCPT ); Wed, 1 Jul 2009 09:38:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750888AbZGANii (ORCPT ); Wed, 1 Jul 2009 09:38:38 -0400 Received: from co203.xi-lite.net ([149.6.83.203]:57188 "EHLO co203.xi-lite.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750782AbZGANii (ORCPT ); Wed, 1 Jul 2009 09:38:38 -0400 X-Greylist: delayed 1359 seconds by postgrey-1.27 at vger.kernel.org; Wed, 01 Jul 2009 09:38:38 EDT Message-ID: <4A4B6184.7000903@parrot.com> Date: Wed, 1 Jul 2009 15:15:48 +0200 From: Matthieu CASTET User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: CC: "linux-kernel@vger.kernel.org" , Subject: sdhci can turn off irq up to 200 ms X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1459 Lines: 59 Hi, sdhci code got tasklets (sdhci_tasklet_card and sdhci_tasklet_finish), that does : { spin_lock_irqsave if (cond) { sdhci_reset sdhci_reset } spin_unlock_irqrestore } The problem is that sdhci_reset [1] does busy pooling on a register up to a timeout of 100 ms. That's not low latency friendly. On our system, we saw that sdhci_reset take 1 ms. That should be because we enter in mdelay, even if the hardware clears the bit faster. I wonder why there is an mdelay(1). Using cpu_relax and time_is_after_jiffies should make sdhci_reset faster. Matthieu [1] static void sdhci_reset(struct sdhci_host *host, u8 mask) { unsigned long timeout; u32 uninitialized_var(ier); [...] sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET); if (mask & SDHCI_RESET_ALL) host->clock = 0; /* Wait max 100 ms */ timeout = 100; /* hw clears the bit when it's done */ while (sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask) { if (timeout == 0) { printk(KERN_ERR "%s: Reset 0x%x never completed.\n", mmc_hostname(host->mmc), (int)mask); sdhci_dumpregs(host); return; } timeout--; mdelay(1); } [...] } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/