From: David Vrabel <dvrabel@arcom.com>
To: Leon Woestenberg <leon.woestenberg@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] Do not oops when configured flash size is less then chip size
Date: Thu, 11 May 2006 16:52:54 +0100 [thread overview]
Message-ID: <44635DD6.10805@arcom.com> (raw)
In-Reply-To: <c384c5ea0605110820m606a04e7nc87cbc9302fd619c@mail.gmail.com>
Leon Woestenberg wrote:
>
> [MTD] CHIPS: Do not oops when configured flash size is less then chip size
>
> My kernel oopsed when the on-board flash chips where quadruple the size of the
> platform default physmap_map.size. Turned out that max_chips becomes zero,
> resulting in an oops later in locking chip->mutex being non-initialized.
> --- a/drivers/mtd/chips/gen_probe.c
> +++ b/drivers/mtd/chips/gen_probe.c
> @@ -100,6 +100,11 @@ #endif
> * Align bitmap storage size to full byte.
> */
> max_chips = map->size >> cfi.chipshift;
> + if (max_chips == 0) {
> + printk(KERN_WARNING "Single flash chip size exceeds the configured flash area size. Check your kernel configuration.\n");
This sounds like a valid, if unlikely, board configuration. e.g., a
board with chips fitted that are larger than the chip-select memory window.
It might be better to pretend such configuration is a single chip that's
smaller than it physically is.
Maybe something as simple as:
/* there's at least one chip present */
max_chips = max(map->size >> cfi.chipshift, 1);
?
David Vrabel
--
David Vrabel, Design Engineer
Arcom, Clifton Road Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK Web: http://www.arcom.com/
next prev parent reply other threads:[~2006-05-11 15:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-11 15:20 [PATCH] Do not oops when configured flash size is less then chip size Leon Woestenberg
2006-05-11 15:52 ` David Vrabel [this message]
2006-05-11 16:03 ` Leon Woestenberg
2006-05-12 0:28 ` David Woodhouse
2006-05-12 22:40 ` Leon Woestenberg
2006-05-12 18:18 ` Peter Hanson
2006-05-13 11:22 ` David Woodhouse
2006-05-13 13:23 ` Leon Woestenberg
2006-05-15 20:04 ` Leon Woestenberg
2006-05-15 21:54 ` David Woodhouse
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=44635DD6.10805@arcom.com \
--to=dvrabel@arcom.com \
--cc=leon.woestenberg@gmail.com \
--cc=linux-mtd@lists.infradead.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