]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: phram: dot not crash when built-in and passing boot param
authorHervé Fache <h-fache@ti.com>
Tue, 13 Mar 2012 15:07:53 +0000 (16:07 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:57:11 +0000 (00:57 +0100)
commitf61e375feb8bb6ad0667c534b28ac0037b727c87
tree12407708dfdab40e0bf4107db15f780f46e933de
parent085123c8ec15f7b4476d2e589feee00b57331b02
mtd: phram: dot not crash when built-in and passing boot param

This patch is based on Ville Herva's similar patch to block2mtd.

Trying to pass a parameter through the kernel command line when built-in would
crash the kernel, as phram_setup() was called so early that kmalloc() was not
functional yet.

This patch only saves the parameter string at the early boot stage, and parses
it later when init_phram() is called. The same happens in both module and
built-in cases.

With this patch, I can boot with a statically-compiled phram, and mount a
ext2 root fs from physical RAM, without the need for a initrd.

This has been tested in built-in and module cases, with and without a
parameter string.

Artem: amended comments a bit

Signed-off-by: Hervé Fache <h-fache@ti.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/phram.c