All of lore.kernel.org
 help / color / mirror / Atom feed
* When bus width detection procedure takes place, kernel cannot lock on correct bus width
@ 2013-03-17 12:07 Chris Ball
  2013-03-22 17:06 ` Chris Ball
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Ball @ 2013-03-17 12:07 UTC (permalink / raw)
  To: elad.yi; +Cc: linux-mmc, Philip Rakity

Hi Elad, I'm forwarding your bug report to the linux-mmc@ list.

- Chris.


I've been working on a bringup of an new board in Harmonic Inc.
This board uses Sandisk iNand eMMC flash.
I've noticed that the mmc driver keeps detecting 1 bit width although HW
supports 4 bit, looked into it, and found the problem. In line 571 at mmc.c:
There is:
    /* only compare read only fields */
    err = !((card->ext_csd.raw_partition_support ==
            bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) &&
        (card->ext_csd.raw_erased_mem_count ==
            bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
        (card->ext_csd.rev ==
            bw_ext_csd[EXT_CSD_REV]) &&
        (card->ext_csd.raw_ext_csd_structure ==
                ...

The problem is that raw_partition_support is not the same when setting width of
4 bits instead of 1 bit, and shouldn't be compared at all although it is read
only.
this should be changed to:
    /* only compare read only fields */
    err = !((card->ext_csd.raw_erased_mem_count ==
            bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
        (card->ext_csd.rev ==
            bw_ext_csd[EXT_CSD_REV]) &&
        (card->ext_csd.raw_ext_csd_structure ==
                ...

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: When bus width detection procedure takes place, kernel cannot lock on correct bus width
  2013-03-17 12:07 When bus width detection procedure takes place, kernel cannot lock on correct bus width Chris Ball
@ 2013-03-22 17:06 ` Chris Ball
  2013-03-22 18:56 ` Philip Rakity
  2013-04-04 19:37 ` Chris Ball
  2 siblings, 0 replies; 5+ messages in thread
From: Chris Ball @ 2013-03-22 17:06 UTC (permalink / raw)
  To: elad.yi; +Cc: linux-mmc, Philip Rakity

Hi,

On Sun, Mar 17 2013, Chris Ball wrote:
> I've been working on a bringup of an new board in Harmonic Inc.
> This board uses Sandisk iNand eMMC flash.
> I've noticed that the mmc driver keeps detecting 1 bit width although HW
> supports 4 bit, looked into it, and found the problem. In line 571 at mmc.c:
> There is:
>     /* only compare read only fields */
>     err = !((card->ext_csd.raw_partition_support ==
>             bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) &&
>         (card->ext_csd.raw_erased_mem_count ==
>             bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
>         (card->ext_csd.rev ==
>             bw_ext_csd[EXT_CSD_REV]) &&
>         (card->ext_csd.raw_ext_csd_structure ==
>                 ...
>
> The problem is that raw_partition_support is not the same when setting width of
> 4 bits instead of 1 bit, and shouldn't be compared at all although it is read
> only.
> this should be changed to:
>     /* only compare read only fields */
>     err = !((card->ext_csd.raw_erased_mem_count ==
>             bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
>         (card->ext_csd.rev ==
>             bw_ext_csd[EXT_CSD_REV]) &&
>         (card->ext_csd.raw_ext_csd_structure ==
>                 ...

Philip, what do you think?

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: When bus width detection procedure takes place, kernel cannot lock on correct bus width
  2013-03-17 12:07 When bus width detection procedure takes place, kernel cannot lock on correct bus width Chris Ball
  2013-03-22 17:06 ` Chris Ball
@ 2013-03-22 18:56 ` Philip Rakity
  2013-03-26 15:54   ` Philip Rakity
  2013-04-04 19:37 ` Chris Ball
  2 siblings, 1 reply; 5+ messages in thread
From: Philip Rakity @ 2013-03-22 18:56 UTC (permalink / raw)
  To: Chris Ball; +Cc: elad.yi, linux-mmc


Elad,

Please supply the name of the spec which shows that this field is dependent on bit width.

I checked my sd / emmc specs and do not see this.

regards,

Philip


On Mar 17, 2013, at 5:07 AM, Chris Ball <cjb@laptop.org> wrote:

> Hi Elad, I'm forwarding your bug report to the linux-mmc@ list.
> 
> - Chris.
> 
> 
> I've been working on a bringup of an new board in Harmonic Inc.
> This board uses Sandisk iNand eMMC flash.
> I've noticed that the mmc driver keeps detecting 1 bit width although HW
> supports 4 bit, looked into it, and found the problem. In line 571 at mmc.c:
> There is:
>    /* only compare read only fields */
>    err = !((card->ext_csd.raw_partition_support ==
>            bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) &&
>        (card->ext_csd.raw_erased_mem_count ==
>            bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
>        (card->ext_csd.rev ==
>            bw_ext_csd[EXT_CSD_REV]) &&
>        (card->ext_csd.raw_ext_csd_structure ==
>                ...
> 
> The problem is that raw_partition_support is not the same when setting width of
> 4 bits instead of 1 bit, and shouldn't be compared at all although it is read
> only.
> this should be changed to:
>    /* only compare read only fields */
>    err = !((card->ext_csd.raw_erased_mem_count ==
>            bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
>        (card->ext_csd.rev ==
>            bw_ext_csd[EXT_CSD_REV]) &&
>        (card->ext_csd.raw_ext_csd_structure ==
>                ...
> 
> -- 
> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> One Laptop Per Child


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

* Re: When bus width detection procedure takes place, kernel cannot lock on correct bus width
  2013-03-22 18:56 ` Philip Rakity
@ 2013-03-26 15:54   ` Philip Rakity
  0 siblings, 0 replies; 5+ messages in thread
From: Philip Rakity @ 2013-03-26 15:54 UTC (permalink / raw)
  To: elad.yi; +Cc: linux-mmc, Chris Ball


Elad,

I would like to discuss this problem with someone at sandisk.  Could you let me know what part you are using.

Also, since you have managed to track down the problem this far perhaps you can print out the fields values in 1, 4, and 8 bit modes and let me know what is present.

regards,

Philip

On Mar 22, 2013, at 6:56 PM, Philip Rakity <prakity@nvidia.com> wrote:

> 
> Elad,
> 
> Please supply the name of the spec which shows that this field is dependent on bit width.
> 
> I checked my sd / emmc specs and do not see this.
> 
> regards,
> 
> Philip
> 
> 
> On Mar 17, 2013, at 5:07 AM, Chris Ball <cjb@laptop.org> wrote:
> 
>> Hi Elad, I'm forwarding your bug report to the linux-mmc@ list.
>> 
>> - Chris.
>> 
>> 
>> I've been working on a bringup of an new board in Harmonic Inc.
>> This board uses Sandisk iNand eMMC flash.
>> I've noticed that the mmc driver keeps detecting 1 bit width although HW
>> supports 4 bit, looked into it, and found the problem. In line 571 at mmc.c:
>> There is:
>>   /* only compare read only fields */
>>   err = !((card->ext_csd.raw_partition_support ==
>>           bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) &&
>>       (card->ext_csd.raw_erased_mem_count ==
>>           bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
>>       (card->ext_csd.rev ==
>>           bw_ext_csd[EXT_CSD_REV]) &&
>>       (card->ext_csd.raw_ext_csd_structure ==
>>               ...
>> 
>> The problem is that raw_partition_support is not the same when setting width of
>> 4 bits instead of 1 bit, and shouldn't be compared at all although it is read
>> only.
>> this should be changed to:
>>   /* only compare read only fields */
>>   err = !((card->ext_csd.raw_erased_mem_count ==
>>           bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
>>       (card->ext_csd.rev ==
>>           bw_ext_csd[EXT_CSD_REV]) &&
>>       (card->ext_csd.raw_ext_csd_structure ==
>>               ...
>> 
>> -- 
>> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
>> One Laptop Per Child
> 
> --
> 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] 5+ messages in thread

* Re: When bus width detection procedure takes place, kernel cannot lock on correct bus width
  2013-03-17 12:07 When bus width detection procedure takes place, kernel cannot lock on correct bus width Chris Ball
  2013-03-22 17:06 ` Chris Ball
  2013-03-22 18:56 ` Philip Rakity
@ 2013-04-04 19:37 ` Chris Ball
  2 siblings, 0 replies; 5+ messages in thread
From: Chris Ball @ 2013-04-04 19:37 UTC (permalink / raw)
  To: elad.yi; +Cc: linux-mmc, Philip Rakity

From: Philip Rakity <prakity@yahoo.com>
Subject: [PATCH] mmc: core: Fix bit width test failing on old eMMC cards

PARTITION_SUPPORT needs to be set before doing the compare on version
number so the bit width test does not get invalid data.  Before this
patch, a Sandisk iNAND eMMC card would detect 1-bit width although
the hardware supports 4-bit.

Only affects old emmc devices - pre 4.4 devices.

Reported-by: Elad Yi <elad.yi@gmail.com>
Signed-off-by: Philip Rakity <prakity@yahoo.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
---
 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index d584f7c..0cbd1ef 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -369,13 +369,13 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 		ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT];
 	card->ext_csd.raw_trim_mult =
 		ext_csd[EXT_CSD_TRIM_MULT];
+	card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT];
 	if (card->ext_csd.rev >= 4) {
 		/*
 		 * Enhanced area feature support -- check whether the eMMC
 		 * card has the Enhanced area enabled.  If so, export enhanced
 		 * area offset and size to user by adding sysfs interface.
 		 */
-		card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT];
 		if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) &&
 		    (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) {
 			hc_erase_grp_sz =
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

end of thread, other threads:[~2013-04-04 19:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-17 12:07 When bus width detection procedure takes place, kernel cannot lock on correct bus width Chris Ball
2013-03-22 17:06 ` Chris Ball
2013-03-22 18:56 ` Philip Rakity
2013-03-26 15:54   ` Philip Rakity
2013-04-04 19:37 ` Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.