From: andrzej.mialkowski@inetia.pl
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: hardcoded maximum number of CFI chips - continued
Date: Mon, 21 Jul 2003 15:04:51 +0200 [thread overview]
Message-ID: <1058792691.3f1be4f31ca98@imail.internetia.pl> (raw)
Due to e-mail configuration problems I'm not able to continue on previous
thread.
Jörn,
You of course right that limit proposed in patch too high. With current
typical stack size (8K) and structure size (36 bytes - on ARM) it is safe to
handle this way about 160 chips. This is much more what can be expected in
resonable designs (and what I need). On the other hand placing kmalloc for
chips structure effectively leeds to solution with realloc. Drawback of this
will be creation of heap fragment, it also still has problem with the constant
limit.
For me attractive are two solutions:
1) Cleaned previous proposal, becuse it is simple and solves problem probably
fits for all designs.
2) Rewrite genprobe_ident_chips to use realloc emulation to allow expansion
structure and handling any number of chips.
Andrzej
diff -Nru --minimal prev/drivers/mtd/chips/Config.in
linux/drivers/mtd/chips/Config.in
--- prev/drivers/mtd/chips/Config.in Fri Mar 14 17:21:15 2003
+++ linux/drivers/mtd/chips/Config.in Mon Jul 21 14:23:49 2003
@@ -40,6 +40,7 @@
bool ' Support 4-chip flash interleave' CONFIG_MTD_CFI_I4
bool ' Support 8-chip flash interleave' CONFIG_MTD_CFI_I8
fi
+ int ' Maximum number of flash chips' CONFIG_MTD_CFI_MAX_CHIPS 8 1 32
fi
fi
dep_tristate ' Support for Intel/Sharp flash chips' CONFIG_MTD_CFI_INTELEXT
$CONFIG_MTD_GEN_PROBE
diff -Nru --minimal prev/include/linux/mtd/cfi.h linux/include/linux/mtd/cfi.h
--- prev/include/linux/mtd/cfi.h Fri Mar 14 17:05:39 2003
+++ linux/include/linux/mtd/cfi.h Mon Jul 21 14:22:38 2003
@@ -306,7 +306,11 @@
struct flchip chips[0]; /* per-chip data structure for each chip */
};
+#ifndef CONFIG_MTD_CFI_MAX_CHIPS
#define MAX_CFI_CHIPS 8 /* Entirely arbitrary to avoid realloc() */
+#else
+#define MAX_CFI_CHIPS CONFIG_MTD_CFI_MAX_CHIPS
+#endif
/*
* Returns the command address according to the given geometry.
next reply other threads:[~2003-07-21 13:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-21 13:04 andrzej.mialkowski [this message]
2003-07-21 16:04 ` hardcoded maximum number of CFI chips - continued Jörn Engel
2003-07-21 21:34 ` andrzej.mialkowski
2003-07-22 10:21 ` Jörn Engel
2003-07-24 16:28 ` andrzej.mialkowski
2003-08-01 16:55 ` Jörn Engel
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=1058792691.3f1be4f31ca98@imail.internetia.pl \
--to=andrzej.mialkowski@inetia.pl \
--cc=joern@wohnheim.fh-wedel.de \
--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