mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Roberto Nibali <rnibali@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [BUG: barebox-git] failure at common/block.c:248/block_put()!
Date: Tue, 29 May 2012 12:14:50 +0200	[thread overview]
Message-ID: <20120529101450.GS30400@pengutronix.de> (raw)
In-Reply-To: <CAONxwYP5Eu59tpndafUpJrbHNMgZTF_3JaJ2pr5i8ptDugdpBQ@mail.gmail.com>

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

  reply	other threads:[~2012-05-29 10:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29  9:49 Roberto Nibali
2012-05-29 10:14 ` Sascha Hauer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120529101450.GS30400@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=rnibali@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox