From patchwork Mon Nov 19 13:20:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 12937 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 53F3723EFB for ; Mon, 19 Nov 2012 13:20:50 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id B2378A19800 for ; Mon, 19 Nov 2012 13:20:49 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so892036iag.11 for ; Mon, 19 Nov 2012 05:20:49 -0800 (PST) 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:message-id :date:from:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-originating-ip:x-sef-processed :x-gm-message-state; bh=RQbI4OuWCg+lSnsSrrOUFivuU3kOus9c12SqmgW4/MY=; b=DJ/edA62ChEX5koPjf8JJCyKENxNKD1EfamIQf/HUX3MvyBcpioHJc65cwyGw2/UsC j8goC2G7hpytJAsH5MERJaqo1I0AfLZy8KVi+STYgO1+kBfaM+pDqxig4127zZwygeDd AwSe64Fk8T1VvLQPBrZdgbFaNn26GumwMw5Hd9gAc+xdME1Beyvs2E26cvy7i8EAu6Yk CHv+olDg4ObPH+QlCaphxVWhrtOM6dmCm/LibA8DA8/YG9hZXKwppsOnF7a1qRUmq7c7 NookuSceL7P1LCejvo8W1NCCwSCBlcxhvk+QMu4UjIQqrdyjy5wkxeZNHgWJYaNV4ymV aERg== Received: by 10.50.213.34 with SMTP id np2mr6445990igc.57.1353331249143; Mon, 19 Nov 2012 05:20:49 -0800 (PST) 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.67.148 with SMTP id n20csp156553igt; Mon, 19 Nov 2012 05:20:47 -0800 (PST) Received: by 10.216.150.205 with SMTP id z55mr4102367wej.85.1353331246953; Mon, 19 Nov 2012 05:20:46 -0800 (PST) Received: from multi.imgtec.com (multi.imgtec.com. [194.200.65.239]) by mx.google.com with ESMTPS id p60si5091870wen.74.2012.11.19.05.20.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 05:20:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of James.Hogan@imgtec.com designates 194.200.65.239 as permitted sender) client-ip=194.200.65.239; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of James.Hogan@imgtec.com designates 194.200.65.239 as permitted sender) smtp.mail=James.Hogan@imgtec.com Message-ID: <50AA322A.1060604@imgtec.com> Date: Mon, 19 Nov 2012 13:20:42 +0000 From: James Hogan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Yuvaraj CD , linux-mmc , CC: "Chris Ball (laptop.org)" , Will , , "Girish K S (Linaro)" , "Thomas Abraham (Linaro)" , , Yuvaraj CD , Seungwon Jeon , Jaehoon Chung Subject: Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host References: <1349686791-19652-1-git-send-email-yuvaraj.cd@samsung.com> In-Reply-To: X-Enigmail-Version: 1.4.4 X-Originating-IP: [192.168.154.65] X-SEF-Processed: 7_3_0_01181__2012_11_19_13_20_43 X-Gm-Message-State: ALoCoQmDahOGFuWuRtQlb/3GQtVWFw3MgMVFwfaPOCUnTu4oqM4MzQbQa1P3c6juAqM3eT5mylUg On 19/11/12 13:01, Yuvaraj CD wrote: > 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 Hi Yuvaraj, I get the following errors after this patch is applied (2da1d7f2948900cd50d38643db39f790edb3cc96, merged in v3.7-rc5) and the driver doesn't work as a result. Reverting it fixes the problem. mmc0: error -110 whilst initialising SD card mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 300000Hz, actual 298922HZ div = 167) mmc0: error -110 whilst initialising SD card mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 200000Hz, actual 199680HZ div = 250) mmc0: error -110 whilst initialising SD card mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 195765Hz, actual 195764HZ div = 255) mmc0: error -110 whilst initialising SD card mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 400000Hz, actual 399360HZ div = 125) mmc0: error -110 whilst initialising SD card mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 300000Hz, actual 298922HZ div = 167) mmc0: error -110 whilst initialising SD card mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 200000Hz, actual 199680HZ div = 250) mmc0: error -110 whilst initialising SD card mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 195765Hz, actual 195764HZ div = 255) mmc0: error -110 whilst initialising SD card The interrupts are already cleared and disabled at the beginning of the probe function, so is the following sufficient (after reverting your patch) to fix the problem you've been observing? Thanks James > --- > 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"); > > -- > 1.7.9.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > -- > James Hogan > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index ec9b5a8..2be9899 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2266,7 +2266,6 @@ int dw_mci_probe(struct dw_mci *host) * 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);