From patchwork Mon Jan 24 08:33:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 500521 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 p0OJh2Ue026265 for ; Mon, 24 Jan 2011 19:43:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751397Ab1AXIdR (ORCPT ); Mon, 24 Jan 2011 03:33:17 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:60172 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751312Ab1AXIdR convert rfc822-to-8bit (ORCPT ); Mon, 24 Jan 2011 03:33:17 -0500 Received: by fxm20 with SMTP id 20so3744506fxm.19 for ; Mon, 24 Jan 2011 00:33:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=EB/7WdR+/pZyvLvwyzDzifjfeqEw05PyJa2qU0MMqFQ=; b=xhqxIdoIdBxPK0lni1nGbtUiqOPmW0CEkQS++R+A5MNYN2AK1CqCa6L5QbNxigZ1fJ 8areGwF7TTQxyTHKdjX6D0SVoF5lnYJI6TpCBNqpeO9MFDtiyIfYYVUaqbREgtDfMIGV cCtM3/Wb65fRDcaN3ae+0FnGpSfHUfJWvic2w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=vZUy4xVCKHjthrYfpn7D0TVEwsA0sH11MANRKdqrqpiOskxUgeKobwh3XxK6G7DZ7Z ouhhiWDyyCc7KLRpQQ8SKW9bSywmS813vnwcIGkZOxdd/9eaX/bTRZshpZXNKlHgcdjD k8BD5w2h59pI9AY+wghIfuyHUF3qyK6rN//Ok= MIME-Version: 1.0 Received: by 10.223.78.205 with SMTP id m13mr3907055fak.79.1295857996075; Mon, 24 Jan 2011 00:33:16 -0800 (PST) Received: by 10.223.122.210 with HTTP; Mon, 24 Jan 2011 00:33:16 -0800 (PST) In-Reply-To: References: Date: Mon, 24 Jan 2011 03:33:16 -0500 Message-ID: Subject: Re: [PATCH] mmc: clear all interrupt in suspend before free_irq From: zhangfei gao To: Nicolas Pitre Cc: linux-mmc@vger.kernel.org, Ohad Ben-Cohen , Bing Zhao , Chris Ball , Raymond Wu Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 24 Jan 2011 19:43:05 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index aacd78c..a813b8b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1684,8 +1684,12 @@ out: /* * We have to delay this as it calls back into the driver. */ - if (cardint) - mmc_signal_sdio_irq(host->mmc); + if (cardint) { + if(host->suspended) + sdhci_enable_sdio_irq(host->mmc, 0); + else + mmc_signal_sdio_irq(host->mmc); + } return result; } @@ -1709,6 +1713,7 @@ int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state) return ret; free_irq(host->irq, host); + host->suspended = true; if (host->vmmc) ret = regulator_disable(host->vmmc); @@ -1742,6 +1747,7 @@ int sdhci_resume_host(struct sdhci_host *host) sdhci_init(host, (host->mmc->pm_flags & MMC_PM_KEEP_POWER)); mmiowb(); + host->suspended = false; ret = mmc_resume_host(host->mmc); sdhci_enable_card_detection(host); diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 83bd9f7..764666a 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -140,6 +140,7 @@ struct sdhci_host { struct timer_list timer; /* Timer for timeouts */ unsigned int caps; /* Alternative capabilities */ + bool suspended; unsigned int ocr_avail_sdio; /* OCR bit masks */ unsigned int ocr_avail_sd;