public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Setting up multiple 'blkmtd' devices
@ 2005-05-05  6:23 Ryan B. Lynch
  2005-05-05  6:40 ` Jörn Engel
  0 siblings, 1 reply; 2+ messages in thread
From: Ryan B. Lynch @ 2005-05-05  6:23 UTC (permalink / raw)
  To: linux-mtd

I've been using the 'blkmtd' driver as a module, and I understand that 
the only way to set up the device association and create a 
'dev/mtdblock/*' device is to load the module with the option 
'device=/dev/xxx'.

Couple of questions:

    - Is it possible to load more than one device during the 'modprobe' 
command, with something like multiple "device=xxx" options?  I tried 
that exactly, and it doesn't seem to work--it only loads the first 
device listed.

    - Is it possible to set up additional blkmtd devices after the 
module has loaded?  If I issue the command 'modprobe blkmtd 
device=/dev/hdc1', is it possible to add another device later without 
unloading the module?

    - When I've compiled the 'blkmtd' driver into the kernel, I 
understand that I can associate the block device at boot time with the 
boot parameter "blkmtd_device=/dev/xxx".  If I don't pass a 
"blkmtd_device=" parameter at boot-time, is there any way to associate a 
device later on?

    - Given the compiled-in scenario for the 'blkmtd' driver, is it 
possible to bring in multiple devices, regardless of whether the 
boot-time parameter is passed?

    - Is there a userspace tool, along the lines of 'losetup' or 
'brctl', that allows you to manipulate/query blkmtd devices without 
using the module options?

I hope these are straightforward enough.  Thanks for the time.

-Ryan

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

* Re: Setting up multiple 'blkmtd' devices
  2005-05-05  6:23 Setting up multiple 'blkmtd' devices Ryan B. Lynch
@ 2005-05-05  6:40 ` Jörn Engel
  0 siblings, 0 replies; 2+ messages in thread
From: Jörn Engel @ 2005-05-05  6:40 UTC (permalink / raw)
  To: Ryan B. Lynch; +Cc: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 2056 bytes --]

On Thu, 5 May 2005 06:23:14 +0000, Ryan B. Lynch wrote:
> 
> I've been using the 'blkmtd' driver as a module, and I understand that 
> the only way to set up the device association and create a 
> 'dev/mtdblock/*' device is to load the module with the option 
> 'device=/dev/xxx'.
> 
> Couple of questions:
> 
>    - Is it possible to load more than one device during the 'modprobe' 
> command, with something like multiple "device=xxx" options?  I tried 
> that exactly, and it doesn't seem to work--it only loads the first 
> device listed.

Nope, but that should work for block2mtd.  If it doesn't work, it's a
bug and I'll fix it.

>    - Is it possible to set up additional blkmtd devices after the 
> module has loaded?  If I issue the command 'modprobe blkmtd 
> device=/dev/hdc1', is it possible to add another device later without 
> unloading the module?

Works for block2mtd.  If not, see above.

>    - When I've compiled the 'blkmtd' driver into the kernel, I 
> understand that I can associate the block device at boot time with the 
> boot parameter "blkmtd_device=/dev/xxx".  If I don't pass a 
> "blkmtd_device=" parameter at boot-time, is there any way to associate a 
> device later on?

For block2mtd there is.

>    - Given the compiled-in scenario for the 'blkmtd' driver, is it 
> possible to bring in multiple devices, regardless of whether the 
> boot-time parameter is passed?

dito

>    - Is there a userspace tool, along the lines of 'losetup' or 
> 'brctl', that allows you to manipulate/query blkmtd devices without 
> using the module options?

This doesn't exist for block2mtd yet.  Not sure if that's really
necessary.

> I hope these are straightforward enough.  Thanks for the time.

Blkmtd is old and completely broken wrt. parameter handling.  Imo,
it's unfixably broken, so I fixed things up in a new driver.  But I
broke things as well, so you need to apply a patch to 2.6.11 for it to
work.  Should be attached to this mail.

Jörn

-- 
He that composes himself is wiser than he that composes a book.
-- B. Franklin

[-- Attachment #2: block2mtd_embarrassment.patch --]
[-- Type: text/plain, Size: 903 bytes --]



Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
---

 drivers/mtd/devices/block2mtd.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

--- linux-2.6.11cow/drivers/mtd/devices/block2mtd.c~block2mtd_embarrassment	2005-03-07 21:19:16.000000000 +0100
+++ linux-2.6.11cow/drivers/mtd/devices/block2mtd.c	2005-03-07 21:24:47.000000000 +0100
@@ -4,7 +4,6 @@
  * block2mtd.c - create an mtd from a block device
  *
  * Copyright (C) 2001,2002	Simon Evans <spse@secret.org.uk>
- * Copyright (C) 2004		Gareth Bult <Gareth@Encryptec.net>
  * Copyright (C) 2004,2005	Jörn Engel <joern@wh.fh-wedel.de>
  *
  * Licence: GPL
@@ -157,7 +156,7 @@ static int block2mtd_read(struct mtd_inf
 	struct block2mtd_dev *dev = mtd->priv;
 	struct page *page;
 	int index = from >> PAGE_SHIFT;
-	int offset = from & (PAGE_SHIFT-1);
+	int offset = from & (PAGE_SIZE-1);
 	int cpylen;
 
 	if (from > mtd->size)

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

end of thread, other threads:[~2005-05-05  6:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-05  6:23 Setting up multiple 'blkmtd' devices Ryan B. Lynch
2005-05-05  6:40 ` Jörn Engel

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