From patchwork Fri Jan 30 19:05:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 5753191 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E45C8BF440 for ; Fri, 30 Jan 2015 22:32:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D8E720225 for ; Fri, 30 Jan 2015 22:32:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 40D3420219 for ; Fri, 30 Jan 2015 22:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763367AbbA3Wc3 (ORCPT ); Fri, 30 Jan 2015 17:32:29 -0500 Received: from cantor2.suse.de ([195.135.220.15]:38738 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763331AbbA3Wc1 (ORCPT ); Fri, 30 Jan 2015 17:32:27 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 497B5AC20; Fri, 30 Jan 2015 22:32:25 +0000 (UTC) From: NeilBrown To: Tony Lindgren , Ulf Hansson Date: Sat, 31 Jan 2015 06:05:38 +1100 Subject: [PATCH 4/4] mmc: omap_hsmmc: switch to 1-bit before stopping clocks. Cc: Andreas Fenkart , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, GTA04 owners , NeilBrown , linux-omap@vger.kernel.org Message-ID: <20150130190537.20910.16604.stgit@notabene.brown> In-Reply-To: <20150130185742.20910.52715.stgit@notabene.brown> References: <20150130185742.20910.52715.stgit@notabene.brown> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DATE_IN_PAST_03_06, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make use of the new mmc_sdio_want_no_clocks() call to avoid stopping clocks while SD Card interrupts are enabled and we aren't in 1-bit mode. Also stop clocks immediately in omap_hsmmc_disable_fclk() if 1-bit mode has been entered for this purpose. With this, I can use my libertas wifi with a 4-bit bus, with interrupts and runtime power-management enabled, and get around 14Mb/sec throughput (which is the best I've seen). Signed-off-by: NeilBrown --- drivers/mmc/host/omap_hsmmc.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index f84cfb01716d..14fce3b92633 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1791,9 +1791,12 @@ static int omap_hsmmc_disable_fclk(struct mmc_host *mmc) { struct omap_hsmmc_host *host = mmc_priv(mmc); - pm_runtime_mark_last_busy(host->dev); - pm_runtime_put_autosuspend(host->dev); - + if (atomic_read(&mmc->sdio_narrowed) == 2) + pm_runtime_put_sync(host->dev); + else { + pm_runtime_mark_last_busy(host->dev); + pm_runtime_put_autosuspend(host->dev); + } return 0; } @@ -2311,6 +2314,10 @@ static int omap_hsmmc_runtime_suspend(struct device *dev) spin_lock_irqsave(&host->irq_lock, flags); if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && (host->flags & HSMMC_SDIO_IRQ_ENABLED)) { + if (mmc_sdio_want_no_clocks(host->mmc) == 0) { + ret = -EBUSY; + goto abort; + } /* disable sdio irq handling to prevent race */ OMAP_HSMMC_WRITE(host->base, ISE, 0); OMAP_HSMMC_WRITE(host->base, IE, 0);