* + mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update.patch added to -mm tree
@ 2010-08-23 22:58 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2010-08-23 22:58 UTC (permalink / raw)
To: mm-commits; +Cc: olof, linux-mmc, msb
The patch titled
mmc: add config and runtime option for number of mmcblk minors
has been added to the -mm tree. Its filename is
mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: mmc: add config and runtime option for number of mmcblk minors
From: Olof Johansson <olof@lixom.net>
Changes since v1:
* Runtime override of config default
* Better help text
* DIV_ROUND_UP for max_devices calculation
* Clarify mmcblk device count limitations
Changes since v2 based on feedback from Mandeep Baines:
* DIV_ROUND_UP is doing the wrong thing, we'll end up using
the last fractional range of minors which we shouldn't.
* Documentation/devices.txt update
* No need to compute max_devices twice, just do it at runtime.
* Permission fix for the module_param -- it's readonly.
Signed-off-by: Olof Johansson <olof@lixom.net>
Cc: Mandeep Baines <msb@chromium.org>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
Documentation/devices.txt | 6 ++++++
drivers/mmc/card/block.c | 10 +++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff -puN Documentation/devices.txt~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update Documentation/devices.txt
--- a/Documentation/devices.txt~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update
+++ a/Documentation/devices.txt
@@ -2519,6 +2519,12 @@ Your cooperation is appreciated.
8 = /dev/mmcblk1 Second SD/MMC card
...
+ The start of next SD/MMC card can be configured with
+ CONFIG_MMC_BLOCK_MINORS, or overridden at boot/modprobe
+ time using the mmcblk.perdev_minors option. That would
+ bump the offset between each card to be the configured
+ value instead of the default 8.
+
179 char CCube DVXChip-based PCI products
0 = /dev/dvxirq0 First DVX device
1 = /dev/dvxirq1 Second DVX device
diff -puN drivers/mmc/card/block.c~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update drivers/mmc/card/block.c
--- a/drivers/mmc/card/block.c~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update
+++ a/drivers/mmc/card/block.c
@@ -60,7 +60,7 @@ static int perdev_minors = CONFIG_MMC_BL
* We've only got one major, so number of mmcblk devices is
* limited to 256 / number of minors per device.
*/
-static int max_devices = DIV_ROUND_UP(256, CONFIG_MMC_BLOCK_MINORS);
+static int max_devices;
/* 256 minors, so at most 256 separate devices */
static DECLARE_BITMAP(dev_use, 256);
@@ -79,7 +79,7 @@ struct mmc_blk_data {
static DEFINE_MUTEX(open_lock);
-module_param(perdev_minors, int, 0644);
+module_param(perdev_minors, int, 0444);
MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device");
static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)
@@ -782,10 +782,10 @@ static int __init mmc_blk_init(void)
{
int res;
- if (perdev_minors != CONFIG_MMC_BLOCK_MINORS) {
+ if (perdev_minors != CONFIG_MMC_BLOCK_MINORS)
pr_info("mmcblk: using %d minors per device\n", perdev_minors);
- max_devices = DIV_ROUND_UP(256, perdev_minors);
- }
+
+ max_devices = 256 / perdev_minors;
res = register_blkdev(MMC_BLOCK_MAJOR, "mmc");
if (res)
_
Patches currently in -mm which might be from olof@lixom.net are
linux-next.patch
mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors.patch
mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-08-23 22:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-23 22:58 + mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update.patch added to -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).