public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* several bugfixes/workarounds in mtd snapshot of 20041226 && 2.4.28
@ 2004-12-29 14:10 Frantisek Rysanek
  2005-01-05 17:36 ` David Woodhouse
  0 siblings, 1 reply; 2+ messages in thread
From: Frantisek Rysanek @ 2004-12-29 14:10 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 1055 bytes --]

Dear MTD maintainers,

I suggest several bugfixes and workarounds against the 
snapshot of 20041226 (inserted into a vanilla 2.4.28) - see 
the attached patch.

I'm using DiskOnChip devices in various sorts of Advantech 
hardware. I'm compiling my MTD drivers for the DiskOnChip 
alone - I don't want to include all the other MTD stuff 
(useless to me).

Bugs fixed / worked around:

1) if you flush the partition table and issue a BLKRRPART 
(i.e., you re-partition the diskonchip), the reported device 
size shrinks to one half of the original. If you do this again 
before a reboot, the size shrinks again (now one quarter).
Seems like the driver would re-init device size to a size denominated in 1k blocks,
rather than sectors (512B).

2) in my DiskOnChip-only setup, CONFIG_MTD_MAP_BANK_WIDTH_1 
is missing in the .config. I've added that straight to $LINUX/include/linux/map.h

3) two #includes seem to be missing in $MTD/nand/diskonchip.c

4) the Reed-Solomon library hooks are messed up in $LINUX/lib/Config.in

I hope this helps

Frank Rysanek


[-- Attachment #2: Text from file 'mtd-bugs.20041226.patch' --]
[-- Type: text/plain, Size: 1910 bytes --]

--- linux_with_mtd_bugs/drivers/mtd/mtd_blkdevs-24.c	2004-12-27 14:48:52.000000000 +0100
+++ linux/drivers/mtd/mtd_blkdevs-24.c	2004-12-29 14:32:14.000000000 +0100
@@ -315,7 +315,7 @@
 	}
 
 	grok_partitions(gd, minor, 1 << tr->part_bits, 
-			tr->blkcore_priv->sizes[minor]);
+                        dev->size);
 	up(&mtd_table_mutex);
 
 	return 0;
--- linux_with_mtd_bugs/include/linux/mtd/map.h	2004-12-27 14:48:54.000000000 +0100
+++ linux/include/linux/mtd/map.h	2004-12-27 15:33:58.000000000 +0100
@@ -14,6 +14,10 @@
 #include <asm/io.h>
 #include <asm/bug.h>
 
+#ifndef CONFIG_MTD_CFI_GEOMETRY
+#define CONFIG_MTD_MAP_BANK_WIDTH_1
+#endif
+
 #ifdef CONFIG_MTD_MAP_BANK_WIDTH_1
 #define map_bankwidth(map) 1
 #define map_bankwidth_is_1(map) (map_bankwidth(map) == 1)
--- linux_with_mtd_bugs/drivers/mtd/nand/diskonchip.c	2004-12-27 14:48:53.000000000 +0100
+++ linux/drivers/mtd/nand/diskonchip.c	2004-12-27 13:39:56.000000000 +0100
@@ -24,6 +24,8 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/rslib.h>
+#include <linux/moduleparam.h>
+#include <linux/rslib.h>
 #include <asm/io.h>
 
 #include <linux/mtd/mtd.h>
--- linux_with_mtd_bugs/lib/Config.in	2004-12-27 14:48:54.000000000 +0100
+++ linux/lib/Config.in	2004-12-29 14:37:35.000000000 +0100
@@ -43,13 +43,15 @@
 
 if [ "$CONFIG_MTD_DOCPROBE" = "y" -o \
      "$CONFIG_MTD_NAND_RTC_FROM4" = "y" -o \
-     "$MTD_NAND_DISKONCHIP" = "y" ]; then
+     "$CONFIG_MTD_NAND_DISKONCHIP" = "y" ]; then
    define_tristate CONFIG_REED_SOLOMON y
+   define_tristate CONFIG_REED_SOLOMON_DEC16 y
 else
   if [ "$CONFIG_MTD_DOCPROBE" = "m" -o \
      "$CONFIG_MTD_NAND_RTC_FROM4" = "m" -o \
-     "$MTD_NAND_DISKONCHIP" = "m" ]; then
+     "$CONFIG_MTD_NAND_DISKONCHIP" = "m" ]; then
      define_tristate CONFIG_REED_SOLOMON m
+     define_tristate CONFIG_REED_SOLOMON_DEC16 y
   else
      define_tristate CONFIG_REED_SOLOMON n
   fi

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

* Re: several bugfixes/workarounds in mtd snapshot of 20041226 && 2.4.28
  2004-12-29 14:10 several bugfixes/workarounds in mtd snapshot of 20041226 && 2.4.28 Frantisek Rysanek
@ 2005-01-05 17:36 ` David Woodhouse
  0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2005-01-05 17:36 UTC (permalink / raw)
  To: Frantisek Rysanek; +Cc: linux-mtd

On Wed, 2004-12-29 at 15:10 +0100, Frantisek Rysanek wrote:
> 1) if you flush the partition table and issue a BLKRRPART 
> (i.e., you re-partition the diskonchip), the reported device 
> size shrinks to one half of the original. If you do this again 
> before a reboot, the size shrinks again (now one quarter).
> Seems like the driver would re-init device size to a size denominated in 1k blocks,
> rather than sectors (512B).

Committed. Thanks.

> 2) in my DiskOnChip-only setup, CONFIG_MTD_MAP_BANK_WIDTH_1 
> is missing in the .config. I've added that straight to $LINUX/include/linux/map.h

I think that's a Config.in bug -- it shouldn't happen on 2.6.

> 3) two #includes seem to be missing in $MTD/nand/diskonchip.c

rslib.h was already there; I've added moduleparam.h which was not.

> 4) the Reed-Solomon library hooks are messed up in $LINUX/lib/Config.in

Committed; thanks.

-- 
dwmw2

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

end of thread, other threads:[~2005-01-05 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-29 14:10 several bugfixes/workarounds in mtd snapshot of 20041226 && 2.4.28 Frantisek Rysanek
2005-01-05 17:36 ` David Woodhouse

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