From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932479AbbGHGnW (ORCPT ); Wed, 8 Jul 2015 02:43:22 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:44847 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754103AbbGHGnP (ORCPT ); Wed, 8 Jul 2015 02:43:15 -0400 Date: Wed, 8 Jul 2015 08:43:04 +0200 From: Sascha Hauer To: Holger Schurig Cc: Russell King - ARM Linux , Ulf Hansson , Fabio Estevam , "linux-mmc@vger.kernel.org" , Chris Ball , open list , Sascha Hauer , Dong Aisheng Subject: Re: SDHCI: mdelay() in hot path in esdhc_pltfm_set_clock looses CAN (!) frames Message-ID: <20150708064304.GB18700@pengutronix.de> References: <20150707205243.GK7557@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:29:41 up 13 days, 51 min, 60 users, load average: 0.11, 0.12, 0.13 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 08, 2015 at 08:22:57AM +0200, Holger Schurig wrote: > Wow, at last some reaction. And I thought nobody cares ... > > BTW, removing CONFIG_MMC_CLKGATE helped a bit, because the pointless > clock-off-clock-on while the device is booting (or accessing multiple > sectors within a short time) isn't going to happen anymore. > > But really, a mdelay(1) in a driver ... Look for the other mdelays in sdhci.c. There are up to a hundred of them in sdhci_reset() which is called under a spin_lock_irqsave. I remember that with the wrong type of card detection the MMC core frequently polls for a card and if none is found the sdhci core was resetted which falls into this mdelay polling loop in sdhci_reset. So if you care about realtime you better have a card inserted... Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |