Re: Issues with ADATA SD cards on OMAP?

2011-01-13 Thread Steve Sakoman
On Wed, Jan 12, 2011 at 8:30 PM, Steve Sakoman sako...@gmail.com wrote:
 On Wed, Jan 12, 2011 at 9:48 AM, Steve Sakoman sako...@gmail.com wrote:
 On Tue, Jan 11, 2011 at 10:17 PM, Ghorai, Sukumar s-gho...@ti.com wrote:

 [Ghorai]
 We also experienced the same issue using 32GB SD card for omap3 and omap4.
 And the problem is seen is that DTO value (in SYSCTL) is not current
 in following function.

 So add the following modification and please update the status.
 And we will submit proper patch towards the same.

 static void set_data_timeout(..){
 ...
      cycle_ns = 10 / (clk_get_rate(host-fclk) / clkd);
        timeout = timeout_ns / cycle_ns;
        timeout += timeout_clks;
 + timeout *=2;
      if (timeout) {
 ...
 }

 I tried this change.  While it seemed to improve things a bit for the
 ADATA card I tested, I was still not able to boot successfully.

 I will investigate further.  Forcing a value of 14 makes the card
 work.  I'll add a printk to see what dto value is computed by your
 patch.

 The printk showed that dto was being set in the range 11-13 with your patch.

 I still was seeing some corruption occurring with the patch -- but at
 a much lower level that without the patch.

 Since I knew that the card would definitely work if dto were hard
 coded to 14, I next tried bumping the value your patch computed by 1:

 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
 index 9c7c590..09a7e21 100644
 --- a/drivers/mmc/host/omap_hsmmc.c
 +++ b/drivers/mmc/host/omap_hsmmc.c
 @@ -1372,6 +1372,7 @@ static void set_data_timeout(struct omap_hsmmc_host 
 *host,
                        dto -= 13;
                else
                        dto = 0;
 +               dto++;
                if (dto  14)
                        dto = 14;
        }

 I've been running fairly intensive testing for the past 6 hours with out 
 issue.

Just to add another data point, Transcend 16GB Class 6 cards will not
work on OMAP3 with an unpatched kernel -- lots of -110 timeout errors.

With the patches above the card does work.

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


Re: Issues with ADATA SD cards on OMAP?

2011-01-12 Thread Steve Sakoman
On Tue, Jan 11, 2011 at 10:17 PM, Ghorai, Sukumar s-gho...@ti.com wrote:

 [Ghorai]
 We also experienced the same issue using 32GB SD card for omap3 and omap4.
 And the problem is seen is that DTO value (in SYSCTL) is not current
 in following function.

 So add the following modification and please update the status.
 And we will submit proper patch towards the same.

 static void set_data_timeout(..){
 ...
      cycle_ns = 10 / (clk_get_rate(host-fclk) / clkd);
        timeout = timeout_ns / cycle_ns;
        timeout += timeout_clks;
 + timeout *=2;
      if (timeout) {
 ...
 }

I tried this change.  While it seemed to improve things a bit for the
ADATA card I tested, I was still not able to boot successfully.

I will investigate further.  Forcing a value of 14 makes the card
work.  I'll add a printk to see what dto value is computed by your
patch.

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


Re: Issues with ADATA SD cards on OMAP?

2011-01-12 Thread Steve Sakoman
On Wed, Jan 12, 2011 at 9:48 AM, Steve Sakoman sako...@gmail.com wrote:
 On Tue, Jan 11, 2011 at 10:17 PM, Ghorai, Sukumar s-gho...@ti.com wrote:

 [Ghorai]
 We also experienced the same issue using 32GB SD card for omap3 and omap4.
 And the problem is seen is that DTO value (in SYSCTL) is not current
 in following function.

 So add the following modification and please update the status.
 And we will submit proper patch towards the same.

 static void set_data_timeout(..){
 ...
      cycle_ns = 10 / (clk_get_rate(host-fclk) / clkd);
        timeout = timeout_ns / cycle_ns;
        timeout += timeout_clks;
 + timeout *=2;
      if (timeout) {
 ...
 }

 I tried this change.  While it seemed to improve things a bit for the
 ADATA card I tested, I was still not able to boot successfully.

 I will investigate further.  Forcing a value of 14 makes the card
 work.  I'll add a printk to see what dto value is computed by your
 patch.

The printk showed that dto was being set in the range 11-13 with your patch.

I still was seeing some corruption occurring with the patch -- but at
a much lower level that without the patch.

Since I knew that the card would definitely work if dto were hard
coded to 14, I next tried bumping the value your patch computed by 1:

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 9c7c590..09a7e21 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1372,6 +1372,7 @@ static void set_data_timeout(struct omap_hsmmc_host *host,
dto -= 13;
else
dto = 0;
+   dto++;
if (dto  14)
dto = 14;
}

I've been running fairly intensive testing for the past 6 hours with out issue.

This chunk of code really should be reviewed by an mmc expert -- I
have a feeling that it could be simplified or at least made a bit
easier to understand!

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


Re: Issues with ADATA SD cards on OMAP? -- dto calculation??

2011-01-11 Thread Steve Sakoman
On Sat, Jan 8, 2011 at 10:04 PM, Steve Sakoman sako...@gmail.com wrote:
 I've recently been testing memory card performance to identify the
 best performing brands/models.

 As expected, I found a huge difference in performance between brands.
 What I didn't expect to find, however, was a brand (ADATA) that
 doesn't seem to play well with the 2.6.36 kernel on OMAP3 hardware.
 I'm wondering if this failure might be exposing an issue in the OMAP
 mmc driver/hw setup.

 I tested both 4GB and 8GB versions of the ADATA Class 6 cards.  I was
 not able to boot successfully from either card on both Overo and
 Beagle hardware (both 35xx and 37xx versions were tested).

 The error was the same in all cases: x-load, u-boot, and the kernel
 were all loaded successfully from SD, but the kernel was not able to
 mount the rootfs:

On the suggestion of Steve Kipisz of TI I tried increasing the value
of dto in the set_data_timeout function of
drivers/mmc/host/omap_hsmmc.c

Hard coding dto to the max value of 14 appears to fix the timeout
errors with ADATA brand cards.

Does anyone understand the rationale behind the current dti
computation?  For reference, here is the code:

if (timeout) {
while ((timeout  0x8000) == 0) {
dto += 1;
timeout = 1;
}
dto = 31 - dto;
timeout = 1;
if (timeout  dto)
dto += 1;
if (dto = 13)
dto -= 13;
else
dto = 0;
if (dto  14)
dto = 14;
}

I am far from certain that just increasing dto (let alone by what
amount!) is the proper fix, since the timeout may be just a symptom of
a more fundamental timing/voltage issue.

I have a few more cards to test that failed 100% of the time with the
standard code, but I suspect that they are likely to work now too.

Any thoughts?

Steve


 Waiting for root device /dev/mmcblk0p2...
 mmc0: host does not support reading read-only switch. assuming write-enable.
 mmc0: new high speed SDHC card at address 0260
 mmcblk0: mmc0:0260 SD    3.75 GiB
  mmcblk0: p1 p2
 EXT3-fs: barriers not enabled
 kjournald starting.  Commit interval 5 seconds
 EXT3-fs (mmcblk0p2): using internal journal
 EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
 VFS: Mounted root (ext3 filesystem) on device 179:2.
 devtmpfs: mounted
 Freeing init memory: 168K
 INIT: version 2.86 booting
 Please wait: booting...
 Starting udev
 Remounting root file system...
 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00
 mmcblk0: error -110 transferring data, sector 3556505, nr 8, card status 0xc00
 end_request: I/O error, dev mmcblk0, sector 3556512
 Buffer I/O error on device mmcblk0p2, logical block 426490
 lost page write due to I/O error on mmcblk0p2
 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00
 mmcblk0: error -110 transferring data, sector 4076825, nr 8, card status 0xc00
 end_request: I/O error, dev mmcblk0, sector 4076832
 Buffer I/O error on device mmcblk0p2, logical block 491530
 lost page write due to I/O error on mmcblk0p2
 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00
 mmcblk0: error -110 transferring data, sector 4126233, nr 8, card status 0xc00
 end_request: I/O error, dev mmcblk0, sector 4126234
 Buffer I/O error on device mmcblk0p2, logical block 497706
 lost page write due to I/O error on mmcblk0p2

 And so on, with many more mmc errors.

 If I reset and try again, things go wrong even sooner:

 Waiting for root device /dev/mmcblk0p2...
 mmc0: host does not support reading read-only switch. assuming write-enable.
 mmc0: new high speed SDHC card at address 0260
 mmcblk0: mmc0:0260 SD    3.75 GiB
  mmcblk0: p1 p2
 EXT3-fs: barriers not enabled
 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00
 mmcblk0: error -110 transferring data, sector 147545, nr 8, card status 0xc00
 end_request: I/O error, dev mmcblk0, sector 147552
 Buffer I/O error on device mmcblk0p2, logical block 370
 lost page write due to I/O error on mmcblk0p2

 The ADATA cards seem to work with no issues on my desktop system.

 Has anyone else run into this issue?  Any theories on where to start looking?

 FWIW, there is this thread on the beagleboard list discussing issues
 with mmc writes:

 http://groups.google.com/group/beagleboard/browse_thread/thread/0083724ff7e54c58/f55578bb1c1379db#f55578bb1c1379db

 In this thread Gerald Coley speculates that the driver may be setting
 the mmc1 voltage to 3.0V rather than 3.15V.

 Regards,

 Steve

 PS: For those who might be interested in the microSD card performance tests:

 http://www.sakoman.com/OMAP/microsd-card-perfomance-test-results.html

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to 

Re: Issues with ADATA SD cards on OMAP? -- dto calculation??

2011-01-11 Thread Elvis Dowson

On Jan 12, 2011, at 9:58 AM, Steve Sakoman wrote:
 
 On the suggestion of Steve Kipisz of TI I tried increasing the value
 of dto in the set_data_timeout function of
 drivers/mmc/host/omap_hsmmc.c
 
 Hard coding dto to the max value of 14 appears to fix the timeout
 errors with ADATA brand cards.

On some products that use the Gumstix Overo, we found microSD card
failures during extended NAND read/write tests. 

Again, the fix suggested by TI was to increase the dto timeout value to 14.

The issues were more apparently with cheap microSD cards, not necessarily
the faster class 4 variety. 

Using a SanDisk class 2 works ok. I used a SanDisk class 4 for development.

The microSD card gets corrupted when running endurance tests, with failures 
occurring with the microSD card in about 3 to 4 days of doing continuous 
read-writes to the microSD card.

Elvis

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


RE: Issues with ADATA SD cards on OMAP?

2011-01-11 Thread Ghorai, Sukumar


 -Original Message-
 From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
 ow...@vger.kernel.org] On Behalf Of Steve Sakoman
 Sent: Sunday, January 09, 2011 10:45 PM
 To: Elvis Dowson
 Cc: linux-omap Mailing List
 Subject: Re: Issues with ADATA SD cards on OMAP?
 
 On Sun, Jan 9, 2011 at 9:07 AM, Elvis Dowson elvis.dow...@mac.com wrote:
  Hi Steve,
 
  On Jan 9, 2011, at 9:00 PM, Steve Sakoman wrote:
 
  mmcblk0: error -110 sending read/write command, response 0x900, card
  status 0xe00
 
  Error -110 is ETIMEOUT.
 
  The card might be getting detected but not powering up, perhaps?
 something to do with
  voltage regulator setup or probably a bad mmc hardware port?
 
 Not likely to be bad hardware since it fails the same way on multiple
 Overo and Beagle boards.
 
 And not likely to be a bad SD card, since the cards work perfectly on
 my desktop and laptop.
 
 I suspect something marginal in the mmc interface hw/config.  If you
 look at the schematics for most boards the mmc card is directly
 connected to the OMAP for signal lines, and the twl4030 for power.
 
 As such, I'm not surprised that these cards fail with every OMAP3
 board I've tried.
 
  I'm using a 2GB class 4 SanDisk microSD card with a custom beagle board,
 and tried it with
  android-2.6.32 kernel as well as mainline 2.6.37-rc7 kernel, it worked
 fine.
 
 Sure, I have tons of SanDisk cards that work perfectly (and always
 have).  It is the brand new, just out of the box Sandisk that fails.
 
[Ghorai] 
We also experienced the same issue using 32GB SD card for omap3 and omap4.
And the problem is seen is that DTO value (in SYSCTL) is not current
in following function. 

So add the following modification and please update the status.
And we will submit proper patch towards the same.

static void set_data_timeout(..){
...
  cycle_ns = 10 / (clk_get_rate(host-fclk) / clkd);
timeout = timeout_ns / cycle_ns;
timeout += timeout_clks;
+ timeout *=2;
  if (timeout) {
...
}
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Issues with ADATA SD cards on OMAP?

2011-01-09 Thread Steve Sakoman
FWIW, I am seeing this same behavior with a brand new SanDisk 4GB
Class 4 microSD card.

Steve

On Sat, Jan 8, 2011 at 10:04 PM, Steve Sakoman sako...@gmail.com wrote:
 I've recently been testing memory card performance to identify the
 best performing brands/models.

 As expected, I found a huge difference in performance between brands.
 What I didn't expect to find, however, was a brand (ADATA) that
 doesn't seem to play well with the 2.6.36 kernel on OMAP3 hardware.
 I'm wondering if this failure might be exposing an issue in the OMAP
 mmc driver/hw setup.

 I tested both 4GB and 8GB versions of the ADATA Class 6 cards.  I was
 not able to boot successfully from either card on both Overo and
 Beagle hardware (both 35xx and 37xx versions were tested).

 The error was the same in all cases: x-load, u-boot, and the kernel
 were all loaded successfully from SD, but the kernel was not able to
 mount the rootfs:

 Waiting for root device /dev/mmcblk0p2...
 mmc0: host does not support reading read-only switch. assuming write-enable.
 mmc0: new high speed SDHC card at address 0260
 mmcblk0: mmc0:0260 SD    3.75 GiB
  mmcblk0: p1 p2
 EXT3-fs: barriers not enabled
 kjournald starting.  Commit interval 5 seconds
 EXT3-fs (mmcblk0p2): using internal journal
 EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
 VFS: Mounted root (ext3 filesystem) on device 179:2.
 devtmpfs: mounted
 Freeing init memory: 168K
 INIT: version 2.86 booting
 Please wait: booting...
 Starting udev
 Remounting root file system...
 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00
 mmcblk0: error -110 transferring data, sector 3556505, nr 8, card status 0xc00
 end_request: I/O error, dev mmcblk0, sector 3556512
 Buffer I/O error on device mmcblk0p2, logical block 426490
 lost page write due to I/O error on mmcblk0p2
 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00
 mmcblk0: error -110 transferring data, sector 4076825, nr 8, card status 0xc00
 end_request: I/O error, dev mmcblk0, sector 4076832
 Buffer I/O error on device mmcblk0p2, logical block 491530
 lost page write due to I/O error on mmcblk0p2
 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00
 mmcblk0: error -110 transferring data, sector 4126233, nr 8, card status 0xc00
 end_request: I/O error, dev mmcblk0, sector 4126234
 Buffer I/O error on device mmcblk0p2, logical block 497706
 lost page write due to I/O error on mmcblk0p2

 And so on, with many more mmc errors.

 If I reset and try again, things go wrong even sooner:

 Waiting for root device /dev/mmcblk0p2...
 mmc0: host does not support reading read-only switch. assuming write-enable.
 mmc0: new high speed SDHC card at address 0260
 mmcblk0: mmc0:0260 SD    3.75 GiB
  mmcblk0: p1 p2
 EXT3-fs: barriers not enabled
 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00
 mmcblk0: error -110 transferring data, sector 147545, nr 8, card status 0xc00
 end_request: I/O error, dev mmcblk0, sector 147552
 Buffer I/O error on device mmcblk0p2, logical block 370
 lost page write due to I/O error on mmcblk0p2

 The ADATA cards seem to work with no issues on my desktop system.

 Has anyone else run into this issue?  Any theories on where to start looking?

 FWIW, there is this thread on the beagleboard list discussing issues
 with mmc writes:

 http://groups.google.com/group/beagleboard/browse_thread/thread/0083724ff7e54c58/f55578bb1c1379db#f55578bb1c1379db

 In this thread Gerald Coley speculates that the driver may be setting
 the mmc1 voltage to 3.0V rather than 3.15V.

 Regards,

 Steve

 PS: For those who might be interested in the microSD card performance tests:

 http://www.sakoman.com/OMAP/microsd-card-perfomance-test-results.html

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


Re: Issues with ADATA SD cards on OMAP?

2011-01-09 Thread Elvis Dowson
Hi Steve,

On Jan 9, 2011, at 9:00 PM, Steve Sakoman wrote:

 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00

Error -110 is ETIMEOUT. 

The card might be getting detected but not powering up, perhaps? something to 
do with
voltage regulator setup or probably a bad mmc hardware port?

I'm using a 2GB class 4 SanDisk microSD card with a custom beagle board, and 
tried it with
android-2.6.32 kernel as well as mainline 2.6.37-rc7 kernel, it worked fine.

Elvis Dowson

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


Re: Issues with ADATA SD cards on OMAP?

2011-01-09 Thread Steve Sakoman
On Sun, Jan 9, 2011 at 9:07 AM, Elvis Dowson elvis.dow...@mac.com wrote:
 Hi Steve,

 On Jan 9, 2011, at 9:00 PM, Steve Sakoman wrote:

 mmcblk0: error -110 sending read/write command, response 0x900, card
 status 0xe00

 Error -110 is ETIMEOUT.

 The card might be getting detected but not powering up, perhaps? something to 
 do with
 voltage regulator setup or probably a bad mmc hardware port?

Not likely to be bad hardware since it fails the same way on multiple
Overo and Beagle boards.

And not likely to be a bad SD card, since the cards work perfectly on
my desktop and laptop.

I suspect something marginal in the mmc interface hw/config.  If you
look at the schematics for most boards the mmc card is directly
connected to the OMAP for signal lines, and the twl4030 for power.

As such, I'm not surprised that these cards fail with every OMAP3
board I've tried.

 I'm using a 2GB class 4 SanDisk microSD card with a custom beagle board, and 
 tried it with
 android-2.6.32 kernel as well as mainline 2.6.37-rc7 kernel, it worked fine.

Sure, I have tons of SanDisk cards that work perfectly (and always
have).  It is the brand new, just out of the box Sandisk that fails.

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