public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Brian Foster <brian.foster@maxim-ic.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Mike Frysinger <vapier@gentoo.org>
Subject: Re: [BUG] mtdinfo -a: Tries to open NULL pointer for NOR with Eraseblock Regions
Date: Mon, 8 Aug 2011 10:10:42 +0200	[thread overview]
Message-ID: <201108081010.42161.brian.foster@maxim-ic.com> (raw)
In-Reply-To: <CAN8TOE--96V6ZruB8+VvAz2kqxqMq4nc4d5=6SGsUt0eu7og0g@mail.gmail.com>

On Saturday 06 August 2011 02:09:04 Brian Norris wrote:
> On Thu, Aug 4, 2011 at 3:41 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On Thu, Aug 4, 2011 at 10:46, Brian Norris wrote:
>[...]
> >> Anyway, since I don't have these types of flash readily
> >> available, I don't even use these options :) And apparently,
> >> one of the biggest contributors for mtd-utils, Mike Frysinger,
> >> doesn't use region_info either...
> > 
> > i dont think any of the flashes (parallel nor, spi nor,
> > nand, etc...) included region_info.  that's why the func
> > print_region_info() sets up a dummy region_info struct that
> > describes the entire flash before calling print_region_map().
> 
> I don't know much about this, but what's the feature for
> if no one uses it?

 I'm also uncertain why Flash manufacturers have
 this “feature”, but some certainly do.  Below's
 the output of ‘mtd_debug info /dev/mtd0’ for
 two different NOR-Flash chips (on different
 reference systems).  In both cases, ‘/dev/mtd0’
 is the entire chip (an important point since
 it looks like partitions of a chip always(?)
 have zero regions?):
────────────────────────────────────────────────
# mtd_debug info /dev/mtd0    #(1) Flash from original bug report
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 33554432 (32M)
mtd.erasesize = 131072 (128K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 1

region[0].offset = 0x00000000
region[0].erasesize = 131072 (128K)
region[0].numblocks = 256
region[0].regionindex = 0

# mtd_debug info /dev/mtd0    #(2) Different Flash on different system
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 4194304 (4M)
mtd.erasesize = 65536 (64K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 3

region[0].offset = 0x00000000
region[0].erasesize = 8192 (8K)
region[0].numblocks = 8
region[0].regionindex = 0
region[1].offset = 0x00010000
region[1].erasesize = 65536 (64K)
region[1].numblocks = 62
region[1].regionindex = 1
region[2].offset = 0x003f0000
region[2].erasesize = 8192 (8K)
region[2].numblocks = 8
region[2].regionindex = 2
────────────────────────────────────────────────

 Our Linux systems are not explicitly taking
 advantage of multiple eraseblock regions.
 I do not know whether or not other software
 uses them.  (And yes, case ‘(2)’ really is
 only 4MiB — that chip is almost useless for
 the Linux systems.... ;-\   That system also
 has a 2nd NOR-Flash (32MiB), but I don't have
 at-hand the ‘mtd_debug info’ for it....)


cheers!
	-blf-
-- 
Brian FOSTER
Principal MTS, Software

Maxim Integrated Products (Microcontroller BU), formerly Innova Card
ZI Athélia IV - Le Forum, Bât. A
Quartier Roumagoua
13600 La Ciotat - France
Phone  : +33 (0)4 42 98 15 35
Fax    : +33 (0)4 42 08 33 19
Email  : brian.foster@maxim-ic.com
Web    : http://www.maxim-ic.com/

  parent reply	other threads:[~2011-08-08  8:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-25  9:48 [BUG] mtdinfo -a: Tries to open NULL pointer for NOR with Eraseblock Regions Brian Foster
2011-07-25 17:10 ` Brian Norris
2011-07-26  7:21   ` Brian Foster
2011-08-04 17:46     ` Brian Norris
2011-08-04 22:41       ` Mike Frysinger
2011-08-06  0:09         ` Brian Norris
2011-08-06  1:18           ` Mike Frysinger
2011-08-08  8:16             ` Brian Foster
2011-08-08 23:19             ` Brian Norris
2011-08-09  7:27               ` Brian Foster
2011-08-09 17:34               ` Mike Frysinger
2011-08-09 19:59                 ` Brian Norris
2011-08-15  4:11                 ` Artem Bityutskiy
2011-08-15 23:13                   ` Brian Norris
2011-08-16 14:17                     ` Artem Bityutskiy
2011-08-16  7:31                   ` Brian Foster
2011-08-16 17:47                     ` Brian Norris
2011-08-08  8:10           ` Brian Foster [this message]
2011-08-08  8:40             ` Brian Foster
2011-08-05  7:24       ` Brian Foster
2011-08-06  0:06         ` Brian Norris

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=201108081010.42161.brian.foster@maxim-ic.com \
    --to=brian.foster@maxim-ic.com \
    --cc=computersforpeace@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vapier@gentoo.org \
    /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