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 CD X-Patchwork-Id: 1564641 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E254A3FC1A for ; Mon, 8 Oct 2012 09:00:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751007Ab2JHJAJ (ORCPT ); Mon, 8 Oct 2012 05:00:09 -0400 Received: from mail-da0-f46.google.com ([209.85.210.46]:59620 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937Ab2JHJAI (ORCPT ); Mon, 8 Oct 2012 05:00:08 -0400 Received: by mail-da0-f46.google.com with SMTP id n41so1454353dak.19 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 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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");