* [PATCH] mmc: core: fix au_size according to sd spec3.0
@ 2012-02-17 10:14 hyeonsu.kim
2012-02-17 10:46 ` Jaehoon Chung
2012-02-21 10:42 ` Subhash Jadavani
0 siblings, 2 replies; 4+ messages in thread
From: hyeonsu.kim @ 2012-02-17 10:14 UTC (permalink / raw)
To: linux-mmc, cjb; +Cc: kyungmin.park, jh80.chung, Hyeonsu Kim
From: Hyeonsu Kim <hyeonsu.kim@samsung.com>
This "if phrase" is illogical.
and SD Spec 3.0 supports au_size from 0 to 0xF.
Signed-off-by: Hyeonsu Kim <hyeonsu.kim@samsung.com>
---
drivers/mmc/core/sd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index c63ad03..cf8bf0e 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -244,7 +244,7 @@ static int mmc_read_ssr(struct mmc_card *card)
* bitfield positions accordingly.
*/
au = UNSTUFF_BITS(ssr, 428 - 384, 4);
- if (au > 0 || au <= 9) {
+ if (au >= 0 && au < 16) {
card->ssr.au = 1 << (au + 4);
es = UNSTUFF_BITS(ssr, 408 - 384, 16);
et = UNSTUFF_BITS(ssr, 402 - 384, 6);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: core: fix au_size according to sd spec3.0
2012-02-17 10:14 [PATCH] mmc: core: fix au_size according to sd spec3.0 hyeonsu.kim
@ 2012-02-17 10:46 ` Jaehoon Chung
2012-02-22 10:28 ` Adrian Hunter
2012-02-21 10:42 ` Subhash Jadavani
1 sibling, 1 reply; 4+ messages in thread
From: Jaehoon Chung @ 2012-02-17 10:46 UTC (permalink / raw)
To: hyeonsu.kim; +Cc: linux-mmc, cjb, kyungmin.park, jh80.chung
Hi.
On 02/17/2012 07:14 PM, hyeonsu.kim@samsung.com wrote:
> From: Hyeonsu Kim <hyeonsu.kim@samsung.com>
>
> This "if phrase" is illogical.
> and SD Spec 3.0 supports au_size from 0 to 0xF.
>
> Signed-off-by: Hyeonsu Kim <hyeonsu.kim@samsung.com>
> ---
> drivers/mmc/core/sd.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
> index c63ad03..cf8bf0e 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -244,7 +244,7 @@ static int mmc_read_ssr(struct mmc_card *card)
> * bitfield positions accordingly.
> */
> au = UNSTUFF_BITS(ssr, 428 - 384, 4);
> - if (au > 0 || au <= 9) {
> + if (au >= 0 && au < 16) {
I think "if (au > 0 && au <= 0xf)" is more readable and
need to check the sd-spec.
Because in SD2.0, didn't define from 0xa to 0xf.
> card->ssr.au = 1 << (au + 4);
Is it right???
card->ssr.au = 1 << (au + 4) is something wrong.
If au is 1, card->ssr.au is 32KB. BUt in spec, defined 16KB.
I think the wrong bit operation. this is more problem.
If my point is right, will send the patch.
Best Regards,
Jaehoon Chung
> es = UNSTUFF_BITS(ssr, 408 - 384, 16);
> et = UNSTUFF_BITS(ssr, 402 - 384, 6);
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] mmc: core: fix au_size according to sd spec3.0
2012-02-17 10:14 [PATCH] mmc: core: fix au_size according to sd spec3.0 hyeonsu.kim
2012-02-17 10:46 ` Jaehoon Chung
@ 2012-02-21 10:42 ` Subhash Jadavani
1 sibling, 0 replies; 4+ messages in thread
From: Subhash Jadavani @ 2012-02-21 10:42 UTC (permalink / raw)
To: hyeonsu.kim, linux-mmc, cjb; +Cc: kyungmin.park, jh80.chung
> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of hyeonsu.kim@samsung.com
> Sent: Friday, February 17, 2012 3:45 PM
> To: linux-mmc@vger.kernel.org; cjb@laptop.org
> Cc: kyungmin.park@samsung.com; jh80.chung@samsung.com; Hyeonsu Kim
> Subject: [PATCH] mmc: core: fix au_size according to sd spec3.0
>
> From: Hyeonsu Kim <hyeonsu.kim@samsung.com>
>
> This "if phrase" is illogical.
> and SD Spec 3.0 supports au_size from 0 to 0xF.
>
> Signed-off-by: Hyeonsu Kim <hyeonsu.kim@samsung.com>
> ---
> drivers/mmc/core/sd.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index
> c63ad03..cf8bf0e 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -244,7 +244,7 @@ static int mmc_read_ssr(struct mmc_card *card)
> * bitfield positions accordingly.
> */
> au = UNSTUFF_BITS(ssr, 428 - 384, 4);
> - if (au > 0 || au <= 9) {
> + if (au >= 0 && au < 16) {
au = 0 is still invalid. And as "Jaehoon Chung" mentioned, we would need to
check the SD spec version here as au value from 10 to 15 is invalide for
cards till SD2.0 spec.
> card->ssr.au = 1 << (au + 4);
> es = UNSTUFF_BITS(ssr, 408 - 384, 16);
> et = UNSTUFF_BITS(ssr, 402 - 384, 6);
> --
> 1.7.5.4
>
> --
> 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] 4+ messages in thread
* Re: [PATCH] mmc: core: fix au_size according to sd spec3.0
2012-02-17 10:46 ` Jaehoon Chung
@ 2012-02-22 10:28 ` Adrian Hunter
0 siblings, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2012-02-22 10:28 UTC (permalink / raw)
To: Jaehoon Chung; +Cc: hyeonsu.kim, linux-mmc, cjb, kyungmin.park
On 17/02/12 12:46, Jaehoon Chung wrote:
> Hi.
> On 02/17/2012 07:14 PM, hyeonsu.kim@samsung.com wrote:
>
>> From: Hyeonsu Kim <hyeonsu.kim@samsung.com>
>>
>> This "if phrase" is illogical.
>> and SD Spec 3.0 supports au_size from 0 to 0xF.
>>
>> Signed-off-by: Hyeonsu Kim <hyeonsu.kim@samsung.com>
>> ---
>> drivers/mmc/core/sd.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
>> index c63ad03..cf8bf0e 100644
>> --- a/drivers/mmc/core/sd.c
>> +++ b/drivers/mmc/core/sd.c
>> @@ -244,7 +244,7 @@ static int mmc_read_ssr(struct mmc_card *card)
>> * bitfield positions accordingly.
>> */
>> au = UNSTUFF_BITS(ssr, 428 - 384, 4);
>> - if (au > 0 || au <= 9) {
>> + if (au >= 0 && au < 16) {
>
> I think "if (au > 0 && au <= 0xf)" is more readable and
> need to check the sd-spec.
> Because in SD2.0, didn't define from 0xa to 0xf.
>
>> card->ssr.au = 1 << (au + 4);
>
> Is it right???
> card->ssr.au = 1 << (au + 4) is something wrong.
> If au is 1, card->ssr.au is 32KB. BUt in spec, defined 16KB.
> I think the wrong bit operation. this is more problem.
No it is 16KiB because "au" is in sectors.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-22 10:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17 10:14 [PATCH] mmc: core: fix au_size according to sd spec3.0 hyeonsu.kim
2012-02-17 10:46 ` Jaehoon Chung
2012-02-22 10:28 ` Adrian Hunter
2012-02-21 10:42 ` Subhash Jadavani
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).