From patchwork Mon May 18 14:23:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabu Thangamuthu X-Patchwork-Id: 6429731 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 66606C0432 for ; Mon, 18 May 2015 14:23:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8112A205BE for ; Mon, 18 May 2015 14:23:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50297205D4 for ; Mon, 18 May 2015 14:23:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932160AbbEROXZ (ORCPT ); Mon, 18 May 2015 10:23:25 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:35905 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753072AbbEROXV convert rfc822-to-8bit (ORCPT ); Mon, 18 May 2015 10:23:21 -0400 Received: from us02secmta1.synopsys.com (us02secmta1.synopsys.com [10.12.235.96]) by smtprelay.synopsys.com (Postfix) with ESMTP id 0434F10C1104; Mon, 18 May 2015 07:23:20 -0700 (PDT) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id DC3AA4E213; Mon, 18 May 2015 07:23:20 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id AE95A4E202; Mon, 18 May 2015 07:23:20 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 9E182279; Mon, 18 May 2015 07:23:20 -0700 (PDT) Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id 8B08E278; Mon, 18 May 2015 07:23:20 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 18 May 2015 07:23:20 -0700 Received: from IN01WEMBXB.internal.synopsys.com ([169.254.4.157]) by IN01WEHTCB.internal.synopsys.com ([::1]) with mapi id 14.03.0195.001; Mon, 18 May 2015 19:53:17 +0530 From: Prabu Thangamuthu To: Seungwon Jeon , Jaehoon Chung , Ulf Hansson , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Manjunath M Bettegowda , "prabu.t@synopsys.com" Subject: [PATCH 1/1] dw_mmc: insmod followed by rmmod will hung for eMMC Thread-Topic: [PATCH 1/1] dw_mmc: insmod followed by rmmod will hung for eMMC Thread-Index: AdCRdMuGGTOLoEHsScuQ8f9FLu4S4g== Date: Mon, 18 May 2015 14:23:16 +0000 Message-ID: <705D14B1C7978B40A723277C067CEDE245182CD0@IN01WEMBXB.internal.synopsys.com> Accept-Language: en-US, en-IN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.144.112.157] 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Removing dw_mmc driver immediately after inserting the dw_mmc driver is getting hung for eMMC device. Root cause for this issue is, dw_mci_remove will disable all the interrupts then it will call dw_mci_cleanup_slot. dw_mci_cleanup_slot is issuing CMD6 to disable boot partition access and it's waiting for command complete interrupt. Since INTMASK was already cleared by dw_mci_remove, command complete interrupt is not reaching the system. This leads to process hung. Signed-off-by: Prabu Thangamuthu --- drivers/mmc/host/dw_mmc.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 5f5adaf..f0a0aff 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2941,15 +2941,15 @@ void dw_mci_remove(struct dw_mci *host) { int i; - mci_writel(host, RINTSTS, 0xFFFFFFFF); - mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */ - for (i = 0; i < host->num_slots; i++) { dev_dbg(host->dev, "remove slot %d\n", i); if (host->slot[i]) dw_mci_cleanup_slot(host->slot[i], i); } + mci_writel(host, RINTSTS, 0xFFFFFFFF); + mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */ + /* disable clock to CIU */ mci_writel(host, CLKENA, 0); mci_writel(host, CLKSRC, 0);