Re: [PATCH] SD/MMC: fix the issue of SDHC performance regression

2011-11-13 Thread Chris Ball
Hi,

On Sun, Nov 13 2011, Subhash Jadavani wrote:
 Using SD_MODE_UHS_SDR25 macro name is not appropriate here. It's really not
 the SDR25 mode (although clock rate is 50mhz), it's High speed mode only.
 Qiang Liu patch had defined new marco SD_MODE_HIGH_SPEED which looks
 most appropriate to use here.

See the version in current mmc-next, it already uses Qiang Liu's macros.

Thanks,

- Chris.
-- 
Chris Ball   c...@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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] SD/MMC: fix the issue of SDHC performance regression

2011-11-13 Thread Subhash Jadavani


 -Original Message-
 From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
 ow...@vger.kernel.org] On Behalf Of Chris Ball
 Sent: Sunday, November 13, 2011 10:15 PM
 To: Subhash Jadavani
 Cc: 'Aaron Lu'; 'Qiang Liu'; linux-mmc@vger.kernel.org;
 le...@freescale.com; kumar.g...@freescale.com
 Subject: Re: [PATCH] SD/MMC: fix the issue of SDHC performance
 regression
 
 Hi,
 
 On Sun, Nov 13 2011, Subhash Jadavani wrote:
  Using SD_MODE_UHS_SDR25 macro name is not appropriate here. It's
 really not
  the SDR25 mode (although clock rate is 50mhz), it's High speed mode
 only.
  Qiang Liu patch had defined new marco SD_MODE_HIGH_SPEED which
 looks
  most appropriate to use here.
 
 See the version in current mmc-next, it already uses Qiang Liu's
 macros.

Yes, Just checked now. 

Thanks,
Subhash

 
 Thanks,
 
 - Chris.
 --
 Chris Ball   c...@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 majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe linux-mmc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] SD/MMC: fix the issue of SDHC performance regression

2011-11-08 Thread Aaron Lu
On Mon, Nov 07, 2011 at 08:20:10AM -0500, Chris Ball wrote:
 Have you seen:
 
 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f2815f68dabbb373fd1c9f0fd4a609d486697c2b
  
 (mmc: sd: Handle SD3.0 cards not supporting UHS-I bus speed mode)
 
 which is already in mainline?  I think your patch is identical.
Hi Chris,

I think the existing code is somewhat confusing, since SDR50 means
100MHZ frequency while high speed is 50MHZ.
The reason it is correct is UHS_SDR50_BUS_SPEED is defined as 2,
which happened to be the same value as (1  UHS_SDR25_BUS_SPEED).

How about change it like this:

diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index a230e7f..670fd7f 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -306,7 +306,7 @@ static int mmc_read_switch(struct mmc_card *card)
goto out;
}
 
-   if (status[13]  UHS_SDR50_BUS_SPEED)
+   if (status[13]  SD_MODE_UHS_SDR25)
card-sw_caps.hs_max_dtr = 5000;
 
if (card-scr.sda_spec3) {

SDR25 is also 50MHZ, the same frequency as high speed.
Or we can add a new macro for high speed like qiang has done,
which one you prefer?

Thanks,
Aaron

--
To unsubscribe from this list: send the line unsubscribe linux-mmc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] SD/MMC: fix the issue of SDHC performance regression

2011-11-08 Thread Chris Ball
Hi,

On Tue, Nov 08 2011, Aaron Lu wrote:
 SDR25 is also 50MHZ, the same frequency as high speed.
 Or we can add a new macro for high speed like qiang has done,
 which one you prefer?

The new macro makes most sense to me -- if no-one disagrees, I'll
convert Liu's patch into a rename patch and queue it as a cleanup
for 3.2.  Thanks!

- Chris.
-- 
Chris Ball   c...@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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] SD/MMC: fix the issue of SDHC performance regression

2011-11-07 Thread Li Yang-R58472


-Original Message-
From: Liu Qiang-B32616
Sent: Monday, November 07, 2011 5:36 PM
To: linux-mmc@vger.kernel.org
Cc: c...@laptop.org; Li Yang-R58472; Gala Kumar-B11780; Liu Qiang-B32616
Subject: [PATCH] SD/MMC: fix the issue of SDHC performance regression

Low performance of SDHC (half of before) due to its frequency was set to
25MHz,
but not 50MHz (involved by commit id
013909c4ffd16ded4895528b856fd8782df04dc6,
add support for query function modes for uhs cards according to Physical
Layer
SPEC V3.01).

Set high speed max frequency according to response status of CMD6, but
not for SPEC Version. Response of switch command is first consideration
factor when set SDHC max working frequency. TRAN_SPEED in CSD register
will be seemed as the second factor.

I'm curious why many SD cards are not setting the clock frequency correctly in 
the CSD register.  Anyone has a clue?

- Leo


--
To unsubscribe from this list: send the line unsubscribe linux-mmc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] SD/MMC: fix the issue of SDHC performance regression

2011-11-07 Thread Chris Ball
Hi,

On Mon, Nov 07 2011, Qiang Liu wrote:
 Low performance of SDHC (half of before) due to its frequency was set to 
 25MHz,
 but not 50MHz (involved by commit id 013909c4ffd16ded4895528b856fd8782df04dc6,
 add support for query function modes for uhs cards according to Physical Layer
 SPEC V3.01).

 Set high speed max frequency according to response status of CMD6, but
 not for SPEC Version. Response of switch command is first consideration
 factor when set SDHC max working frequency. TRAN_SPEED in CSD register
 will be seemed as the second factor.

 Signed-off-by: Qiang Liu qiang@freescale.com

Have you seen:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f2815f68dabbb373fd1c9f0fd4a609d486697c2b
 
(mmc: sd: Handle SD3.0 cards not supporting UHS-I bus speed mode)

which is already in mainline?  I think your patch is identical.

Thanks,

- Chris.
-- 
Chris Ball   c...@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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] SD/MMC: fix the issue of SDHC performance regression

2011-11-07 Thread Liu Qiang-B32616


-Original Message-
From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-ow...@vger.kernel.org] 
On Behalf Of Chris Ball
Sent: Monday, November 07, 2011 9:20 PM
To: Liu Qiang-B32616
Cc: linux-mmc@vger.kernel.org; Li Yang-R58472; Gala Kumar-B11780
Subject: Re: [PATCH] SD/MMC: fix the issue of SDHC performance regression

Hi,

On Mon, Nov 07 2011, Qiang Liu wrote:
 Low performance of SDHC (half of before) due to its frequency was set 
 to 25MHz, but not 50MHz (involved by commit id 
 013909c4ffd16ded4895528b856fd8782df04dc6,
 add support for query function modes for uhs cards according to 
 Physical Layer SPEC V3.01).

 Set high speed max frequency according to response status of CMD6, but 
 not for SPEC Version. Response of switch command is first 
 consideration factor when set SDHC max working frequency. TRAN_SPEED 
 in CSD register will be seemed as the second factor.

 Signed-off-by: Qiang Liu qiang@freescale.com

Have you seen:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f2815f68dabbb373fd1c9f0fd4a609d486697c2b
(mmc: sd: Handle SD3.0 cards not supporting UHS-I bus speed mode)

which is already in mainline?  I think your patch is identical.
[Liu Qiang] Yes, they are identical. Thanks a lot.

Thanks,

- Chris.
-- 
Chris Ball   c...@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 majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line unsubscribe linux-mmc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html