public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* mtdblock_ro and ext2 yields panic: block not locked
@ 2002-10-23 15:49 William A. Gatliff
       [not found] ` <5.1.0.14.2.20021023101127.03ed2df0@pop.prodigy.net>
  0 siblings, 1 reply; 6+ messages in thread
From: William A. Gatliff @ 2002-10-23 15:49 UTC (permalink / raw)
  To: linux-mtd

Guys:


I'm running linux-2.4.18-mips on an Au1500 board with an AMD AM29LV642
flash.  I'm using the readonly block driver and a partitioned flash.
The mtdblock_ro.c file has "mtdblock_ro.c,v 1.9" at the top.

I've been tinkering with mounting ext2 and romfs root filesystems at
boot from my mtdblock0 partition.  I seem to be able to mount romfs
fine, but when I use ext2, I get this:

...
ttyS03 at 0xb1400000 (irq = 3) is a 16550
mtdblock_open
ok
mtdblock_open
ok
mtdblock_release
ok
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 192k freed
Kernel panic: mtdblock: block not locked


The panic comes via the INIT_REQUEST macro in mtdblock_request, but
only after half a dozen requests or so.  The requests appear to be
associated with the execve at the end of the kernel boot process.

I also get this with yesterday's CVS.

Ideas?  I don't think this is an MTD problem per se, but I'm stumped
nonetheless.


Thanks!


b.g.
-- 
Bill Gatliff
I'm an embedded GNU developer first, GNU instructor second.
See http://billgatliff.com for details.

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

* Re: mtdblock_ro and ext2 yields panic: block not locked
@ 2002-10-23 17:15 Eugene Surovegin
  2002-10-27 19:53 ` Jörn Engel
  0 siblings, 1 reply; 6+ messages in thread
From: Eugene Surovegin @ 2002-10-23 17:15 UTC (permalink / raw)
  To: linux-mtd

At 08:49 AM 10/23/2002, you wrote:

>The panic comes via the INIT_REQUEST macro in mtdblock_request, but
>only after half a dozen requests or so.  The requests appear to be
>associated with the execve at the end of the kernel boot process.
>
>I also get this with yesterday's CVS.
>
>Ideas?  I don't think this is an MTD problem per se, but I'm stumped
>nonetheless.


mtdblock_ro is buggy. It uses nr_sectors instead current_nr_sectors while 
processing request.

I sent a patch to MTD maintainer several weeks ago - nothing happened.

Thanks,


  Eugene Surovegin <mailto:ebs@innocent.com>

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

* Re: mtdblock_ro and ext2 yields panic: block not locked
       [not found]   ` <20021023121843.A9783@saturn.billgatliff.com>
@ 2002-10-23 17:22     ` Eugene Surovegin
  2002-10-23 18:13       ` William A. Gatliff
  0 siblings, 1 reply; 6+ messages in thread
From: Eugene Surovegin @ 2002-10-23 17:22 UTC (permalink / raw)
  To: bgat; +Cc: linux-mtd

Bill,

At 10:18 AM 10/23/2002, you wrote:
>Care to post the patch?  I'd love to see if it fixes my problem...

Sure :)
Here it is:

diff -ur a/drivers/mtd/mtdblock_ro.c b/drivers/mtd/mtdblock_ro.c
--- a/drivers/mtd/mtdblock_ro.c
+++ b/drivers/mtd/mtdblock_ro.c
@@ -138,10 +138,11 @@
        }

        if (current_request->sector << 9 > mtd->size ||
-         (current_request->sector + current_request->nr_sectors) << 9 > 
mtd->size)
+         (current_request->sector + current_request->current_nr_sectors) 
<< 9 > mtd->size)
        {
          printk("mtd: Attempt to read past end of device!\n");
-        printk("size: %x, sector: %lx, nr_sectors %lx\n", mtd->size, 
current_request->sector, current_request->nr_sectors);
+        printk("size: %x, sector: %lx, nr_sectors %lx\n", mtd->size, 
current_request->sector,
+               current_request->current_nr_sectors);
          end_request(0);
          continue;
        }
@@ -162,7 +163,7 @@

          case READ:
          if (MTD_READ(mtd,current_request->sector<<9,
-                     current_request->nr_sectors << 9,
+                     current_request->current_nr_sectors << 9,
                       &retlen, current_request->buffer) == 0)
             res = 1;
          else
@@ -184,7 +185,7 @@

          // Do the write
          if (MTD_WRITE(mtd,current_request->sector<<9,
-                      current_request->nr_sectors << 9,
+                      current_request->current_nr_sectors << 9,
                        &retlen, current_request->buffer) == 0)
             res = 1;
          else
@@ -287,7 +288,7 @@
  static void __exit cleanup_mtdblock(void)
  {
         unregister_blkdev(MAJOR_NR,DEVICE_NAME);
-       blksize_size[MAJOR_NR] = NULL;
+       blk_size[MAJOR_NR] = NULL;
         blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
  }





  Eugene Surovegin <mailto:ebs@innocent.com>

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

* Re: mtdblock_ro and ext2 yields panic: block not locked
  2002-10-23 17:22     ` Eugene Surovegin
@ 2002-10-23 18:13       ` William A. Gatliff
  0 siblings, 0 replies; 6+ messages in thread
From: William A. Gatliff @ 2002-10-23 18:13 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: linux-mtd

Eugene:


That looks like it fixed the problem:

 ...
 ttyS03 at 0xb1400000 (irq = 3) is a 16550
 mtdblock_open
 ok
 mtdblock_open
 ok
 mtdblock_release
 ok
 VFS: Mounted root (ext2 filesystem) readonly.
 Freeing unused kernel memory: 196k freed
 Algorithmics/MIPS FPU Emulator v1.5
 init started:  BusyBox v0.60.4 (2002.10.16-16:11+0000) multi-call binary
 Running rc.S... done
 eth0: link up

 Please press Enter to activate this console.


 BusyBox v0.60.4 (2002.10.16-16:11+0000) Built-in shell (ash)
 Enter 'help' for a list of built-in commands.

 #


Thanks!!  Yay!  :^) :^)


b.g.

On Wed, Oct 23, 2002 at 10:22:57AM -0700, Eugene Surovegin wrote:
> Bill,
> 
> At 10:18 AM 10/23/2002, you wrote:
> >Care to post the patch?  I'd love to see if it fixes my problem...
> 
> Sure :)
> Here it is:
> 
> diff -ur a/drivers/mtd/mtdblock_ro.c b/drivers/mtd/mtdblock_ro.c
> --- a/drivers/mtd/mtdblock_ro.c
> +++ b/drivers/mtd/mtdblock_ro.c
> @@ -138,10 +138,11 @@
>         }
> 
>         if (current_request->sector << 9 > mtd->size ||
> -         (current_request->sector + current_request->nr_sectors) << 9 > 
> mtd->size)
> +         (current_request->sector + current_request->current_nr_sectors) 
> << 9 > mtd->size)
>         {
>           printk("mtd: Attempt to read past end of device!\n");
> -        printk("size: %x, sector: %lx, nr_sectors %lx\n", mtd->size, 
> current_request->sector, current_request->nr_sectors);
> +        printk("size: %x, sector: %lx, nr_sectors %lx\n", mtd->size, 
> current_request->sector,
> +               current_request->current_nr_sectors);
>           end_request(0);
>           continue;
>         }
> @@ -162,7 +163,7 @@
> 
>           case READ:
>           if (MTD_READ(mtd,current_request->sector<<9,
> -                     current_request->nr_sectors << 9,
> +                     current_request->current_nr_sectors << 9,
>                        &retlen, current_request->buffer) == 0)
>              res = 1;
>           else
> @@ -184,7 +185,7 @@
> 
>           // Do the write
>           if (MTD_WRITE(mtd,current_request->sector<<9,
> -                      current_request->nr_sectors << 9,
> +                      current_request->current_nr_sectors << 9,
>                         &retlen, current_request->buffer) == 0)
>              res = 1;
>           else
> @@ -287,7 +288,7 @@
>   static void __exit cleanup_mtdblock(void)
>   {
>          unregister_blkdev(MAJOR_NR,DEVICE_NAME);
> -       blksize_size[MAJOR_NR] = NULL;
> +       blk_size[MAJOR_NR] = NULL;
>          blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
>   }
> 
> 
> 
> 
> 
>   Eugene Surovegin <mailto:ebs@innocent.com>
> 
-- 
Bill Gatliff
I'm an embedded GNU developer first, GNU instructor second.
See http://billgatliff.com for details.

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

* Re: mtdblock_ro and ext2 yields panic: block not locked
  2002-10-23 17:15 mtdblock_ro and ext2 yields panic: block not locked Eugene Surovegin
@ 2002-10-27 19:53 ` Jörn Engel
  2002-10-29 14:28   ` David Woodhouse
  0 siblings, 1 reply; 6+ messages in thread
From: Jörn Engel @ 2002-10-27 19:53 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: linux-mtd

On Wed, 23 October 2002 10:15:00 -0700, Eugene Surovegin wrote:
> I sent a patch to MTD maintainer several weeks ago - nothing happened.

Hmm. David appears to be _very_ unavaillable currently. Does anyone
know what is causing it?

Jörn

-- 
The competent programmer is fully aware of the strictly limited size of
his own skull; therefore he approaches the programming task in full
humility, and among other things he avoids clever tricks like the plague. 
-- Edsger W. Dijkstra

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

* Re: mtdblock_ro and ext2 yields panic: block not locked
  2002-10-27 19:53 ` Jörn Engel
@ 2002-10-29 14:28   ` David Woodhouse
  0 siblings, 0 replies; 6+ messages in thread
From: David Woodhouse @ 2002-10-29 14:28 UTC (permalink / raw)
  To: Jörn Engel; +Cc: Eugene Surovegin, linux-mtd

joern@wohnheim.fh-wedel.de said:
>  Hmm. David appears to be _very_ unavaillable currently. Does anyone
> know what is causing it? 

Life. :)

The fact that Red Hat have actually been expecting me to _work_ recently 
rather than just playing all the time doesn't help either. I hope to find 
the time to clean up the current CVS and submit it to Linus and Marcelo 
fairly soon, and then I want to merge the new partition code too.

Eugene -- please could you send me a SSH public key; I'll give you an 
account and you can commit the patch. It looked sane to me IIRC and if you 
commit it yourself I know who to blame anyway if it's not :)

--
dwmw2

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

end of thread, other threads:[~2002-10-30 12:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-23 17:15 mtdblock_ro and ext2 yields panic: block not locked Eugene Surovegin
2002-10-27 19:53 ` Jörn Engel
2002-10-29 14:28   ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2002-10-23 15:49 William A. Gatliff
     [not found] ` <5.1.0.14.2.20021023101127.03ed2df0@pop.prodigy.net>
     [not found]   ` <20021023121843.A9783@saturn.billgatliff.com>
2002-10-23 17:22     ` Eugene Surovegin
2002-10-23 18:13       ` William A. Gatliff

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