public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
@ 2010-11-30  6:13 Jaehoon Chung
  2010-11-30  6:42 ` Philip Rakity
  2010-11-30  9:56 ` Wolfram Sang
  0 siblings, 2 replies; 15+ messages in thread
From: Jaehoon Chung @ 2010-11-30  6:13 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, kyungmin Park, Andrew Morton, matt

This patch is added quirks for data timeout value.

Some card have problem when suspend/resume.
CMD6(switch command) to switch the bus to high speed mode 
and to set the bus width.

After resuming, the card was initialized...in that time, some
card need set a correct timeout value.
so we add SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL.

Let me know any comment, plz.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
 Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

---
 drivers/mmc/host/sdhci.c  |    6 +++++-
 include/linux/mmc/sdhci.h |    3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 782c0ee..3b93d97 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -655,8 +655,12 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
 
 	WARN_ON(host->data);
 
-	if (data == NULL)
+	if (data == NULL) {
+		if ((host->quirks & SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL) &&
+				(host->cmd->flags & MMC_RSP_BUSY))
+			sdhci_writel(host, 0xE, SDHCI_TIMEOUT_CONTROL);
 		return;
+	}
 
 	/* Sanity checks */
 	BUG_ON(data->blksz * data->blocks > 524288);
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 1fdc673..315ff49 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -83,7 +83,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12		(1<<28)
 /* Controller doesn't have HISPD bit field in HI-SPEED SD card */
 #define SDHCI_QUIRK_NO_HISPD_BIT			(1<<29)
-
+/* Controller need set data timeout value when card is busy */
+#define SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL		(1<<30)
 	int irq;		/* Device IRQ */
 	void __iomem *ioaddr;	/* Mapped address */
 
-- 
1.6.0.4

Thanks
Jaehoon Chung


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* RE: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-11-30  6:13 [RFC Patch] SDHCI: add quirk for data timeout value when card busy Jaehoon Chung
@ 2010-11-30  6:42 ` Philip Rakity
  2010-11-30  7:15   ` Jaehoon Chung
  2010-11-30  9:56 ` Wolfram Sang
  1 sibling, 1 reply; 15+ messages in thread
From: Philip Rakity @ 2010-11-30  6:42 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc@vger.kernel.org
  Cc: Chris Ball, kyungmin Park, Andrew Morton, matt@console-pimps.org


The problem is a little more complicated then this.  During out testing of multiple sd/mmc cards we found some cards that gave incorrect timeout values.   The solution was to define the existing quirk to force the timeout to 0xe.

The timeout problems had nothing to do with the controller being broken nor with suspend/resume.

________________________________________
From: linux-mmc-owner@vger.kernel.org [linux-mmc-owner@vger.kernel.org] On Behalf Of Jaehoon Chung [jh80.chung@samsung.com]
Sent: Monday, November 29, 2010 10:13 PM
To: linux-mmc@vger.kernel.org
Cc: Chris Ball; kyungmin Park; Andrew Morton; matt@console-pimps.org
Subject: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.

This patch is added quirks for data timeout value.

Some card have problem when suspend/resume.
CMD6(switch command) to switch the bus to high speed mode
and to set the bus width.

After resuming, the card was initialized...in that time, some
card need set a correct timeout value.
so we add SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL.

Let me know any comment, plz.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
 Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

---
 drivers/mmc/host/sdhci.c  |    6 +++++-
 include/linux/mmc/sdhci.h |    3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 782c0ee..3b93d97 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -655,8 +655,12 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)

        WARN_ON(host->data);

-       if (data == NULL)
+       if (data == NULL) {
+               if ((host->quirks & SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL) &&
+                               (host->cmd->flags & MMC_RSP_BUSY))
+                       sdhci_writel(host, 0xE, SDHCI_TIMEOUT_CONTROL);
                return;
+       }

        /* Sanity checks */
        BUG_ON(data->blksz * data->blocks > 524288);
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 1fdc673..315ff49 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -83,7 +83,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12             (1<<28)
 /* Controller doesn't have HISPD bit field in HI-SPEED SD card */
 #define SDHCI_QUIRK_NO_HISPD_BIT                       (1<<29)
-
+/* Controller need set data timeout value when card is busy */
+#define SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL               (1<<30)
        int irq;                /* Device IRQ */
        void __iomem *ioaddr;   /* Mapped address */

--
1.6.0.4

Thanks
Jaehoon Chung

--
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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-11-30  6:42 ` Philip Rakity
@ 2010-11-30  7:15   ` Jaehoon Chung
  0 siblings, 0 replies; 15+ messages in thread
From: Jaehoon Chung @ 2010-11-30  7:15 UTC (permalink / raw)
  To: Philip Rakity
  Cc: linux-mmc@vger.kernel.org, Chris Ball, kyungmin Park,
	Andrew Morton, matt@console-pimps.org

Hi Philip.

I know defined that quirk to force the timeout to 0xe.
But..i found some card occured data timeout error when suspend/resume.

actually you can confuse quirk's name..because i use temporary that.
(if need change quirk name, i can)

The problem is below.

1. card probe is done
2. card suspend entered
3. when card resuming, appeared data timeout error. then card removed.

I understood this problem that occured interrupt at incorret time.
(during send cmd6, occured fire busy)
So need set timeout value at Timeout register, in order to not occur interrupt.

And this problem appeared from specific card, so i think good that used quirk


Philip Rakity wrote:
> The problem is a little more complicated then this.  During out testing of multiple sd/mmc cards we found some cards that gave incorrect timeout values.   The solution was to define the existing quirk to force the timeout to 0xe.
> 
> The timeout problems had nothing to do with the controller being broken nor with suspend/resume.
> 
> ________________________________________
> From: linux-mmc-owner@vger.kernel.org [linux-mmc-owner@vger.kernel.org] On Behalf Of Jaehoon Chung [jh80.chung@samsung.com]
> Sent: Monday, November 29, 2010 10:13 PM
> To: linux-mmc@vger.kernel.org
> Cc: Chris Ball; kyungmin Park; Andrew Morton; matt@console-pimps.org
> Subject: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
> 
> This patch is added quirks for data timeout value.
> 
> Some card have problem when suspend/resume.
> CMD6(switch command) to switch the bus to high speed mode
> and to set the bus width.
> 
> After resuming, the card was initialized...in that time, some
> card need set a correct timeout value.
> so we add SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL.
> 
> Let me know any comment, plz.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>  Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> 
> ---
>  drivers/mmc/host/sdhci.c  |    6 +++++-
>  include/linux/mmc/sdhci.h |    3 ++-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 782c0ee..3b93d97 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -655,8 +655,12 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
> 
>         WARN_ON(host->data);
> 
> -       if (data == NULL)
> +       if (data == NULL) {
> +               if ((host->quirks & SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL) &&
> +                               (host->cmd->flags & MMC_RSP_BUSY))
> +                       sdhci_writel(host, 0xE, SDHCI_TIMEOUT_CONTROL);
>                 return;
> +       }
> 
>         /* Sanity checks */
>         BUG_ON(data->blksz * data->blocks > 524288);
> diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
> index 1fdc673..315ff49 100644
> --- a/include/linux/mmc/sdhci.h
> +++ b/include/linux/mmc/sdhci.h
> @@ -83,7 +83,8 @@ struct sdhci_host {
>  #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12             (1<<28)
>  /* Controller doesn't have HISPD bit field in HI-SPEED SD card */
>  #define SDHCI_QUIRK_NO_HISPD_BIT                       (1<<29)
> -
> +/* Controller need set data timeout value when card is busy */
> +#define SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL               (1<<30)
>         int irq;                /* Device IRQ */
>         void __iomem *ioaddr;   /* Mapped address */
> 
> --
> 1.6.0.4
> 
> Thanks
> Jaehoon Chung
> 
> --
> 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
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-11-30  6:13 [RFC Patch] SDHCI: add quirk for data timeout value when card busy Jaehoon Chung
  2010-11-30  6:42 ` Philip Rakity
@ 2010-11-30  9:56 ` Wolfram Sang
  2010-11-30 10:13   ` Jaehoon Chung
  1 sibling, 1 reply; 15+ messages in thread
From: Wolfram Sang @ 2010-11-30  9:56 UTC (permalink / raw)
  To: Jaehoon Chung; +Cc: linux-mmc, Chris Ball, kyungmin Park, Andrew Morton, matt

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

Hi,

On Tue, Nov 30, 2010 at 03:13:48PM +0900, Jaehoon Chung wrote:
> This patch is added quirks for data timeout value.
> 
> Some card have problem when suspend/resume.
> CMD6(switch command) to switch the bus to high speed mode 
> and to set the bus width.
> 
> After resuming, the card was initialized...in that time, some
> card need set a correct timeout value.
> so we add SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL.

If this is a flaw of the _card_, why do we need a controller quirk here?
Shouldn't this happen for all sdhci-controllers?

Kind regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-11-30  9:56 ` Wolfram Sang
@ 2010-11-30 10:13   ` Jaehoon Chung
  2010-11-30 10:54     ` Wolfram Sang
  0 siblings, 1 reply; 15+ messages in thread
From: Jaehoon Chung @ 2010-11-30 10:13 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Jaehoon Chung, linux-mmc, Chris Ball, kyungmin Park,
	Andrew Morton, matt

Hi Wolfram.

Maybe, happen for all sdhci-controllers...

Card is configurable with eMMC spec..But sdhci-controller didn't support that card.
So SDHCI controller need to use quriks..

Thanks,
Jaehoon Chung

Wolfram Sang wrote:
> Hi,
> 
> On Tue, Nov 30, 2010 at 03:13:48PM +0900, Jaehoon Chung wrote:
>> This patch is added quirks for data timeout value.
>>
>> Some card have problem when suspend/resume.
>> CMD6(switch command) to switch the bus to high speed mode 
>> and to set the bus width.
>>
>> After resuming, the card was initialized...in that time, some
>> card need set a correct timeout value.
>> so we add SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL.
> 
> If this is a flaw of the _card_, why do we need a controller quirk here?
> Shouldn't this happen for all sdhci-controllers?
> 
> Kind regards,
> 
>    Wolfram
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-11-30 10:13   ` Jaehoon Chung
@ 2010-11-30 10:54     ` Wolfram Sang
  2010-11-30 11:37       ` Jaehoon Chung
  0 siblings, 1 reply; 15+ messages in thread
From: Wolfram Sang @ 2010-11-30 10:54 UTC (permalink / raw)
  To: Jaehoon Chung; +Cc: linux-mmc, Chris Ball, kyungmin Park, Andrew Morton, matt

[-- Attachment #1: Type: text/plain, Size: 536 bytes --]


> Maybe, happen for all sdhci-controllers...

My point is: If it is needed for all SDHCI-controllers, we don't need a
quirk and can apply your code unconditionally.

> Card is configurable with eMMC spec..But sdhci-controller didn't
> support that card. So SDHCI controller need to use quriks..

Can we find out if this is a general issue?

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-11-30 10:54     ` Wolfram Sang
@ 2010-11-30 11:37       ` Jaehoon Chung
  2010-11-30 15:56         ` Philip Rakity
  0 siblings, 1 reply; 15+ messages in thread
From: Jaehoon Chung @ 2010-11-30 11:37 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-mmc, Chris Ball, kyungmin Park, Andrew Morton, matt

>> Maybe, happen for all sdhci-controllers...
> 
> My point is: If it is needed for all SDHCI-controllers, we don't need a
> quirk and can apply your code unconditionally.
> 

You're right. But i'm not sure, happen for all sdhci-controller. 
so i send to RFC patch..
I also hope apply my code unconditionally.

the reason using quirk...every card didn't happen this issue..
if not happen this issue, we need not set timeout value..at that time..

when needs, entered and set timeout value..(conditionally)


>> Card is configurable with eMMC spec..But sdhci-controller didn't
>> support that card. So SDHCI controller need to use quriks..
> 
> Can we find out if this is a general issue?
> 

Hmm..i'm sure you can find out this issue..
Have ever find out this issue(similar case)..anybody?

> Regards,
> 
>    Wolfram
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-11-30 11:37       ` Jaehoon Chung
@ 2010-11-30 15:56         ` Philip Rakity
  2010-12-01  5:44           ` Jaehoon Chung
  0 siblings, 1 reply; 15+ messages in thread
From: Philip Rakity @ 2010-11-30 15:56 UTC (permalink / raw)
  To: Jaehoon Chung, Wolfram Sang
  Cc: linux-mmc@vger.kernel.org, Chris Ball, kyungmin Park,
	Andrew Morton, matt@console-pimps.org


Can we just remove the quirk for broken timeout and just set the timeout to 0xe in sdhci.c?

The problem with the quirk is you need to know when to set it and the problem with the existing quirk is that one has to set it to work with bad cards.
________________________________________
From: linux-mmc-owner@vger.kernel.org [linux-mmc-owner@vger.kernel.org] On Behalf Of Jaehoon Chung [jh80.chung@samsung.com]
Sent: Tuesday, November 30, 2010 3:37 AM
To: Wolfram Sang
Cc: linux-mmc@vger.kernel.org; Chris Ball; kyungmin Park; Andrew Morton; matt@console-pimps.org
Subject: Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.

>> Maybe, happen for all sdhci-controllers...
>
> My point is: If it is needed for all SDHCI-controllers, we don't need a
> quirk and can apply your code unconditionally.
>

You're right. But i'm not sure, happen for all sdhci-controller.
so i send to RFC patch..
I also hope apply my code unconditionally.

the reason using quirk...every card didn't happen this issue..
if not happen this issue, we need not set timeout value..at that time..

when needs, entered and set timeout value..(conditionally)


>> Card is configurable with eMMC spec..But sdhci-controller didn't
>> support that card. So SDHCI controller need to use quriks..
>
> Can we find out if this is a general issue?
>

Hmm..i'm sure you can find out this issue..
Have ever find out this issue(similar case)..anybody?

> Regards,
>
>    Wolfram
>

--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-11-30 15:56         ` Philip Rakity
@ 2010-12-01  5:44           ` Jaehoon Chung
  2010-12-01  5:51             ` Philip Rakity
  0 siblings, 1 reply; 15+ messages in thread
From: Jaehoon Chung @ 2010-12-01  5:44 UTC (permalink / raw)
  To: Philip Rakity
  Cc: Wolfram Sang, linux-mmc@vger.kernel.org, Chris Ball,
	kyungmin Park, Andrew Morton, matt@console-pimps.org

Philip Rakity wrote:
> Can we just remove the quirk for broken timeout and just set the timeout to 0xe in sdhci.c?

you means that set the timeout to 0xe without broken timeout in sdhci.c?

> 
> The problem with the quirk is you need to know when to set it and the problem with the existing quirk is that one has to set it to work with bad cards.

I know when use quirk...and what use one...

> ________________________________________
> From: linux-mmc-owner@vger.kernel.org [linux-mmc-owner@vger.kernel.org] On Behalf Of Jaehoon Chung [jh80.chung@samsung.com]
> Sent: Tuesday, November 30, 2010 3:37 AM
> To: Wolfram Sang
> Cc: linux-mmc@vger.kernel.org; Chris Ball; kyungmin Park; Andrew Morton; matt@console-pimps.org
> Subject: Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
> 
>>> Maybe, happen for all sdhci-controllers...
>> My point is: If it is needed for all SDHCI-controllers, we don't need a
>> quirk and can apply your code unconditionally.
>>
> 
> You're right. But i'm not sure, happen for all sdhci-controller.
> so i send to RFC patch..
> I also hope apply my code unconditionally.
> 
> the reason using quirk...every card didn't happen this issue..
> if not happen this issue, we need not set timeout value..at that time..
> 
> when needs, entered and set timeout value..(conditionally)
> 
> 
>>> Card is configurable with eMMC spec..But sdhci-controller didn't
>>> support that card. So SDHCI controller need to use quriks..
>> Can we find out if this is a general issue?
>>
> 
> Hmm..i'm sure you can find out this issue..
> Have ever find out this issue(similar case)..anybody?
> 
>> Regards,
>>
>>    Wolfram
>>
> 
> --
> 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
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-12-01  5:44           ` Jaehoon Chung
@ 2010-12-01  5:51             ` Philip Rakity
  2010-12-01 12:29               ` Jaehoon Chung
  0 siblings, 1 reply; 15+ messages in thread
From: Philip Rakity @ 2010-12-01  5:51 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: Wolfram Sang, linux-mmc@vger.kernel.org, Chris Ball,
	kyungmin Park, Andrew Morton, matt@console-pimps.org


On Nov 30, 2010, at 9:44 PM, Jaehoon Chung wrote:

> Philip Rakity wrote:
>> Can we just remove the quirk for broken timeout and just set the timeout to 0xe in sdhci.c?
> 
> you means that set the timeout to 0xe without broken timeout in sdhci.c?

yes

but I also think we should remove the quirk and change sdhci.c to use 0xe ALL THE TIME.  
I do not see a downside to doing this other than a longer timeout period.  Considering the broken cards
that are out there in practice one needs to set it to this value anyway for cards to work.

> 
>> 
>> The problem with the quirk is you need to know when to set it and the problem with the existing quirk is that one has to set it to work with bad cards.
> 
> I know when use quirk...and what use one...
> 
>> ________________________________________
>> From: linux-mmc-owner@vger.kernel.org [linux-mmc-owner@vger.kernel.org] On Behalf Of Jaehoon Chung [jh80.chung@samsung.com]
>> Sent: Tuesday, November 30, 2010 3:37 AM
>> To: Wolfram Sang
>> Cc: linux-mmc@vger.kernel.org; Chris Ball; kyungmin Park; Andrew Morton; matt@console-pimps.org
>> Subject: Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
>> 
>>>> Maybe, happen for all sdhci-controllers...
>>> My point is: If it is needed for all SDHCI-controllers, we don't need a
>>> quirk and can apply your code unconditionally.
>>> 
>> 
>> You're right. But i'm not sure, happen for all sdhci-controller.
>> so i send to RFC patch..
>> I also hope apply my code unconditionally.
>> 
>> the reason using quirk...every card didn't happen this issue..
>> if not happen this issue, we need not set timeout value..at that time..
>> 
>> when needs, entered and set timeout value..(conditionally)
>> 
>> 
>>>> Card is configurable with eMMC spec..But sdhci-controller didn't
>>>> support that card. So SDHCI controller need to use quriks..
>>> Can we find out if this is a general issue?
>>> 
>> 
>> Hmm..i'm sure you can find out this issue..
>> Have ever find out this issue(similar case)..anybody?
>> 
>>> Regards,
>>> 
>>>   Wolfram
>>> 
>> 
>> --
>> 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
>> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-12-01  5:51             ` Philip Rakity
@ 2010-12-01 12:29               ` Jaehoon Chung
  2010-12-01 16:21                 ` Philip Rakity
  0 siblings, 1 reply; 15+ messages in thread
From: Jaehoon Chung @ 2010-12-01 12:29 UTC (permalink / raw)
  To: Philip Rakity
  Cc: Wolfram Sang, linux-mmc@vger.kernel.org, Chris Ball,
	kyungmin Park, Andrew Morton, matt@console-pimps.org

Philip Rakity wrote:
> On Nov 30, 2010, at 9:44 PM, Jaehoon Chung wrote:
> 
>> Philip Rakity wrote:
>>> Can we just remove the quirk for broken timeout and just set the timeout to 0xe in sdhci.c?
>> you means that set the timeout to 0xe without broken timeout in sdhci.c?
> 
> yes
> 
> but I also think we should remove the quirk and change sdhci.c to use 0xe ALL THE TIME.  
> I do not see a downside to doing this other than a longer timeout period.  Considering the broken cards
> that are out there in practice one needs to set it to this value anyway for cards to work.
> 

If we set the fixed timeout value to 0xe, we should remove the broken timeout value. right.
But in my patch, nevertheless i used the broken timeout value quirk, need to reset timeout value at that time.
Because if didn't set timeout value, broken card fire busy state..so happen the data timeout error.

Anyway, your opinion seem good..
Thanks

>>> The problem with the quirk is you need to know when to set it and the problem with the existing quirk is that one has to set it to work with bad cards.
>> I know when use quirk...and what use one...
>>
>>> ________________________________________
>>> From: linux-mmc-owner@vger.kernel.org [linux-mmc-owner@vger.kernel.org] On Behalf Of Jaehoon Chung [jh80.chung@samsung.com]
>>> Sent: Tuesday, November 30, 2010 3:37 AM
>>> To: Wolfram Sang
>>> Cc: linux-mmc@vger.kernel.org; Chris Ball; kyungmin Park; Andrew Morton; matt@console-pimps.org
>>> Subject: Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
>>>
>>>>> Maybe, happen for all sdhci-controllers...
>>>> My point is: If it is needed for all SDHCI-controllers, we don't need a
>>>> quirk and can apply your code unconditionally.
>>>>
>>> You're right. But i'm not sure, happen for all sdhci-controller.
>>> so i send to RFC patch..
>>> I also hope apply my code unconditionally.
>>>
>>> the reason using quirk...every card didn't happen this issue..
>>> if not happen this issue, we need not set timeout value..at that time..
>>>
>>> when needs, entered and set timeout value..(conditionally)
>>>
>>>
>>>>> Card is configurable with eMMC spec..But sdhci-controller didn't
>>>>> support that card. So SDHCI controller need to use quriks..
>>>> Can we find out if this is a general issue?
>>>>
>>> Hmm..i'm sure you can find out this issue..
>>> Have ever find out this issue(similar case)..anybody?
>>>
>>>> Regards,
>>>>
>>>>   Wolfram
>>>>
>>> --
>>> 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
>>>
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-12-01 12:29               ` Jaehoon Chung
@ 2010-12-01 16:21                 ` Philip Rakity
  2010-12-02  7:40                   ` Jaehoon Chung
  0 siblings, 1 reply; 15+ messages in thread
From: Philip Rakity @ 2010-12-01 16:21 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: Wolfram Sang, linux-mmc@vger.kernel.org, Chris Ball,
	kyungmin Park, Andrew Morton, matt@console-pimps.org


On Dec 1, 2010, at 4:29 AM, Jaehoon Chung wrote:

> Philip Rakity wrote:
>> On Nov 30, 2010, at 9:44 PM, Jaehoon Chung wrote:
>> 
>>> Philip Rakity wrote:
>>>> Can we just remove the quirk for broken timeout and just set the timeout to 0xe in sdhci.c?
>>> you means that set the timeout to 0xe without broken timeout in sdhci.c?
>> 
>> yes
>> 
>> but I also think we should remove the quirk and change sdhci.c to use 0xe ALL THE TIME.  
>> I do not see a downside to doing this other than a longer timeout period.  Considering the broken cards
>> that are out there in practice one needs to set it to this value anyway for cards to work.
>> 
> 
> If we set the fixed timeout value to 0xe, we should remove the broken timeout value. right.
> But in my patch, nevertheless i used the broken timeout value quirk, need to reset timeout value at that time.
> Because if didn't set timeout value, broken card fire busy state..so happen the data timeout error.
> 
> Anyway, your opinion seem good..


The timeout value in the host controller should not change once it is set.  It s not supposed to 
change value on reset (for example).

Curious -- if you read the value when you are in the busy state before you set it -- what value is there.
BTW-- are you using sdhci.c as the SD Controller ?

> Thanks
> 
>>>> The problem with the quirk is you need to know when to set it and the problem with the existing quirk is that one has to set it to work with bad cards.
>>> I know when use quirk...and what use one...
>>> 
>>>> ________________________________________
>>>> From: linux-mmc-owner@vger.kernel.org [linux-mmc-owner@vger.kernel.org] On Behalf Of Jaehoon Chung [jh80.chung@samsung.com]
>>>> Sent: Tuesday, November 30, 2010 3:37 AM
>>>> To: Wolfram Sang
>>>> Cc: linux-mmc@vger.kernel.org; Chris Ball; kyungmin Park; Andrew Morton; matt@console-pimps.org
>>>> Subject: Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
>>>> 
>>>>>> Maybe, happen for all sdhci-controllers...
>>>>> My point is: If it is needed for all SDHCI-controllers, we don't need a
>>>>> quirk and can apply your code unconditionally.
>>>>> 
>>>> You're right. But i'm not sure, happen for all sdhci-controller.
>>>> so i send to RFC patch..
>>>> I also hope apply my code unconditionally.
>>>> 
>>>> the reason using quirk...every card didn't happen this issue..
>>>> if not happen this issue, we need not set timeout value..at that time..
>>>> 
>>>> when needs, entered and set timeout value..(conditionally)
>>>> 
>>>> 
>>>>>> Card is configurable with eMMC spec..But sdhci-controller didn't
>>>>>> support that card. So SDHCI controller need to use quriks..
>>>>> Can we find out if this is a general issue?
>>>>> 
>>>> Hmm..i'm sure you can find out this issue..
>>>> Have ever find out this issue(similar case)..anybody?
>>>> 
>>>>> Regards,
>>>>> 
>>>>>  Wolfram
>>>>> 
>>>> --
>>>> 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
>>>> 
>> 
>> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-12-01 16:21                 ` Philip Rakity
@ 2010-12-02  7:40                   ` Jaehoon Chung
  2010-12-02  9:09                     ` Wolfram Sang
  2010-12-02 16:00                     ` Philip Rakity
  0 siblings, 2 replies; 15+ messages in thread
From: Jaehoon Chung @ 2010-12-02  7:40 UTC (permalink / raw)
  To: Philip Rakity
  Cc: Wolfram Sang, linux-mmc@vger.kernel.org, Chris Ball,
	kyungmin Park, Andrew Morton, matt@console-pimps.org

Philip Rakity wrote:
> On Dec 1, 2010, at 4:29 AM, Jaehoon Chung wrote:
> 
>> Philip Rakity wrote:
>>> On Nov 30, 2010, at 9:44 PM, Jaehoon Chung wrote:
>>>
>>>> Philip Rakity wrote:
>>>>> Can we just remove the quirk for broken timeout and just set the timeout to 0xe in sdhci.c?
>>>> you means that set the timeout to 0xe without broken timeout in sdhci.c?
>>> yes
>>>
>>> but I also think we should remove the quirk and change sdhci.c to use 0xe ALL THE TIME.  
>>> I do not see a downside to doing this other than a longer timeout period.  Considering the broken cards
>>> that are out there in practice one needs to set it to this value anyway for cards to work.
>>>
>> If we set the fixed timeout value to 0xe, we should remove the broken timeout value. right.
>> But in my patch, nevertheless i used the broken timeout value quirk, need to reset timeout value at that time.
>> Because if didn't set timeout value, broken card fire busy state..so happen the data timeout error.
>>
>> Anyway, your opinion seem good..
> 
> 
> The timeout value in the host controller should not change once it is set.  It s not supposed to 
> change value on reset (for example).
> 
> Curious -- if you read the value when you are in the busy state before you set it -- what value is there.

I checked the timeout value to 0xa (i didn't use broken timeout value. if i used that quirk, set to 0xe)
When suspend/resume..timeout value set to 0x0...so i set them...

> BTW-- are you using sdhci.c as the SD Controller ?

Yes .I'm using sdhci.c as SD Controller..

> 
>> Thanks
>>
>>>>> The problem with the quirk is you need to know when to set it and the problem with the existing quirk is that one has to set it to work with bad cards.
>>>> I know when use quirk...and what use one...
>>>>
>>>>> ________________________________________
>>>>> From: linux-mmc-owner@vger.kernel.org [linux-mmc-owner@vger.kernel.org] On Behalf Of Jaehoon Chung [jh80.chung@samsung.com]
>>>>> Sent: Tuesday, November 30, 2010 3:37 AM
>>>>> To: Wolfram Sang
>>>>> Cc: linux-mmc@vger.kernel.org; Chris Ball; kyungmin Park; Andrew Morton; matt@console-pimps.org
>>>>> Subject: Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
>>>>>
>>>>>>> Maybe, happen for all sdhci-controllers...
>>>>>> My point is: If it is needed for all SDHCI-controllers, we don't need a
>>>>>> quirk and can apply your code unconditionally.
>>>>>>
>>>>> You're right. But i'm not sure, happen for all sdhci-controller.
>>>>> so i send to RFC patch..
>>>>> I also hope apply my code unconditionally.
>>>>>
>>>>> the reason using quirk...every card didn't happen this issue..
>>>>> if not happen this issue, we need not set timeout value..at that time..
>>>>>
>>>>> when needs, entered and set timeout value..(conditionally)
>>>>>
>>>>>
>>>>>>> Card is configurable with eMMC spec..But sdhci-controller didn't
>>>>>>> support that card. So SDHCI controller need to use quriks..
>>>>>> Can we find out if this is a general issue?
>>>>>>
>>>>> Hmm..i'm sure you can find out this issue..
>>>>> Have ever find out this issue(similar case)..anybody?
>>>>>
>>>>>> Regards,
>>>>>>
>>>>>>  Wolfram
>>>>>>
>>>>> --
>>>>> 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
>>>>>
>>>
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-12-02  7:40                   ` Jaehoon Chung
@ 2010-12-02  9:09                     ` Wolfram Sang
  2010-12-02 16:00                     ` Philip Rakity
  1 sibling, 0 replies; 15+ messages in thread
From: Wolfram Sang @ 2010-12-02  9:09 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: Philip Rakity, linux-mmc@vger.kernel.org, Chris Ball,
	kyungmin Park, Andrew Morton, matt@console-pimps.org

[-- Attachment #1: Type: text/plain, Size: 724 bytes --]

> > The timeout value in the host controller should not change once it is set.  It s not supposed to 
> > change value on reset (for example).
> > 
> > Curious -- if you read the value when you are in the busy state before you set it -- what value is there.
> 
> I checked the timeout value to 0xa (i didn't use broken timeout value. if i used that quirk, set to 0xe)
> When suspend/resume..timeout value set to 0x0...so i set them...

What I don't see at the moment is why this issue happens after resume but
not after initial boot. Do you have an idea?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
  2010-12-02  7:40                   ` Jaehoon Chung
  2010-12-02  9:09                     ` Wolfram Sang
@ 2010-12-02 16:00                     ` Philip Rakity
  1 sibling, 0 replies; 15+ messages in thread
From: Philip Rakity @ 2010-12-02 16:00 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: Wolfram Sang, linux-mmc@vger.kernel.org, Chris Ball,
	kyungmin Park, Andrew Morton, matt@console-pimps.org



On Dec 1, 2010, at 11:40 PM, Jaehoon Chung wrote:

> Philip Rakity wrote:
>> On Dec 1, 2010, at 4:29 AM, Jaehoon Chung wrote:
>> 
>>> Philip Rakity wrote:
>>>> On Nov 30, 2010, at 9:44 PM, Jaehoon Chung wrote:
>>>> 
>>>>> Philip Rakity wrote:
>>>>>> Can we just remove the quirk for broken timeout and just set the timeout to 0xe in sdhci.c?
>>>>> you means that set the timeout to 0xe without broken timeout in sdhci.c?
>>>> yes
>>>> 
>>>> but I also think we should remove the quirk and change sdhci.c to use 0xe ALL THE TIME.  
>>>> I do not see a downside to doing this other than a longer timeout period.  Considering the broken cards
>>>> that are out there in practice one needs to set it to this value anyway for cards to work.
>>>> 
>>> If we set the fixed timeout value to 0xe, we should remove the broken timeout value. right.
>>> But in my patch, nevertheless i used the broken timeout value quirk, need to reset timeout value at that time.
>>> Because if didn't set timeout value, broken card fire busy state..so happen the data timeout error.
>>> 
>>> Anyway, your opinion seem good..
>> 
>> 
>> The timeout value in the host controller should not change once it is set.  It s not supposed to 
>> change value on reset (for example).
>> 
>> Curious -- if you read the value when you are in the busy state before you set it -- what value is there.
> 
> I checked the timeout value to 0xa (i didn't use broken timeout value. if i used that quirk, set to 0xe)
> When suspend/resume..timeout value set to 0x0...so i set them...

Somewhere in the code the value is being reset or when the hardware does a reset it is being cleared.
Add code to the sdhci reset logic to check if it happens there.  if so --> then controller issue.

If you have a test I can run.  I can try to reproduce the problem on my controller and if so then it is in
the standard code and just need to find it.

> 
>> BTW-- are you using sdhci.c as the SD Controller ?
> 
> Yes .I'm using sdhci.c as SD Controller..
> 
>> 
>>> Thanks
>>> 
>>>>>> The problem with the quirk is you need to know when to set it and the problem with the existing quirk is that one has to set it to work with bad cards.
>>>>> I know when use quirk...and what use one...
>>>>> 
>>>>>> ________________________________________
>>>>>> From: linux-mmc-owner@vger.kernel.org [linux-mmc-owner@vger.kernel.org] On Behalf Of Jaehoon Chung [jh80.chung@samsung.com]
>>>>>> Sent: Tuesday, November 30, 2010 3:37 AM
>>>>>> To: Wolfram Sang
>>>>>> Cc: linux-mmc@vger.kernel.org; Chris Ball; kyungmin Park; Andrew Morton; matt@console-pimps.org
>>>>>> Subject: Re: [RFC Patch] SDHCI: add quirk for data timeout value when card busy.
>>>>>> 
>>>>>>>> Maybe, happen for all sdhci-controllers...
>>>>>>> My point is: If it is needed for all SDHCI-controllers, we don't need a
>>>>>>> quirk and can apply your code unconditionally.
>>>>>>> 
>>>>>> You're right. But i'm not sure, happen for all sdhci-controller.
>>>>>> so i send to RFC patch..
>>>>>> I also hope apply my code unconditionally.
>>>>>> 
>>>>>> the reason using quirk...every card didn't happen this issue..
>>>>>> if not happen this issue, we need not set timeout value..at that time..
>>>>>> 
>>>>>> when needs, entered and set timeout value..(conditionally)
>>>>>> 
>>>>>> 
>>>>>>>> Card is configurable with eMMC spec..But sdhci-controller didn't
>>>>>>>> support that card. So SDHCI controller need to use quriks..
>>>>>>> Can we find out if this is a general issue?
>>>>>>> 
>>>>>> Hmm..i'm sure you can find out this issue..
>>>>>> Have ever find out this issue(similar case)..anybody?
>>>>>> 
>>>>>>> Regards,
>>>>>>> 
>>>>>>> Wolfram
>>>>>>> 
>>>>>> --
>>>>>> 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
>>>>>> 
>>>> 
>> 
>> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-12-02 16:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-30  6:13 [RFC Patch] SDHCI: add quirk for data timeout value when card busy Jaehoon Chung
2010-11-30  6:42 ` Philip Rakity
2010-11-30  7:15   ` Jaehoon Chung
2010-11-30  9:56 ` Wolfram Sang
2010-11-30 10:13   ` Jaehoon Chung
2010-11-30 10:54     ` Wolfram Sang
2010-11-30 11:37       ` Jaehoon Chung
2010-11-30 15:56         ` Philip Rakity
2010-12-01  5:44           ` Jaehoon Chung
2010-12-01  5:51             ` Philip Rakity
2010-12-01 12:29               ` Jaehoon Chung
2010-12-01 16:21                 ` Philip Rakity
2010-12-02  7:40                   ` Jaehoon Chung
2010-12-02  9:09                     ` Wolfram Sang
2010-12-02 16:00                     ` Philip Rakity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox