mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [BUG: barebox-git] failure at common/block.c:248/block_put()!
@ 2012-05-29  9:49 Roberto Nibali
  2012-05-29 10:14 ` Sascha Hauer
  0 siblings, 1 reply; 8+ messages in thread
From: Roberto Nibali @ 2012-05-29  9:49 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 3233 bytes --]

Hi

Barebox barfs if I try to copy a file inside a mounted MMC fat partition.

Steps to reproduce:

1.) Load barebox (configured as internal boot MMC) as a second stage boot
loader from uboot.
2.) Mount MMC fat partition
3.) Try to copy file to the same partition

This results in this nice BUG():

Board: SID1 NOAH
registered netconsole as cs1
noah_read_ccm_regs: CCM CRDR = 00000000
noah_read_ccm_regs: CCM RCSR = 01020820
noah_read_ccm_regs: Booting from WEIM: NOR
imx-esdhc@mci0: registered as mci0
mci@mci0: registered disk0
imx25_devices_init: Adding NOR flash device
cfi_flash@cfi_flash0: cfi flash (id=01000000 vend=000002 manu=000001
devid=00007E extid=002301) at a0000000, size 64MB
imx25_devices_init: Adding initial NOR flash partitions
ehci@ehci0: USB EHCI 1.00
Malloc space: 0x83b00000 -> 0x83efffff (size  4 MB)
Stack space : 0x83af8000 -> 0x83b00000 (size 32 kB)
envfs: wrong magic on /dev/env0
no valid environment found on /dev/env0. Using default environment
running /env/bin/init...

Hit any key to stop autoboot:  5

type update_kernel nor [<imagename>] to update kernel into flash
type update_root nor [<imagename>] to update rootfs into flash

sid1-noah:/ mkdir /mnt
sid1-noah:/ mount /dev/disk0.0 fat /mnt
sid1-noah:/ time cp /mnt/console_image.jffs2 /mnt/console_image.jffs2-backup
BUG: failure at common/block.c:248/block_put()!
BUG!
[<83f347b4>] (unwind_backtrace+0x0/0x8c) from [<83f1bea4>] (panic+0x28/0x3c)
[<83f1bea4>] (panic+0x28/0x3c) from [<83f058a0>] (block_put+0x48/0x8c)
[<83f058a0>] (block_put+0x48/0x8c) from [<83f0598c>]
(block_write+0xa8/0x120)
[<83f0598c>] (block_write+0xa8/0x120) from [<83f2d288>]
(cdev_write+0x30/0x34)
[<83f2d288>] (cdev_write+0x30/0x34) from [<83f30780>] (disk_write+0x24/0x30)
[<83f30780>] (disk_write+0x24/0x30) from [<83f2f8cc>] (f_write+0x160/0x27c)
[<83f2f8cc>] (f_write+0x160/0x27c) from [<83f30540>] (fat_write+0x18/0x30)
[<83f30540>] (fat_write+0x18/0x30) from [<83f31030>] (write+0xac/0xd0)
[<83f31030>] (write+0xac/0xd0) from [<83f21674>] (copy_file+0xec/0x17c)
[<83f21674>] (copy_file+0xec/0x17c) from [<83f18ff0>] (do_cp+0x124/0x158)
[<83f18ff0>] (do_cp+0x124/0x158) from [<83f07b50>]
(execute_command+0x38/0x7c)
[<83f07b50>] (execute_command+0x38/0x7c) from [<83f03b84>]
(run_list_real+0x8a0/0x998)
[<83f03b84>] (run_list_real+0x8a0/0x998) from [<83f03dc0>]
(parse_stream_outer+0x144/0x240)
[<83f03dc0>] (parse_stream_outer+0x144/0x240) from [<83f0327c>]
(parse_string_outer+0x9c/0x104)
[<83f0327c>] (parse_string_outer+0x9c/0x104) from [<83f04164>]
(run_command+0x18/0x30)
[<83f04164>] (run_command+0x18/0x30) from [<83f1aaa4>] (do_time+0x8c/0xf0)
[<83f1aaa4>] (do_time+0x8c/0xf0) from [<83f07b50>]
(execute_command+0x38/0x7c)
[<83f07b50>] (execute_command+0x38/0x7c) from [<83f03b84>]
(run_list_real+0x8a0/0x998)
[<83f03b84>] (run_list_real+0x8a0/0x998) from [<83f03dc0>]
(parse_stream_outer+0x144/0x240)
[<83f03dc0>] (parse_stream_outer+0x144/0x240) from [<83f041b8>]
(run_shell+0x3c/0x5c)
[<83f041b8>] (run_shell+0x3c/0x5c) from [<83f095e0>]
(start_barebox+0xd4/0x110)
[<83f095e0>] (start_barebox+0xd4/0x110) from [<8010206c>] (0x8010206c)

I reckon it might be something I shouldn't be doing, however I thought I
still report it here.

Cheers
Roberto

[-- Attachment #1.2: Type: text/html, Size: 4282 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG: barebox-git] failure at common/block.c:248/block_put()!
  2012-05-29  9:49 [BUG: barebox-git] failure at common/block.c:248/block_put()! Roberto Nibali
@ 2012-05-29 10:14 ` Sascha Hauer
  2012-05-29 10:25   ` Roberto Nibali
  0 siblings, 1 reply; 8+ messages in thread
From: Sascha Hauer @ 2012-05-29 10:14 UTC (permalink / raw)
  To: Roberto Nibali; +Cc: barebox

On Tue, May 29, 2012 at 11:49:24AM +0200, Roberto Nibali wrote:
> Hi
> 
> Barebox barfs if I try to copy a file inside a mounted MMC fat partition.
> 
> Steps to reproduce:
> 
> 1.) Load barebox (configured as internal boot MMC) as a second stage boot
> loader from uboot.
> 2.) Mount MMC fat partition
> 3.) Try to copy file to the same partition
> 
> This results in this nice BUG():
> 
> Board: SID1 NOAH
> registered netconsole as cs1
> noah_read_ccm_regs: CCM CRDR = 00000000
> noah_read_ccm_regs: CCM RCSR = 01020820
> noah_read_ccm_regs: Booting from WEIM: NOR
> imx-esdhc@mci0: registered as mci0
> mci@mci0: registered disk0
> imx25_devices_init: Adding NOR flash device
> cfi_flash@cfi_flash0: cfi flash (id=01000000 vend=000002 manu=000001
> devid=00007E extid=002301) at a0000000, size 64MB
> imx25_devices_init: Adding initial NOR flash partitions
> ehci@ehci0: USB EHCI 1.00
> Malloc space: 0x83b00000 -> 0x83efffff (size  4 MB)
> Stack space : 0x83af8000 -> 0x83b00000 (size 32 kB)
> envfs: wrong magic on /dev/env0
> no valid environment found on /dev/env0. Using default environment
> running /env/bin/init...
> 
> Hit any key to stop autoboot:  5
> 
> type update_kernel nor [<imagename>] to update kernel into flash
> type update_root nor [<imagename>] to update rootfs into flash
> 
> sid1-noah:/ mkdir /mnt
> sid1-noah:/ mount /dev/disk0.0 fat /mnt
> sid1-noah:/ time cp /mnt/console_image.jffs2 /mnt/console_image.jffs2-backup
> BUG: failure at common/block.c:248/block_put()!
> BUG!

to BUG here seems a bit harsh. block_put calls block_get and then BUGs
when block_get fails. Presumely block_cache fails here. Can you add a
printf int block_cache after blk->ops->read and print the error value?


I just saw that there's room for optimization. In block_put we call
block_get which reads from the device, just to overwrite the data
afterwards.


> I reckon it might be something I shouldn't be doing, however I thought I
> still report it here.

What you are trying to do should work.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG: barebox-git] failure at common/block.c:248/block_put()!
  2012-05-29 10:14 ` Sascha Hauer
@ 2012-05-29 10:25   ` Roberto Nibali
  2012-05-29 11:47     ` Roberto Nibali
  0 siblings, 1 reply; 8+ messages in thread
From: Roberto Nibali @ 2012-05-29 10:25 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 2864 bytes --]

Hi

> noah_read_ccm_regs: Booting from WEIM: NOR
> > imx-esdhc@mci0: registered as mci0
> > mci@mci0: registered disk0
> > imx25_devices_init: Adding NOR flash device
> > cfi_flash@cfi_flash0: cfi flash (id=01000000 vend=000002 manu=000001
> > devid=00007E extid=002301) at a0000000, size 64MB
>

BTW, see this beautiful NOR support when booting as a second stage boot
loader? :)


> > sid1-noah:/ mkdir /mnt
> > sid1-noah:/ mount /dev/disk0.0 fat /mnt
> > sid1-noah:/ time cp /mnt/console_image.jffs2
> /mnt/console_image.jffs2-backup
> > BUG: failure at common/block.c:248/block_put()!
> > BUG!
>
> to BUG here seems a bit harsh. block_put calls block_get and then BUGs
> when block_get fails. Presumely block_cache fails here. Can you add a
> printf int block_cache after blk->ops->read and print the error value?
>

sid1-noah:/ mount /dev/disk0.0 fat /mnt
block_cache: blk->ops->read returned 0
sid1-noah:/ cp /mnt/coblock_cache: blk->ops->read returned 0
nsole_image.jffs2 /mnt/console_image.jffs2-backup
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned -110
BUG: failure at common/block.c:249/block_put()!
BUG!
[<83f34814>] (unwind_backtrace+0x0/0x8c) from [<83f1bf04>] (panic+0x28/0x3c)
[<83f1bf04>] (panic+0x28/0x3c) from [<83f05900>] (block_put+0x48/0x8c)
[<83f05900>] (block_put+0x48/0x8c) from [<83f059ec>]
(block_write+0xa8/0x120)
[<83f059ec>] (block_write+0xa8/0x120) from [<83f2d2e8>]
(cdev_write+0x30/0x34)
[<83f2d2e8>] (cdev_write+0x30/0x34) from [<83f307e0>] (disk_write+0x24/0x30)
[<83f307e0>] (disk_write+0x24/0x30) from [<83f2f92c>] (f_write+0x160/0x27c)
[<83f2f92c>] (f_write+0x160/0x27c) from [<83f305a0>] (fat_write+0x18/0x30)
[<83f305a0>] (fat_write+0x18/0x30) from [<83f31090>] (write+0xac/0xd0)
[<83f31090>] (write+0xac/0xd0) from [<83f216d4>] (copy_file+0xec/0x17c)
[<83f216d4>] (copy_file+0xec/0x17c) from [<83f19050>] (do_cp+0x124/0x158)
[<83f19050>] (do_cp+0x124/0x158) from [<83f07bb0>]
(execute_command+0x38/0x7c)
[<83f07bb0>] (execute_command+0x38/0x7c) from [<83f03bc8>]
(run_list_real+0x8a0/0x998)
[<83f03bc8>] (run_list_real+0x8a0/0x998) from [<83f03e04>]
(parse_stream_outer+0x144/0x240)
[<83f03e04>] (parse_stream_outer+0x144/0x240) from [<83f041fc>]
(run_shell+0x3c/0x5c)
[<83f041fc>] (run_shell+0x3c/0x5c) from [<83f09640>]
(start_barebox+0xd4/0x110)
[<83f09640>] (start_barebox+0xd4/0x110) from [<8010206c>] (0x8010206c)

Those dreaded -110.


> I just saw that there's room for optimization. In block_put we call
> block_get which reads from the device, just to overwrite the data
> afterwards.


Yep, good point.

Let me know if I you need more printf()'s sprinkled over your code.

Regards
Roberto

[-- Attachment #1.2: Type: text/html, Size: 4192 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG: barebox-git] failure at common/block.c:248/block_put()!
  2012-05-29 10:25   ` Roberto Nibali
@ 2012-05-29 11:47     ` Roberto Nibali
  2012-05-29 13:33       ` Roberto Nibali
  2012-05-29 18:57       ` Sascha Hauer
  0 siblings, 2 replies; 8+ messages in thread
From: Roberto Nibali @ 2012-05-29 11:47 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 4794 bytes --]

G'day


>> sid1-noah:/ mount /dev/disk0.0 fat /mnt
> block_cache: blk->ops->read returned 0
> sid1-noah:/ cp /mnt/coblock_cache: blk->ops->read returned 0
> nsole_image.jffs2 /mnt/console_image.jffs2-backup
> block_cache: blk->ops->read returned 0
> block_cache: blk->ops->read returned 0
> block_cache: blk->ops->read returned 0
> block_cache: blk->ops->read returned 0
> block_cache: blk->ops->read returned 0
> block_cache: blk->ops->read returned 0
>  block_cache: blk->ops->read returned -110
>

Since I have seen this in the kernel as well, I suspect there is something
wrong with my eSDHC interface or we're missing some mx25 errata quirks that
are present in the kernel. So I went ahead and enabled PIO mode and also
DEBUG in drivers/mci/imx-esdhc.c, which got me this:

barebox 2012.05.0-00200-g23273ec-dirty #7 Tue May 29 13:35:43 CEST 2012


Board: SID1 NOAH
registered netconsole as cs1
noah_read_ccm_regs: CCM CRDR = 00000000
noah_read_ccm_regs: CCM RCSR = 01020820
noah_read_ccm_regs: Booting from WEIM: NOR
imx-esdhc@mci0: registered as mci0
imx-esdhc@imx-esdhc0: set clock: wanted: 400000 got: 377840
imx-esdhc@imx-esdhc0: pre_div: 8 div: 10
imx-esdhc@imx-esdhc0: set clock: wanted: 200000 got: 188920
imx-esdhc@imx-esdhc0: pre_div: 16 div: 10
imx-esdhc@imx-esdhc0: set clock: wanted: 200000 got: 188920
imx-esdhc@imx-esdhc0: pre_div: 16 div: 10
imx-esdhc@imx-esdhc0: set clock: wanted: 200000 got: 188920
imx-esdhc@imx-esdhc0: pre_div: 16 div: 10
imx-esdhc@imx-esdhc0: set clock: wanted: 50000000 got: 33250000
imx-esdhc@imx-esdhc0: pre_div: 0 div: 1
mci@mci0: registered disk0
imx25_devices_init: Adding NOR flash device
cfi_flash@cfi_flash0: cfi flash (id=01000000 vend=000002 manu=000001
devid=00007E extid=002301) at a0000000, size 64MB
imx25_devices_init: Adding initial NOR flash partitions
ehci@ehci0: USB EHCI 1.00
Malloc space: 0x83b00000 -> 0x83efffff (size  4 MB)
Stack space : 0x83af8000 -> 0x83b00000 (size 32 kB)
envfs: wrong magic on /dev/env0
no valid environment found on /dev/env0. Using default environment
running /env/bin/init...

Hit any key to stop autoboot:  2

type update_kernel nor [<imagename>] to update kernel into flash
type update_root nor [<imagename>] to update rootfs into flash

sid1-noah:/ mkdir /nmnt
sid1-noah:/ mkdir /mnt
sid1-noah:/ mount /dev/disk0.0 fat /mnt
block_cache: blk->ops->read returned 0
sid1-noah:/ cp /mnt/block_cache: blk->ops->read returned 0

/mnt/barebox-mmc.bin
/mnt/barebox-nor.bin
/mnt/console_image.jffs2
/mnt/console_image.jffs2-2
/mnt/console_image.jffs2-backup
/mnt/kernel-sid1-noah.tgz
/mnt/u-boot.bin
/mnt/uImage
/mnt/uImage-2.6.39.3-hotfix-2012-04-noah-stable.bin
/mnt/uImage-linux-3.3.4-noah-stable.bin
/mnt/uimage.bin
sid1-noah:/ cp /mnt/console_image.jffs2 /mnt/console_image.jffs2-backup
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0

Data Write Failed in PIO Mode.imx-esdhc@imx-esdhc0: timeout 2
imx-esdhc@imx-esdhc0: timeout 1
imx-esdhc@imx-esdhc0: timeout 1
imx-esdhc@imx-esdhc0: timeout 1
block_cache: blk->ops->read returned -110
BUG: failure at common/block.c:249/block_put()!
BUG!
[<83f348f0>] (unwind_backtrace+0x0/0x90) from [<83f1bfe0>] (panic+0x28/0x3c)
[<83f1bfe0>] (panic+0x28/0x3c) from [<83f05900>] (block_put+0x48/0x8c)
[<83f05900>] (block_put+0x48/0x8c) from [<83f059ec>]
(block_write+0xa8/0x120)
[<83f059ec>] (block_write+0xa8/0x120) from [<83f2d3c4>]
(cdev_write+0x30/0x34)
[<83f2d3c4>] (cdev_write+0x30/0x34) from [<83f308bc>] (disk_write+0x24/0x30)
[<83f308bc>] (disk_write+0x24/0x30) from [<83f2fa08>] (f_write+0x160/0x27c)
[<83f2fa08>] (f_write+0x160/0x27c) from [<83f3067c>] (fat_write+0x18/0x30)
[<83f3067c>] (fat_write+0x18/0x30) from [<83f3116c>] (write+0xac/0xd0)
[<83f3116c>] (write+0xac/0xd0) from [<83f217b0>] (copy_file+0xec/0x17c)
[<83f217b0>] (copy_file+0xec/0x17c) from [<83f1912c>] (do_cp+0x124/0x158)
[<83f1912c>] (do_cp+0x124/0x158) from [<83f07bb0>]
(execute_command+0x38/0x7c)
[<83f07bb0>] (execute_command+0x38/0x7c) from [<83f03bc8>]
(run_list_real+0x8a0/0x998)
[<83f03bc8>] (run_list_real+0x8a0/0x998) from [<83f03e04>]
(parse_stream_outer+0x144/0x240)
[<83f03e04>] (parse_stream_outer+0x144/0x240) from [<83f041fc>]
(run_shell+0x3c/0x5c)
[<83f041fc>] (run_shell+0x3c/0x5c) from [<83f09640>]
(start_barebox+0xd4/0x110)
[<83f09640>] (start_barebox+0xd4/0x110) from [<8010206c>] (0x8010206c)

I am pretty sure we need to switch to 1BIT transfer and/or using the
SDHCI_BROKEN_TIMEOUT_VAL
quirk. I'll try to find out if I can add this functionality to barebox,
unless you believe there's something else which causes this behaviour.

I'll keep investigating ...

Cheers
Roberto

[-- Attachment #1.2: Type: text/html, Size: 7245 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG: barebox-git] failure at common/block.c:248/block_put()!
  2012-05-29 11:47     ` Roberto Nibali
@ 2012-05-29 13:33       ` Roberto Nibali
  2012-05-29 18:57       ` Sascha Hauer
  1 sibling, 0 replies; 8+ messages in thread
From: Roberto Nibali @ 2012-05-29 13:33 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 8503 bytes --]

More information ...


> I am pretty sure we need to switch to 1BIT transfer and/or using the SDHCI_BROKEN_TIMEOUT_VAL
> quirk. I'll try to find out if I can add this functionality to barebox,
> unless you believe there's something else which causes this behaviour.
>
> I'll keep investigating ...
>

Added more debugging information, which pretty much pinpoints the culprit
from a software point of view:

diff --git a/common/block.c b/common/block.c
index 4253fc4..5e0b50a 100644
--- a/common/block.c
+++ b/common/block.c
@@ -142,6 +142,7 @@ static int block_cache(struct block_device *blk, int
block)
        num_blocks = min(blk->rdbufsize, blk->num_blocks -
chunk->block_start);

        ret = blk->ops->read(blk, chunk->data, chunk->block_start,
num_blocks);
+       printf("%s: blk->ops->read returned %d\n", __func__, ret);
        if (ret) {
                list_add_tail(&chunk->list, &blk->idle_blocks);
                return ret;
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index ae3c805..024e18e 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -24,6 +24,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+
+#define DEBUG
+
 #include <config.h>
 #include <common.h>
 #include <driver.h>
@@ -239,6 +242,7 @@ esdhc_send_cmd(struct mci_host *mci, struct mci_cmd
*cmd, struct mci_data *data
        struct fsl_esdhc_host *host = to_fsl_esdhc(mci);
        struct fsl_esdhc *regs = host->regs;
        int ret;
+       int loop;

        esdhc_write32(&regs->irqstat, -1);

@@ -280,6 +284,18 @@ esdhc_send_cmd(struct mci_host *mci, struct mci_cmd
*cmd, struct mci_data *dat
        /* Wait for the command to complete */
        ret = wait_on_timeout(100 * MSECOND,
                        esdhc_read32(&regs->irqstat) & IRQSTAT_CC);
+       loop = 1;
+       while (ret && loop <=10) {
+               printf("%s: busy loop %d start\n", __func__, loop);
+               ret = wait_on_timeout(100 * MSECOND,
+                       esdhc_read32(&regs->irqstat) & IRQSTAT_CC);
+               printf("%s: busy loop %d end, cap=0x%08x, irqstat=0x%08x,
prsstat=0x%08x\n",
+                       __func__, loop,
+                       esdhc_read32(&host->regs->hostcapblt),
+                       esdhc_read32(&regs->irqstat),
+                       esdhc_read32(&regs->prsstat));
+               loop++;
+       }
        if (ret) {
                dev_err(host->dev, "timeout 1\n");
                return -ETIMEDOUT;

It clearly hangs because the IRQSTAT_CC is never set in &regs->irqstat.
Now, I am not familiar enough with the quirks of the ESDHC technology to
know why the host never receives or sees the IRQ of a command complete,
however this behaviour pretty much renders my eSDHC interface unusable. See
output below:

sid1-noah:/ mount /dev/disk0.0 fat /mnt
block_cache: blk->ops->read returned 0
sid1-noah:/ cp /mnt/conblock_cache: blk->ops->read returned 0
sole_image.jffs2 /mnt/console_image.jffs2-backup
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0
block_cache: blk->ops->read returned 0

Data Write Failed in PIO Mode.imx-esdhc@imx-esdhc0: timeout 2
esdhc_send_cmd: busy loop 1 start
esdhc_send_cmd: busy loop 1 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 2 start
esdhc_send_cmd: busy loop 2 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 3 start
esdhc_send_cmd: busy loop 3 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 4 start
esdhc_send_cmd: busy loop 4 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 5 start
esdhc_send_cmd: busy loop 5 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 6 start
esdhc_send_cmd: busy loop 6 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 7 start
esdhc_send_cmd: busy loop 7 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 8 start
esdhc_send_cmd: busy loop 8 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 9 start
esdhc_send_cmd: busy loop 9 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 10 start
esdhc_send_cmd: busy loop 10 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
imx-esdhc@imx-esdhc0: timeout 1
esdhc_send_cmd: busy loop 1 start
esdhc_send_cmd: busy loop 1 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 2 start
esdhc_send_cmd: busy loop 2 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 3 start
esdhc_send_cmd: busy loop 3 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 4 start
esdhc_send_cmd: busy loop 4 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 5 start
esdhc_send_cmd: busy loop 5 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 6 start
esdhc_send_cmd: busy loop 6 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 7 start
esdhc_send_cmd: busy loop 7 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 8 start
esdhc_send_cmd: busy loop 8 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 9 start
esdhc_send_cmd: busy loop 9 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 10 start
esdhc_send_cmd: busy loop 10 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
imx-esdhc@imx-esdhc0: timeout 1
esdhc_send_cmd: busy loop 1 start
esdhc_send_cmd: busy loop 1 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 2 start
esdhc_send_cmd: busy loop 2 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 3 start
esdhc_send_cmd: busy loop 3 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 4 start
esdhc_send_cmd: busy loop 4 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 5 start
esdhc_send_cmd: busy loop 5 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 6 start
esdhc_send_cmd: busy loop 6 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 7 start
esdhc_send_cmd: busy loop 7 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 8 start
esdhc_send_cmd: busy loop 8 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 9 start
esdhc_send_cmd: busy loop 9 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
esdhc_send_cmd: busy loop 10 start
esdhc_send_cmd: busy loop 10 end, cap=0x07f30000, irqstat=0x00000000,
prsstat=0xf7880587
imx-esdhc@imx-esdhc0: timeout 1
block_cache: blk->ops->read returned -110
BUG: failure at common/block.c:249/block_put()!
BUG!
[<83f349a4>] (unwind_backtrace+0x0/0x9c) from [<83f1c094>] (panic+0x28/0x3c)
[<83f1c094>] (panic+0x28/0x3c) from [<83f05900>] (block_put+0x48/0x8c)
[<83f05900>] (block_put+0x48/0x8c) from [<83f059ec>]
(block_write+0xa8/0x120)
[<83f059ec>] (block_write+0xa8/0x120) from [<83f2d478>]
(cdev_write+0x30/0x34)
[<83f2d478>] (cdev_write+0x30/0x34) from [<83f30970>] (disk_write+0x24/0x30)
[<83f30970>] (disk_write+0x24/0x30) from [<83f2fabc>] (f_write+0x160/0x27c)
[<83f2fabc>] (f_write+0x160/0x27c) from [<83f30730>] (fat_write+0x18/0x30)
[<83f30730>] (fat_write+0x18/0x30) from [<83f31220>] (write+0xac/0xd0)
[<83f31220>] (write+0xac/0xd0) from [<83f21864>] (copy_file+0xec/0x17c)
[<83f21864>] (copy_file+0xec/0x17c) from [<83f191e0>] (do_cp+0x124/0x158)
[<83f191e0>] (do_cp+0x124/0x158) from [<83f07bb0>]
(execute_command+0x38/0x7c)
[<83f07bb0>] (execute_command+0x38/0x7c) from [<83f03bc8>]
(run_list_real+0x8a0/0x998)
[<83f03bc8>] (run_list_real+0x8a0/0x998) from [<83f03e04>]
(parse_stream_outer+0x144/0x240)
[<83f03e04>] (parse_stream_outer+0x144/0x240) from [<83f041fc>]
(run_shell+0x3c/0x5c)
[<83f041fc>] (run_shell+0x3c/0x5c) from [<83f09640>]
(start_barebox+0xd4/0x110)
[<83f09640>] (start_barebox+0xd4/0x110) from [<8010206c>] (0x8010206c)

Removing the loop<=10 limit throws the code into a livelock.

Any suggestions?

Cheers
Roberto

[-- Attachment #1.2: Type: text/html, Size: 11135 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG: barebox-git] failure at common/block.c:248/block_put()!
  2012-05-29 11:47     ` Roberto Nibali
  2012-05-29 13:33       ` Roberto Nibali
@ 2012-05-29 18:57       ` Sascha Hauer
  2012-05-29 19:57         ` Roberto Nibali
  1 sibling, 1 reply; 8+ messages in thread
From: Sascha Hauer @ 2012-05-29 18:57 UTC (permalink / raw)
  To: Roberto Nibali; +Cc: barebox

On Tue, May 29, 2012 at 01:47:36PM +0200, Roberto Nibali wrote:
> G'day
> 
> 
> 
> Data Write Failed in PIO Mode.imx-esdhc@imx-esdhc0: timeout 2
> imx-esdhc@imx-esdhc0: timeout 1
> imx-esdhc@imx-esdhc0: timeout 1
> imx-esdhc@imx-esdhc0: timeout 1
> block_cache: blk->ops->read returned -110

Ok, so your problem is inside the esdhc driver. Sorry, I don't know what
quirks we may need here. Might be worth looking at the kernel or U-Boot
to find out.

> BUG: failure at common/block.c:249/block_put()!
> BUG!

Nevertheless we'll need a fix for this. I'll prepare a patch for this if
noone else is faster ;)

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG: barebox-git] failure at common/block.c:248/block_put()!
  2012-05-29 18:57       ` Sascha Hauer
@ 2012-05-29 19:57         ` Roberto Nibali
  2012-05-30  5:33           ` Sascha Hauer
  0 siblings, 1 reply; 8+ messages in thread
From: Roberto Nibali @ 2012-05-29 19:57 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 1053 bytes --]

Hi

> Data Write Failed in PIO Mode.imx-esdhc@imx-esdhc0: timeout 2
> > imx-esdhc@imx-esdhc0: timeout 1
> > imx-esdhc@imx-esdhc0: timeout 1
> > imx-esdhc@imx-esdhc0: timeout 1
> > block_cache: blk->ops->read returned -110
>
> Ok, so your problem is inside the esdhc driver. Sorry, I don't know what
> quirks we may need here. Might be worth looking at the kernel or U-Boot
> to find out.


I don't know where this driver comes from, however I have been revising the
i.MX25 Chipset Errata and there are heaps of problems with regard to eSDHC.
I will try to address some of them (for example WML related) and see if
this fixes anything.


> > BUG: failure at common/block.c:249/block_put()!
> > BUG!
>
> Nevertheless we'll need a fix for this. I'll prepare a patch for this if
> noone else is faster ;)


Well, the BUG() is legit, I just seem to be the first to hit it. I am not
sure how you want to fix it, because if it's an issue with regard to
chipset errata, at least a warning has to be issues. Maybe BUG() is a bit
excessive ;).

Cheers
Roberto

>

[-- Attachment #1.2: Type: text/html, Size: 1665 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG: barebox-git] failure at common/block.c:248/block_put()!
  2012-05-29 19:57         ` Roberto Nibali
@ 2012-05-30  5:33           ` Sascha Hauer
  0 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2012-05-30  5:33 UTC (permalink / raw)
  To: Roberto Nibali; +Cc: barebox

On Tue, May 29, 2012 at 09:57:38PM +0200, Roberto Nibali wrote:
> Hi
> 
> > Data Write Failed in PIO Mode.imx-esdhc@imx-esdhc0: timeout 2
> > > imx-esdhc@imx-esdhc0: timeout 1
> > > imx-esdhc@imx-esdhc0: timeout 1
> > > imx-esdhc@imx-esdhc0: timeout 1
> > > block_cache: blk->ops->read returned -110
> >
> > Ok, so your problem is inside the esdhc driver. Sorry, I don't know what
> > quirks we may need here. Might be worth looking at the kernel or U-Boot
> > to find out.
> 
> 
> I don't know where this driver comes from, however I have been revising the
> i.MX25 Chipset Errata and there are heaps of problems with regard to eSDHC.
> I will try to address some of them (for example WML related) and see if
> this fixes anything.

The driver comes from U-Boot, but the kernel might also be a good source
to see where the i.MX25 gets special handling.

> 
> 
> > > BUG: failure at common/block.c:249/block_put()!
> > > BUG!
> >
> > Nevertheless we'll need a fix for this. I'll prepare a patch for this if
> > noone else is faster ;)
> 
> 
> Well, the BUG() is legit, I just seem to be the first to hit it. I am not
> sure how you want to fix it, because if it's an issue with regard to
> chipset errata, at least a warning has to be issues. Maybe BUG() is a bit
> excessive ;).

I only want to get rid of the BUG() (see the patches I just sent). Of
course this won't fix your problems with the driver.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-05-30  5:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-29  9:49 [BUG: barebox-git] failure at common/block.c:248/block_put()! Roberto Nibali
2012-05-29 10:14 ` Sascha Hauer
2012-05-29 10:25   ` Roberto Nibali
2012-05-29 11:47     ` Roberto Nibali
2012-05-29 13:33       ` Roberto Nibali
2012-05-29 18:57       ` Sascha Hauer
2012-05-29 19:57         ` Roberto Nibali
2012-05-30  5:33           ` Sascha Hauer

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