Bug 15644 - block2mtd can not use virtio based block device (virtio_blk)
block2mtd can not use virtio based block device (virtio_blk)
Status: RESOLVED CODE_FIX
Product: Drivers
Classification: Unclassified
Component: Flash/Memory Technology Devices
All Linux
: P1 high
Assigned To: David Woodhouse
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-29 01:20 UTC by Stijn Tintel
Modified: 2012-07-05 16:35 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.32.10, 2.6.33
Tree: Mainline
Regression: No


Attachments
Move initialization of virtio stuff before the initialization of mtd, so that block2mtd can be used on virtio-based block devices. (722 bytes, patch)
2010-03-29 01:20 UTC, Stijn Tintel
Details | Diff
Move initialization of virtio stuff before the initialization of mtd, so that block2mtd can be used on virtio-based block devices. (1000 bytes, patch)
2010-03-29 01:50 UTC, Stijn Tintel
Details | Diff

Description Stijn Tintel 2010-03-29 01:20:36 UTC
Created attachment 25745 [details]
Move initialization of virtio stuff before the initialization of mtd, so that block2mtd can be used on virtio-based block devices.

Whenever I try to use a virtio based block device as an MTD device with the block2mtd driver, I get the following error:

block2mtd: error: cannot open device /dev/vda2

Since both virtio_blk and block2mtd are builtin into the kernel, I cannot solve this with changing the load order of the modules.

The cause of this problem is that some virtio_* stuff, on which virtio_blk depends, is only initialized after block2mtd. When checking drivers/Makefile, it seems that virtio itself is almost at the bottom, way below stuff like block and others.

I was able to solve my problem by having virtio initialized around the time the Xen stuff is initialized, before block and others. And it shouldn't hurt to have virtio related stuff available earlier during boot either.
Comment 1 Stijn Tintel 2010-03-29 01:50:07 UTC
Created attachment 25746 [details]
Move initialization of virtio stuff before the initialization of mtd, so that block2mtd can be used on virtio-based block devices.

This patch does the same as the previous one, but was made with git and is signed-off.
Comment 2 Andrew Morton 2010-04-13 20:36:02 UTC
Please don't send patches via bugzilla - it causes lots of problems with
our usual patch management and review processes.

Please send this patch via email as per Documentation/SubmittingPatches. 
Suitable recipients may be found via scripts/get_maintainer.pl.  Please
also cc myself on the email.

Thanks.
Comment 3 Stijn Tintel 2010-04-17 12:17:47 UTC
Done.

Note You need to log in before you can comment on or make changes to this bug.