From patchwork Mon Oct 8 08:59:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuvaraj X-Patchwork-Id: 12041 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8D28B1A5598 for ; Mon, 8 Oct 2012 09:00:12 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 05733A18B02 for ; Mon, 8 Oct 2012 09:00:11 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so8445243iej.11 for ; Mon, 08 Oct 2012 02:00:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=f0TbeGn1xe0O8U0A71TpTKU8MmIraXR1f3q2PCJs00w=; b=XL59TTIUpk6poZBLuxSyLF4Z6cv53CbEyFO+4j/BTbiTLF3SqWMs56044dz0iKIINZ BXWsU2wyv8C6KccwOWXoO3SRhArmTWkK9toVzho4EE3MaRr6APPHKNGTxtdl8/y/7Oof lxS+ajbD6B/zW/OstQoimJd1h27EEbahzDZ4wB2iYnqJDXJ2mJ5gtW3cxsZHQPBRWD3q ROyQYgoK8/CymQmG1e1/94K+h8fWbNtLPuoDDs80v0JejwUl28YEdyEf26pxtjk61qSe 6rJLqSQPBGTScS6XysMKcvikoK/IXcJai90RNJcZ0n7tpsxd0qeGRrB16mO8y381tpJN o/Dg== Received: by 10.50.194.136 with SMTP id hw8mr7546187igc.28.1349686811366; Mon, 08 Oct 2012 02:00:11 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.45.70 with SMTP id k6csp28941igm; Mon, 8 Oct 2012 02:00:10 -0700 (PDT) Received: by 10.66.75.98 with SMTP id b2mr103866paw.48.1349686810352; Mon, 08 Oct 2012 02:00:10 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id s9si16719021pav.204.2012.10.08.02.00.07 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 02:00:10 -0700 (PDT) Received-SPF: pass (google.com: domain of yuvaraj.cd@gmail.com designates 209.85.220.50 as permitted sender) client-ip=209.85.220.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yuvaraj.cd@gmail.com designates 209.85.220.50 as permitted sender) smtp.mail=yuvaraj.cd@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-pa0-f50.google.com with SMTP id hz11so4259394pad.37 for ; Mon, 08 Oct 2012 02:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=f0TbeGn1xe0O8U0A71TpTKU8MmIraXR1f3q2PCJs00w=; b=dQtP23Forbji3G7PXPCRBDpe9lFCW+bW0f4pmJgCR6QDS91DR633S/Uv8gmJL0/vQq 1IQbbvaoDlmL0cNh/qQdP4PsVsUUDwEeWPvJNk2m/B3W7G8J13qUrsbz6+2P/LMhadJv NO8C1GfNEMe19WGR1kZTuX+wOagszdmUoL+LM+xp5ESkUDJ/ohRH8GVmbyC5Tq3XNYoE VMfYEb6C/Ni4hKYoEqHJ+cYHXPAfOVSJ0o4KhnP+zcSJ8dplHtEZRCC5J14vVlotFOaI Eny2LcSY45cYIZQTUnMLnpv/rTZ1APg+kxEP2oUsyiwv3OjGi45MjBsKwCyLQDIlBMNj giTw== Received: by 10.66.77.7 with SMTP id o7mr41394796paw.37.1349686807838; Mon, 08 Oct 2012 02:00:07 -0700 (PDT) Received: from yuvaraj-ubuntu.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id e9sm10553038pay.34.2012.10.08.02.00.04 (version=SSLv3 cipher=OTHER); Mon, 08 Oct 2012 02:00:07 -0700 (PDT) From: Yuvaraj CD To: linux-mmc@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: cjb@laptop.org, will.newton@imgtec.com, kgene.kim@samsung.com, girish.shivananjappa@linaro.org, thomas.abraham@linaro.org, patches@linaro.org, Yuvaraj CD Subject: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host Date: Mon, 8 Oct 2012 14:29:51 +0530 Message-Id: <1349686791-19652-1-git-send-email-yuvaraj.cd@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQk7h/ANcQqTzyuzq7hz6puzjr5zpSJHYz/c7VD+Dpgf+P9Of/V3G9BDftP8fun5DUIA9ZLU As mmc_start_host is getting called before enabling the dw_mmc controller interrupt, there is a problem of missing the SDMMC_INT_CMD_DONE for the very first command sent by the sdio_reset. This problem occurs only when we disable MMC debugging i.e, MMC_DEBUG [=n]. Hence this patch enables the dw_mmc controller interrupt before mmc_start_host. Signed-off-by: Yuvaraj CD Acked-by: Will Newton --- drivers/mmc/host/dw_mmc.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index a23af77..729c031 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2233,6 +2233,21 @@ int dw_mci_probe(struct dw_mci *host) else host->num_slots = ((mci_readl(host, HCON) >> 1) & 0x1F) + 1; + /* + * Enable interrupts for command done, data over, data empty, card det, + * receive ready and error such as transmit, receive timeout, crc error + */ + mci_writel(host, RINTSTS, 0xFFFFFFFF); + mci_writel(host, INTMASK, SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER | + SDMMC_INT_TXDR | SDMMC_INT_RXDR | + DW_MCI_ERROR_FLAGS | SDMMC_INT_CD); + mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); /* Enable mci interrupt */ + + dev_info(host->dev, "DW MMC controller at irq %d, " + "%d bit host data width, " + "%u deep fifo\n", + host->irq, width, fifo_size); + /* We need at least one slot to succeed */ for (i = 0; i < host->num_slots; i++) { ret = dw_mci_init_slot(host, i); @@ -2262,20 +2277,6 @@ int dw_mci_probe(struct dw_mci *host) else host->data_offset = DATA_240A_OFFSET; - /* - * Enable interrupts for command done, data over, data empty, card det, - * receive ready and error such as transmit, receive timeout, crc error - */ - mci_writel(host, RINTSTS, 0xFFFFFFFF); - mci_writel(host, INTMASK, SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER | - SDMMC_INT_TXDR | SDMMC_INT_RXDR | - DW_MCI_ERROR_FLAGS | SDMMC_INT_CD); - mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); /* Enable mci interrupt */ - - dev_info(host->dev, "DW MMC controller at irq %d, " - "%d bit host data width, " - "%u deep fifo\n", - host->irq, width, fifo_size); if (host->quirks & DW_MCI_QUIRK_IDMAC_DTO) dev_info(host->dev, "Internal DMAC interrupt fix enabled.\n");