From patchwork Thu Jan 28 09:42:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 8148301 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 6325CBEEE5 for ; Thu, 28 Jan 2016 10:10:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B90E20212 for ; Thu, 28 Jan 2016 10:10:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D646120211 for ; Thu, 28 Jan 2016 10:10:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754857AbcA1KKX (ORCPT ); Thu, 28 Jan 2016 05:10:23 -0500 Received: from mail-db3on0060.outbound.protection.outlook.com ([157.55.234.60]:18228 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751138AbcA1KKS (ORCPT ); Thu, 28 Jan 2016 05:10:18 -0500 X-Greylist: delayed 1877 seconds by postgrey-1.27 at vger.kernel.org; Thu, 28 Jan 2016 05:10:17 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-nxp-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VlocZRMoMZPJXlSRafuP5UQxV4XlJl4EjyBOlCU4V/M=; b=JVfPQADj2fnt6C+dTCCdHA01Ef+0ZruXAGGHAA3jCz0s943F6VXU7F1qFID66rt/cmp45SZXcYLKsfnRgNmajh+ASUpl4AAcuQu2Lj7dfuYiA27IznJUSX5VJIBXVO4LgeXdqb9Wb7eXrlYqaVdkEDshriVW37jdxcYmH6Ocuao= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=haibo.chen@nxp.com; Received: from b51421-server.ap.freescale.net (123.151.195.52) by DB3PR04MB0553.eurprd04.prod.outlook.com (10.160.43.25) with Microsoft SMTP Server (TLS) id 15.1.390.13; Thu, 28 Jan 2016 09:38:53 +0000 From: Haibo Chen To: CC: , , , Subject: [PATCH] mmc: sdhci: disable irq in sdhci host suspend ranther than free this irq Date: Thu, 28 Jan 2016 17:42:26 +0800 Message-ID: <1453974146-20951-1-git-send-email-haibo.chen@nxp.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [123.151.195.52] X-ClientProxiedBy: KL1PR03CA0036.apcprd03.prod.outlook.com (25.165.63.46) To DB3PR04MB0553.eurprd04.prod.outlook.com (25.160.43.25) X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0553; 2:J+QpOUKntGCfc/yrp3VlbBcxMQ0rZosBd2u4P4azNUgBGYezjjzdZCzgZ2Gbaw7eQk8zGAZdOhhWFHL6YbFrz9XAxRshSaNhWEka8Ac1XUxQNwrsuiTAesy250iCzFQ9omenQLBu6V6YmzsJscXUyQ==; 3:Z3FZe0xRn6iehZkrCYslD1eFlIB3gSOPLMd2onS0OjWTKbtsbylTION2EYmQiET/4kES4NU2zwfe/rIreyfa5Xb8Y5x7h92AO2etAlwT8VRy5mxQtrxWeA84Vn6X38eL; 25:xDVV6Y7fIuEEdD0lG8cg0hEEAcLQAqedqDR4Teb3C/Z+G44GZ9dCL3A8PuKoAVX2yXfXMTPpI94t9Fzm/gpg3EPhyb25EJjLIj/aDNJd9tl8po/gICT61GM4jaPCfIdltM3DUQe1eC2jqEZSAoEStJkudx6EZvlMAtzJPYxzkSNQcc/163hucBon0Pd2HZPjK3yZC95bd7DuGpZ1qGW3bEuU22uUAHJj1zfFhqoklT/+dLDFSQu9u9bk5l+EbiZt X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB3PR04MB0553; X-MS-Office365-Filtering-Correlation-Id: 4525b6d0-ee9b-48dc-768d-08d327c6d794 X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0553; 20:Sku0av8ewo4s/Y1AjXvBDq7+meRQg5RROXobc/U3aznzUDa/HRRSqCL/ds/fswiLriADLnnKtrsh6uGaxaZFbuOndLQ+xYb7UzoLgrsPS49EONMlpYC4/fYb71GzDBy1XtqlF0IuoGlIVnc/EwWvuGcrr9YHNGa66B+PAtg9jJDyjTwp0/0CCkQIjhEmvzoLCCW2IzqEhMZZlBoghpvrOZNKy9mSm+HSkg2pkkrp998SpspZ3fpIx9BjBRLlTp+pIa9T7HSlU2xq7U/cMni/C2lxKrKfi0SrLX0Lyg73vgYccWTYzsrT/yJOR6mU/2K0fOcD3RWCk5SpIZghiujBQYPEkrxADd8ITgx1WLYvjA3zc+x6dZFb4vL/hDIE6/gtuErqAQraS0QQNozLBmm/q7ObQJbKf+SOLPEmnBs0u29AMwAjvuMAulq8TX4GuWML6leFjWfEQVvfGQVDIHR+uV2NAR2M6Vxzxiqp8pFVpijAvzwdtmd/AcNlsPPHWjr4; 4:/0ZBGN8b32QqLCvF5toickC3gWAI3zfJzbc6dnaS4du3iadhmrn32YbbF35RX7+Temeyg0DMP1SiRyw2A7qI4eSE14UToePkZkHn//lqBpCsYFQKbJviH05H/QMAZSv3u8oi+zE+MyL+9FmM5VzcPr1gTIgPMSeKGTbu/ik9ekyQRP5Pg1Y3ZyU1Ml0J/S9il3POdMUNlba8/PD3cO7mSvHeGj5lEW60n2Vp1CCamRp8uTo77Mw0S77eoAVrJDFHoi1+Lv1a+qb7s+8ISUdA3AKirKfpvSbCo6m7wVLWBb4n8lqqcpNGoKOoYy/iU+AiGd6crvEChhQzVZei/jyVhM2NK5YpRToqflsm9w3nEqgBiTB1ShNqsLy80I9bwUY3dw6bKlygbZr2L/yCCpYfHhesfNPmueN/GCK90L MKtOM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:DB3PR04MB0553; BCL:0; PCL:0; RULEID:; SRVR:DB3PR04MB0553; X-Forefront-PRVS: 083526BF8A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(189002)(199003)(50226001)(5008740100001)(101416001)(33646002)(122386002)(36756003)(3470700001)(3846002)(6116002)(40100003)(1096002)(92566002)(586003)(48376002)(4326007)(2906002)(42186005)(50986999)(110136002)(19580395003)(19580405001)(97736004)(2351001)(47776003)(81156007)(87976001)(50466002)(5001960100002)(86362001)(106356001)(229853001)(189998001)(105586002)(66066001)(5003940100001)(77096005)(5004730100002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR04MB0553; H:b51421-server.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR04MB0553; 23:MNR1gbuWbs3lMnN/nP0Y+IBdGBGZZsuuhnsnZ4YIJ?= =?us-ascii?Q?NPfJdm3evA5s8Fb0IC0yUoge6lcJeiBWxbfsH0GRog8IoqnAXy6b6bQAOSAj?= =?us-ascii?Q?PW/jfnPm9A5v6b06OVu4veMLAraL55LQBXwq5NVs2wFb3EfGNA+gX4HBhHg3?= =?us-ascii?Q?LLHdpZQ5AW7cUYha3fAvHJamAVbgRocU7oATdouHNUPjPwg0E7228ckYEfVE?= =?us-ascii?Q?dtJxyAZXluI9uhiWnGX5SXlVz4d273lz1gCgBNYgc+pNHVnORKjDCN5/I10p?= =?us-ascii?Q?6oBJFZAw+WNahRphlx7l5zPpgw61vSACY3o4GtXDs78lBRFvkrNOgdtasqgy?= =?us-ascii?Q?s1BJIVeoJjKqAvcDbv8rdfnHUwrjZTwe8S/8yeTagDYDbvrYramIJnBMYMyW?= =?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IIMYL9TzjNb4g13IlQiA/7/ATEYLsv40jvvUkJiLh1CjESQ0u+yd4/X8asDSpk= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2016 09:38:53.0085 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR04MB0553 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Currently sdhci driver free irq in host suspend, and call request_threaded_irq() in host resume. But during host resume, Ctrl+C can impact sdhci host resume, see the error log: CPU1 is up PM: noirq resume of devices complete after 0.637 msecs imx-sdma 30bd0000.sdma: loaded firmware 4.1 PM: early resume of devices complete after 0.774 msecs dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -4 PM: Device 30b40000.usdhc failed to resume: error -4 dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -4 PM: Device 30b50000.usdhc failed to resume: error -4 dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -4 PM: Device 30b60000.usdhc failed to resume: error -4 fec 30be0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx mmc0: Timeout waiting for hardware interrupt. mmc0: Timeout waiting for hardware interrupt. mmc0: Timeout waiting for hardware interrupt. mmc0: Timeout waiting for hardware interrupt. mmc0: Timeout waiting for hardware interrupt. mmc0: Timeout waiting for hardware interrupt. mmc0: error -110 during resume (card was removed?) mmc2: Timeout waiting for hardware interrupt. mmc2: Timeout waiting for hardware interrupt. mmc2: error -110 during resume (card was removed?) In request_threaded_irq-> __setup_irq-> kthread_create ->kthread_create_on_node, the comment shows that SIGKILLed will impact the kthread create, and return -EINTR. This patch replace them with disable|enable_irq(), that will prevent IRQs from being propagated to the sdhci driver. Fixes: 781e989cf593 ("mmc: sdhci: convert to new SDIO IRQ handling") Signed-off-by: Haibo Chen --- drivers/mmc/host/sdhci.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index d622435..4b1646b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2686,7 +2686,7 @@ int sdhci_suspend_host(struct sdhci_host *host) host->ier = 0; sdhci_writel(host, 0, SDHCI_INT_ENABLE); sdhci_writel(host, 0, SDHCI_SIGNAL_ENABLE); - free_irq(host->irq, host); + disable_irq(host->irq); } else { sdhci_enable_irq_wakeups(host); enable_irq_wake(host->irq); @@ -2698,8 +2698,6 @@ EXPORT_SYMBOL_GPL(sdhci_suspend_host); int sdhci_resume_host(struct sdhci_host *host) { - int ret = 0; - if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) { if (host->ops->enable_dma) host->ops->enable_dma(host); @@ -2718,11 +2716,7 @@ int sdhci_resume_host(struct sdhci_host *host) } if (!device_may_wakeup(mmc_dev(host->mmc))) { - ret = request_threaded_irq(host->irq, sdhci_irq, - sdhci_thread_irq, IRQF_SHARED, - mmc_hostname(host->mmc), host); - if (ret) - return ret; + enable_irq(host->irq); } else { sdhci_disable_irq_wakeups(host); disable_irq_wake(host->irq); @@ -2730,7 +2724,7 @@ int sdhci_resume_host(struct sdhci_host *host) sdhci_enable_card_detection(host); - return ret; + return 0; } EXPORT_SYMBOL_GPL(sdhci_resume_host);