From patchwork Thu Sep 2 01:41:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bing Zhao X-Patchwork-Id: 177852 Return-path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on void.printf.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.9 tests=RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5 Envelope-to: chris@printf.net Delivery-date: Thu, 02 Sep 2010 02:14:20 +0100 Received: from lists.laptop.org ([18.85.2.145] helo=mail.laptop.org) by void.printf.net with esmtp (Exim 4.69) (envelope-from ) id 1OqyNe-0001f6-CA for chris@printf.net; Thu, 02 Sep 2010 02:14:19 +0100 Received: by mail.laptop.org (Postfix) id CAC2A246B3; Wed, 1 Sep 2010 21:13:58 -0400 (EDT) Delivered-To: cjb@laptop.org Received: from spam.laptop.org (spam.laptop.org [18.85.46.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.laptop.org (Postfix) with ESMTPS id B9B8B246B1 for ; Wed, 1 Sep 2010 21:13:58 -0400 (EDT) X-ASG-Debug-ID: 1283390056-0b74ab280001-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id zfWijUhUqCshCFAp for ; Wed, 01 Sep 2010 21:14:16 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753411Ab0IBBOM (ORCPT ); Wed, 1 Sep 2010 21:14:12 -0400 Received: from dakia2.marvell.com ([65.219.4.35]:45267 "EHLO dakia2.marvell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752182Ab0IBBOM (ORCPT ); Wed, 1 Sep 2010 21:14:12 -0400 Received: from maili.marvell.com (maili.marvell.com [10.68.76.51]) by dakia2.marvell.com with ESMTP id FSG0rPJmsFRbf166; Wed, 01 Sep 2010 18:14:11 -0700 (PDT) Received: from localhost.localdomain (unknown [10.82.24.199]) by maili.marvell.com (Postfix) with ESMTP id CAD038A013; Wed, 1 Sep 2010 18:14:11 -0700 (PDT) From: Bing Zhao To: linux-mmc@vger.kernel.org Cc: Bing Zhao , Michal Miroslaw , Nicolas Pitre , Chris Ball , Andrew Morton X-ASG-Orig-Subj: [PATCH v2] sdio: skip initialization on powered resume Subject: [PATCH v2] sdio: skip initialization on powered resume Date: Wed, 1 Sep 2010 18:41:32 -0700 Message-Id: <1283391692-14150-1-git-send-email-bzhao@marvell.com> X-Mailer: git-send-email 1.5.3.6 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Barracuda-Connect: vger.kernel.org[209.132.180.67] X-Barracuda-Start-Time: 1283390056 X-Barracuda-URL: http://18.85.46.23:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at laptop.org X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.5 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.39660 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index f332c52..64d2471 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -605,15 +605,23 @@ static int mmc_sdio_suspend(struct mmc_host *host) static int mmc_sdio_resume(struct mmc_host *host) { - int i, err; + int i, err = 0; BUG_ON(!host); BUG_ON(!host->card); /* Basic card reinitialization. */ mmc_claim_host(host); - err = mmc_sdio_init_card(host, host->ocr, host->card, - (host->pm_flags & MMC_PM_KEEP_POWER)); + + /* + * Simplified SDIO spec v2.00 (section 6.14 - Bus State Diagram) + * suggests that initialization should be skipped on powered resume. + */ + if (!(host->pm_flags & MMC_PM_KEEP_POWER)) { + err = mmc_sdio_init_card(host, host->ocr, host->card, + host->pm_flags & MMC_PM_KEEP_POWER); + } + if (!err) { /* We may have switched to 1-bit mode during suspend. */ err = sdio_enable_4bit_bus(host->card);