From patchwork Fri Dec 31 20:43:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hein_Tibosch X-Patchwork-Id: 442651 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBVLOkTQ012834 for ; Fri, 31 Dec 2010 21:24:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752108Ab0LaVY3 (ORCPT ); Fri, 31 Dec 2010 16:24:29 -0500 Received: from bosmailout04.eigbox.net ([66.96.187.4]:57002 "EHLO bosmailout04.eigbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752079Ab0LaVY3 (ORCPT ); Fri, 31 Dec 2010 16:24:29 -0500 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 31 Dec 2010 21:24:47 +0000 (UTC) X-Greylist: delayed 2400 seconds by postgrey-1.27 at vger.kernel.org; Fri, 31 Dec 2010 16:24:29 EST Received: from bosmailscan06.eigbox.net ([10.20.15.6]) by bosmailout04.eigbox.net with esmtp (Exim) id 1PYlpq-0006O6-Ld for linux-mmc@vger.kernel.org; Fri, 31 Dec 2010 15:44:26 -0500 Received: from bosimpout02.eigbox.net ([10.20.55.2]) by bosmailscan06.eigbox.net with esmtp (Exim) id 1PYlpm-0003Ut-BF; Fri, 31 Dec 2010 15:44:22 -0500 Received: from bosauthsmtp02.eigbox.net ([10.20.18.2]) by bosimpout02.eigbox.net with NO UCE id pwkN1f00102gpmq01wkNrn; Fri, 31 Dec 2010 15:44:22 -0500 X-EN-OrigOutIP: 10.20.18.2 X-EN-IMPSID: pwkN1f00102gpmq01wkNrn Received: from [114.79.61.146] (helo=[10.255.24.145]) by bosauthsmtp02.eigbox.net with esmtpa (Exim) id 1PYlpk-0005LH-Oq; Fri, 31 Dec 2010 15:44:22 -0500 Message-ID: <4D1E4084.3080601@yahoo.es> Date: Sat, 01 Jan 2011 04:43:48 +0800 From: Hein_Tibosch User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Andy Ross CC: Chris Ball , linux-mmc@vger.kernel.org, Pierre Ossman , Ben Nizette , Sascha Hauer , Adrian Hunter , Matt Fleming Subject: Re: [PATCH] Fix sd/sdio/mmc initialization frequency retries References: <4D1A1B19.8000902@windriver.com> In-Reply-To: <4D1A1B19.8000902@windriver.com> X-EN-UserInfo: 3946c951b80c12a8be5482963a0b1232:e0ae43bc192b431f8b69f09a37527cbc X-EN-AuthUser: hein@htibosch.net X-EN-OrigIP: 114.79.61.146 X-EN-OrigHost: unknown Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 49da4df..18331eb --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -764,13 +764,17 @@ static void mmc_sd_attach_bus_ops(struct mmc_host *host) /* * Starting point for SD card init. */ -int mmc_attach_sd(struct mmc_host *host, u32 ocr) +int mmc_attach_sd(struct mmc_host *host) { int err; + u32 ocr; BUG_ON(!host); WARN_ON(!host->claimed); + if((err = mmc_send_app_op_cond(host, 0, &ocr))) + return err; + mmc_sd_attach_bus_ops(host); /* @@ -825,6 +829,7 @@ int mmc_attach_sd(struct mmc_host *host, u32 ocr) if (err) goto remove_card; + mmc_claim_host(host); return 0; remove_card: @@ -833,7 +838,6 @@ remove_card: mmc_claim_host(host); err: mmc_detach_bus(host); - mmc_release_host(host); printk(KERN_ERR "%s: error %d whilst initialising SD card\n", mmc_hostname(host), err);