* [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
@ 2012-10-08 8:59 Yuvaraj CD
2012-10-08 12:55 ` Girish K S
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Yuvaraj CD @ 2012-10-08 8:59 UTC (permalink / raw)
To: linux-mmc, linux-samsung-soc
Cc: cjb, will.newton, kgene.kim, girish.shivananjappa, thomas.abraham,
patches, Yuvaraj CD
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 <yuvaraj.cd@samsung.com>
---
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
2012-10-08 8:59 [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host Yuvaraj CD
@ 2012-10-08 12:55 ` Girish K S
2012-10-08 12:58 ` Will Newton
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Girish K S @ 2012-10-08 12:55 UTC (permalink / raw)
To: Yuvaraj CD
Cc: linux-mmc, linux-samsung-soc, cjb, will.newton, kgene.kim,
thomas.abraham, patches, Yuvaraj CD
On 8 October 2012 17:59, Yuvaraj CD <yuvaraj.cd@gmail.com> 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 <yuvaraj.cd@samsung.com>
> ---
> 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);
> +
Makes sense
Reviewed By: Girish K S <girish.shivananjappa@linaro.org>
> /* 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
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
2012-10-08 8:59 [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host Yuvaraj CD
2012-10-08 12:55 ` Girish K S
@ 2012-10-08 12:58 ` Will Newton
2012-10-23 21:19 ` Chris Ball
[not found] ` <CAAG0J9_ngZm7uGopaW6rdBUDQZhQWqt6gd=y1i5BifsGrZg-hg@mail.gmail.com>
3 siblings, 0 replies; 11+ messages in thread
From: Will Newton @ 2012-10-08 12:58 UTC (permalink / raw)
To: Yuvaraj CD
Cc: linux-mmc, linux-samsung-soc, cjb, will.newton, kgene.kim,
girish.shivananjappa, thomas.abraham, patches, Yuvaraj CD
On Mon, Oct 8, 2012 at 9:59 AM, Yuvaraj CD <yuvaraj.cd@gmail.com> 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 <yuvaraj.cd@samsung.com>
> ---
> drivers/mmc/host/dw_mmc.c | 29 +++++++++++++++--------------
> 1 file changed, 15 insertions(+), 14 deletions(-)
Ideally I think it would be cleaner to break up the slot
initialization into two parts, one that allocates and sets up the slot
and the other that calls mmc_add_host, but that's a more substantial
bit of work and would also complicate the error handling. This looks
like it should be safe though, so:
Acked-by: Will Newton <will.newton@imgtec.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
2012-10-08 8:59 [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host Yuvaraj CD
2012-10-08 12:55 ` Girish K S
2012-10-08 12:58 ` Will Newton
@ 2012-10-23 21:19 ` Chris Ball
2012-10-25 10:09 ` Yuvaraj CD
[not found] ` <CAAG0J9_ngZm7uGopaW6rdBUDQZhQWqt6gd=y1i5BifsGrZg-hg@mail.gmail.com>
3 siblings, 1 reply; 11+ messages in thread
From: Chris Ball @ 2012-10-23 21:19 UTC (permalink / raw)
To: Yuvaraj CD
Cc: linux-mmc, linux-samsung-soc, will.newton, kgene.kim,
girish.shivananjappa, thomas.abraham, patches, Yuvaraj CD
Hi,
On Mon, Oct 08 2012, 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 <yuvaraj.cd@samsung.com>
Is "Yuvaraj CD" your legal name? We should use your full name so that
we can track copyright attribution properly.
Thanks!
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
2012-10-23 21:19 ` Chris Ball
@ 2012-10-25 10:09 ` Yuvaraj CD
2012-10-25 12:43 ` Chris Ball
0 siblings, 1 reply; 11+ messages in thread
From: Yuvaraj CD @ 2012-10-25 10:09 UTC (permalink / raw)
To: Chris Ball
Cc: Yuvaraj CD, linux-mmc, linux-samsung-soc, will.newton, kgene.kim,
girish.shivananjappa, thomas.abraham, patches, Yuvaraj CD
Yes,its legal name."Yuvaraj C D".
On Wed, Oct 24, 2012 at 2:49 AM, Chris Ball <cjb@laptop.org> wrote:
> Hi,
>
> On Mon, Oct 08 2012, 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 <yuvaraj.cd@samsung.com>
>
> Is "Yuvaraj CD" your legal name? We should use your full name so that
> we can track copyright attribution properly.
>
> Thanks!
>
> - Chris.
> --
> Chris Ball <cjb@laptop.org> <http://printf.net/>
> One Laptop Per Child
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
2012-10-25 10:09 ` Yuvaraj CD
@ 2012-10-25 12:43 ` Chris Ball
0 siblings, 0 replies; 11+ messages in thread
From: Chris Ball @ 2012-10-25 12:43 UTC (permalink / raw)
To: Yuvaraj CD
Cc: Yuvaraj CD, linux-mmc, linux-samsung-soc, will.newton, kgene.kim,
girish.shivananjappa, thomas.abraham, patches, Yuvaraj CD
Hi,
On Thu, Oct 25 2012, Yuvaraj CD wrote:
> Yes,its legal name."Yuvaraj C D".
Thanks for letting me know; pushed to mmc-next for 3.7.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
[not found] ` <CAAG0J9_ngZm7uGopaW6rdBUDQZhQWqt6gd=y1i5BifsGrZg-hg@mail.gmail.com>
@ 2012-11-19 13:20 ` James Hogan
2012-11-20 5:35 ` Yuvaraj Kumar
0 siblings, 1 reply; 11+ messages in thread
From: James Hogan @ 2012-11-19 13:20 UTC (permalink / raw)
To: Yuvaraj CD, linux-mmc, linux-samsung-soc
Cc: Chris Ball (laptop.org), Will, kgene.kim, Girish K S (Linaro),
Thomas Abraham (Linaro), patches, Yuvaraj CD, Seungwon Jeon,
Jaehoon Chung
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 <yuvaraj.cd@samsung.com>
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
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);
> ---
> 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
>
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
2012-11-19 13:20 ` James Hogan
@ 2012-11-20 5:35 ` Yuvaraj Kumar
2012-11-20 9:39 ` James Hogan
0 siblings, 1 reply; 11+ messages in thread
From: Yuvaraj Kumar @ 2012-11-20 5:35 UTC (permalink / raw)
To: James Hogan
Cc: linux-mmc, linux-samsung-soc, Chris Ball (laptop.org), Will,
kgene.kim, Girish K S (Linaro), Thomas Abraham (Linaro), patches,
Yuvaraj CD, Seungwon Jeon, Jaehoon Chung
Dear James,
Its not sufficient.In my case, sdio_reset command was submitted to
dw_mmc controller before interrupts are enabled.
By looking at your log,it seems something wrong with frequency set by
your U-boot.
Best Regards
Yuvaraj
On Mon, Nov 19, 2012 at 6:50 PM, James Hogan <james.hogan@imgtec.com> wrote:
> 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 <yuvaraj.cd@samsung.com>
>
> 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
>
> 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);
>
>
>> ---
>> 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
>>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
2012-11-20 5:35 ` Yuvaraj Kumar
@ 2012-11-20 9:39 ` James Hogan
2012-11-21 3:21 ` Jaehoon Chung
0 siblings, 1 reply; 11+ messages in thread
From: James Hogan @ 2012-11-20 9:39 UTC (permalink / raw)
To: Yuvaraj Kumar
Cc: linux-mmc, linux-samsung-soc, Chris Ball (laptop.org), Will,
kgene.kim, Girish K S (Linaro), Thomas Abraham (Linaro), patches,
Yuvaraj CD, Seungwon Jeon, Jaehoon Chung
Hi Yuvaraj,
On 20/11/12 05:35, Yuvaraj Kumar wrote:
> Its not sufficient.In my case, sdio_reset command was submitted to
> dw_mmc controller before interrupts are enabled.
> By looking at your log,it seems something wrong with frequency set by
> your U-boot.
I'm not using U-boot, I'm booting with JTAG. In any case it works if I
revert your patch so I think the clocks are fine. I'll continue
debugging it and see if I can figure out what's happening.
Cheers
James
>
> Best Regards
> Yuvaraj
>
> On Mon, Nov 19, 2012 at 6:50 PM, James Hogan <james.hogan@imgtec.com> wrote:
>> 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 <yuvaraj.cd@samsung.com>
>>
>> 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
>>
>> 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);
>>
>>
>>> ---
>>> 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
>>>
>>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
2012-11-20 9:39 ` James Hogan
@ 2012-11-21 3:21 ` Jaehoon Chung
2012-11-23 13:21 ` James Hogan
0 siblings, 1 reply; 11+ messages in thread
From: Jaehoon Chung @ 2012-11-21 3:21 UTC (permalink / raw)
To: James Hogan
Cc: Yuvaraj Kumar, linux-mmc, linux-samsung-soc,
Chris Ball (laptop.org), Will, kgene.kim, Girish K S (Linaro),
Thomas Abraham (Linaro), patches, Yuvaraj CD, Seungwon Jeon
Hi All,
Well, i didn't find the James's error message.
But i confused about the clock value.
Bus speed : 99840000Hz
request : 200000Hz
Div : 250
If bus_speed is divided with div, then actual value should be 399360Hz.
But this log is produced 199680Hz. What's wrong?
I think this message can be confused to debug.
Best Regards,
Jaehoon Chung
On 11/20/2012 06:39 PM, James Hogan wrote:
> Hi Yuvaraj,
>
> On 20/11/12 05:35, Yuvaraj Kumar wrote:
>> Its not sufficient.In my case, sdio_reset command was submitted to
>> dw_mmc controller before interrupts are enabled.
>> By looking at your log,it seems something wrong with frequency set by
>> your U-boot.
>
> I'm not using U-boot, I'm booting with JTAG. In any case it works if I
> revert your patch so I think the clocks are fine. I'll continue
> debugging it and see if I can figure out what's happening.
>
> Cheers
> James
>
>>
>> Best Regards
>> Yuvaraj
>>
>> On Mon, Nov 19, 2012 at 6:50 PM, James Hogan <james.hogan@imgtec.com> wrote:
>>> 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 <yuvaraj.cd@samsung.com>
>>>
>>> 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
>>>
>>> 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);
>>>
>>>
>>>> ---
>>>> 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
>>>>
>>>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
2012-11-21 3:21 ` Jaehoon Chung
@ 2012-11-23 13:21 ` James Hogan
0 siblings, 0 replies; 11+ messages in thread
From: James Hogan @ 2012-11-23 13:21 UTC (permalink / raw)
To: Jaehoon Chung
Cc: Yuvaraj Kumar, linux-mmc, linux-samsung-soc,
Chris Ball (laptop.org), Will, kgene.kim, Girish K S (Linaro),
Thomas Abraham (Linaro), patches, Yuvaraj CD, Seungwon Jeon
Hi,
I looked at the clock thing, and it appears that there's an extra divide
by two in hardware (the TRM says "Clock division is 2*n"), so those
numbers do appear to be correct.
>From some experimentation the other day, it appeared to be a race
condition which is affected by the position of the dev_info (I have a
JTAG console enabled which adds multi-millisecond delays every time
something is printed). So I think the race was always there, but is only
now showing up.
More information:
* it usually alternates between working and not working (works on first
boot), I'm just hard resetting rather than shutting down cleanly.
* unplugging the SD card between boots prevents it going wrong (I don't
believe our board has power control over SD card).
* using old kernel first and then new kernel, failure can still happen,
so the card could always get into the funny state, but it's only now
causing problems.
* forcing a GPIO bitbanging reset on probe to unlock the card stops it
failing (usually this sequence is only initiated if the card is locked
up - i.e. busy. It's our own quirk to the driver).
I'll have another look at it sometime and report back if I find the root
cause.
Thanks
James
On 21/11/12 03:21, Jaehoon Chung wrote:
> Hi All,
>
> Well, i didn't find the James's error message.
> But i confused about the clock value.
>
> Bus speed : 99840000Hz
> request : 200000Hz
> Div : 250
>
> If bus_speed is divided with div, then actual value should be 399360Hz.
> But this log is produced 199680Hz. What's wrong?
>
> I think this message can be confused to debug.
>
> Best Regards,
> Jaehoon Chung
>
> On 11/20/2012 06:39 PM, James Hogan wrote:
>> Hi Yuvaraj,
>>
>> On 20/11/12 05:35, Yuvaraj Kumar wrote:
>>> Its not sufficient.In my case, sdio_reset command was submitted to
>>> dw_mmc controller before interrupts are enabled.
>>> By looking at your log,it seems something wrong with frequency set by
>>> your U-boot.
>>
>> I'm not using U-boot, I'm booting with JTAG. In any case it works if I
>> revert your patch so I think the clocks are fine. I'll continue
>> debugging it and see if I can figure out what's happening.
>>
>> Cheers
>> James
>>
>>>
>>> Best Regards
>>> Yuvaraj
>>>
>>> On Mon, Nov 19, 2012 at 6:50 PM, James Hogan <james.hogan@imgtec.com> wrote:
>>>> 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 <yuvaraj.cd@samsung.com>
>>>>
>>>> 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
>>>>
>>>> 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);
>>>>
>>>>
>>>>> ---
>>>>> 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
>>>>>
>>>>
>>
>>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-11-23 13:21 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-08 8:59 [PATCH] mmc: dw_mmc: enable controller interrupt before calling mmc_start_host Yuvaraj CD
2012-10-08 12:55 ` Girish K S
2012-10-08 12:58 ` Will Newton
2012-10-23 21:19 ` Chris Ball
2012-10-25 10:09 ` Yuvaraj CD
2012-10-25 12:43 ` Chris Ball
[not found] ` <CAAG0J9_ngZm7uGopaW6rdBUDQZhQWqt6gd=y1i5BifsGrZg-hg@mail.gmail.com>
2012-11-19 13:20 ` James Hogan
2012-11-20 5:35 ` Yuvaraj Kumar
2012-11-20 9:39 ` James Hogan
2012-11-21 3:21 ` Jaehoon Chung
2012-11-23 13:21 ` James Hogan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).