From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philip Rakity Subject: Re: [RFC} sdhci.c set_ios -- disable global interrupts and Question on Power Management Date: Mon, 14 Feb 2011 12:17:28 -0800 Message-ID: References: <7953F5A4-7BFA-4E40-8202-C682C0314F49@marvell.com> <447896B1-8836-4DFE-A00D-D41C395C79FC@marvell.com> <8250E4885F9967469CAC3FB5CBA2CE69935205E445@irsmsx501.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Return-path: Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]:60176 "EHLO na3sys009aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046Ab1BNUSe convert rfc822-to-8bit (ORCPT ); Mon, 14 Feb 2011 15:18:34 -0500 In-Reply-To: <8250E4885F9967469CAC3FB5CBA2CE69935205E445@irsmsx501.ger.corp.intel.com> Content-Language: en-US Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: "Tardy, Pierre" Cc: Pierre Tardy , Wolfram Sang , "linux-mmc@vger.kernel.org" According to Zhangfei Gao -- android crashes when we are code to handle dual data rate because of the mdelay of 5ms that is needed for the voltage to become stable. (see my ddr patch) I have never seen this problem with android. The dual data rate code is in another patch; it adds another call into set_ios to handle this. His comment was doing mdelay stopped the system from being scheduled since mdelay is done with interrupts disabled. It also stopped the system for keeping correct time. If doing mdelay breaks android then the original code (no ddr code) is wrong since mdelay should not be issued with interrupts disabled and depending on the quirks defined the delays can be very large. Wanted to handle his concern. On Feb 14, 2011, at 10:41 AM, Tardy, Pierre wrote: > Philip, >>> And, more important, you will do cond_resched while holding you >>> spinlock, which is *bad*. >>> What if the mmc stack will call you again from another thread? deadlock... > >> Assumptions -- Please Confirm >> ------------------------------------------- > No need to do assumptions, schedule while holding spinlocks is bad, your kernel will oops with something like: > BUG: scheduling while in atomic. > > >>>> @@ -1108,7 +1108,7 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power) >>>> * can apply clock after applying power >>>> */ >>>> if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER) >>>> - mdelay(10); >>>> + mmc_delay(10); >>> Do you need this quirk in your platform? >> >> No > Then, you dont have any mdelay in your set_ios, and you are trying to optimize something that never happen. > > Pierre > > --------------------------------------------------------------------- > Intel Corporation SAS (French simplified joint stock company) > Registered headquarters: "Les Montalets"- 2, rue de Paris, > 92196 Meudon Cedex, France > Registration Number: 302 456 199 R.C.S. NANTERRE > Capital: 4,572,000 Euros > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. >