From patchwork Fri Feb 7 07:56:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 3600031 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50EE6BF418 for ; Fri, 7 Feb 2014 07:56:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5CEC02016C for ; Fri, 7 Feb 2014 07:56:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C77820163 for ; Fri, 7 Feb 2014 07:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750745AbaBGH4T (ORCPT ); Fri, 7 Feb 2014 02:56:19 -0500 Received: from mail-qc0-f179.google.com ([209.85.216.179]:54773 "EHLO mail-qc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbaBGH4S (ORCPT ); Fri, 7 Feb 2014 02:56:18 -0500 Received: by mail-qc0-f179.google.com with SMTP id e16so5331374qcx.10 for ; Thu, 06 Feb 2014 23:56:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0TDsvZmrHPBTjtSkf9Y3V/YEbDwwDlkb+u4ppcCflHs=; b=oClG4AMu5YlYznZ5zuks8VfleltHdDOZGrNLOiVV6Hfouc+plbXBySu5xVGBJftHim uMiT5CoHhHQViNkFt+oR4xptIoLLuXxHPJRd4mZWglojPEEsAUTWIytKfh3ev0A+XwNb yFpI2aAy+OKyvFkyox47j0jBN2CBOm5REmlMrBw6O0LWd2VsdK9UiHuHDENN7d/tPgm1 s+PfveWS49xrfeibPRqu1ErPa/lgBeNKWqLouUXru6u/N8fO3VlhSqGSoTY6AtKnPs6G jUG3x/zScUw9AgZGPI8g9Y3tBGfHWdZFt61974NXPgl0GsoRdLc9v7xg82slm0Hc6em0 cbXw== MIME-Version: 1.0 X-Received: by 10.140.98.33 with SMTP id n30mr18256596qge.8.1391759776973; Thu, 06 Feb 2014 23:56:16 -0800 (PST) Received: by 10.140.84.145 with HTTP; Thu, 6 Feb 2014 23:56:16 -0800 (PST) In-Reply-To: <52F3A267.8030302@parkeon.com> References: <52F3A267.8030302@parkeon.com> Date: Fri, 7 Feb 2014 15:56:16 +0800 Message-ID: Subject: Re: [Regression: mmc: sdhci-esdhc-imx: add runtime pm support] From: Dong Aisheng To: Martin Fuzzey Cc: Dong Aisheng , Chris Ball , "linux-mmc@vger.kernel.org" Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Hi Martin, On Thu, Feb 6, 2014 at 10:55 PM, Martin Fuzzey wrote: > Hello all, > > since > > commit 89d7e5c131228a8f0d8b0cb48b459c62152bf620 > Author: Dong Aisheng > Date: Mon Nov 4 16:38:29 2013 +0800 > > mmc: sdhci-esdhc-imx: add runtime pm support > > > My SDIO wifi module (WiiBear n modue based on Marvel 8787 chipset) using > mainline mwifiex driver is no longer working: > Some SDIO cards may not be able to work well without clock. Can you try the following patch to see if it works? commit d9d062627407f714ba326fa8dd6e8aa20199fdbe Author: Dong Aisheng Date: Fri Nov 15 17:54:36 2013 +0800 mmc: sdhci: get runtime pm when sdio irq is enabled SDIO cards may need clock to send the card interrupt to host. Thus, we get runtime pm when sdio irq is enabled to prevent the clock resource is released and put it when sdio irq is disabled. Signed-off-by: Dong Aisheng static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, Regards Dong Aisheng > [ 33.465577] mwifiex_sdio mmc2:0001:1: mwifiex_cmd_timeout_func: Timeout > cmd id (7242618.212205) = 0xa9, act = 0x0 > [ 33.475944] mwifiex_sdio mmc2:0001:1: num_data_h2c_failure = 0 > [ 33.481793] mwifiex_sdio mmc2:0001:1: num_cmd_h2c_failure = 0 > [ 33.487599] mwifiex_sdio mmc2:0001:1: num_cmd_timeout = 1 > [ 33.493010] mwifiex_sdio mmc2:0001:1: num_tx_timeout = 0 > [ 33.498371] mwifiex_sdio mmc2:0001:1: last_cmd_index = 1 > [ 33.503693] mwifiex_sdio mmc2:0001:1: last_cmd_id: 00 00 a9 00 00 00 00 > 00 00 00 > [ 33.511137] mwifiex_sdio mmc2:0001:1: last_cmd_act: 00 00 00 00 00 00 00 > 00 00 00 > [ 33.518660] mwifiex_sdio mmc2:0001:1: last_cmd_resp_index = 0 > [ 33.524417] mwifiex_sdio mmc2:0001:1: last_cmd_resp_id: 00 00 00 00 00 00 > 00 00 00 00 > [ 33.532301] mwifiex_sdio mmc2:0001:1: last_event_index = 0 > [ 33.537825] mwifiex_sdio mmc2:0001:1: last_event: 00 00 00 00 00 00 00 00 > 00 00 > [ 33.545164] mwifiex_sdio mmc2:0001:1: data_sent=1 cmd_sent=1 > [ 33.550863] mwifiex_sdio mmc2:0001:1: ps_mode=0 ps_state=0 > [ 33.556425] mwifiex_sdio mmc2:0001:1: cmd timeout > [ 33.572375] mwifiex_sdio: Resetting card... > [ 33.728913] mmc2: card 0001 removed > > > Increasing the autosuspend delay from 50ms to 500ms fixes the problem. > > This is using an i.MX53 SOC > > This is on 3.13 cherrypicking from mainline this patch and these two > supporting patches: > > commit d433dc63182825538b85de6a85e2ea3fad7f2917 > Author: Dong Aisheng > Date: Mon Nov 4 16:38:25 2013 +0800 > > mmc: sdhci-pltfm: export pltfm suspend/resume api > > > commit ce090a4eb9626272bfd2529520f2f16351029640 > Author: Dong Aisheng > Date: Mon Nov 4 16:38:28 2013 +0800 > > mmc: sdhci-esdhc-imx: fix runtime pm unbalance issue > > > Cheers, > > Martin > > > -- > 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 --- 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/sdhci.c b/drivers/mmc/host/sdhci.c index 9ddef47..f892757 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1734,9 +1734,15 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) struct sdhci_host *host = mmc_priv(mmc); unsigned long flags; + if (enable) + sdhci_runtime_pm_get(host); + spin_lock_irqsave(&host->lock, flags); sdhci_enable_sdio_irq_nolock(host, enable); spin_unlock_irqrestore(&host->lock, flags); + + if (!enable) + sdhci_runtime_pm_put(host); }