From 625e8a508d8fccafc8bf7dc987c3da50f8133300 Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Fri, 11 May 2012 17:31:49 +0200 Subject: [PATCH] drivers/misc: ipanic should have a module parameter to specify dump partition BZ: 42097 Previously, dump partition was always number 6 (ie. mmcblk0p6). This prevents repartitioning and reordering on futur boards. This patch keeps 6 as the default, but makes the number configurable as a module param : - with kernel commandline emmc_ipanic.ipanic_part_number=3 for mmcblk0p3 Change-Id: I600b08fd22d781f6175039479df000a4cb7eae72 Signed-off-by: Robert Jarzmik Reviewed-on: http://android.intel.com:8080/52962 Reviewed-by: Puech, Yann Tested-by: Romieu, Benoit Reviewed-by: buildbot Tested-by: buildbot --- drivers/misc/emmc_ipanic.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/misc/emmc_ipanic.c b/drivers/misc/emmc_ipanic.c index 8019fe2..0bb354e 100755 --- a/drivers/misc/emmc_ipanic.c +++ b/drivers/misc/emmc_ipanic.c @@ -46,6 +46,10 @@ #include #include "emmc_ipanic.h" +static unsigned int ipanic_part_number; +module_param(ipanic_part_number, uint, 0); +MODULE_PARM_DESC(ipanic_part_number, "IPanic dump partition on mmcblk0"); + #ifdef CONFIG_ANDROID_LOGGER #include "../staging/android/logger.h" static unsigned char *logcat_name[LOGCAT_BUFF_COUNT] = { @@ -56,11 +60,14 @@ static unsigned char *logcat_name[LOGCAT_BUFF_COUNT] = { }; #endif +/* + * The part_number will be filled in driver init. + */ static struct mmc_emergency_info emmc_info = { .init = mmc_emergency_init, .write = mmc_emergency_write, .emmc_disk_name = "mmcblk0", - .part_number = EMMC_PANIC_PART_NUM, + .part_number = 0, .name = "emmc_ipanic", .disk_device = NULL }; @@ -965,11 +972,17 @@ int __init emmc_ipanic_init(void) /*initialization of drv_ctx */ memset(&drv_ctx, 0, sizeof(drv_ctx)); drv_ctx.emmc = &emmc_info; + if (!ipanic_part_number) + emmc_info.part_number = EMMC_PANIC_PART_NUM; + else + emmc_info.part_number = ipanic_part_number; + drv_ctx.ipanic_proc_entry_name = ipanic_proc_entry_name; drv_ctx.bounce = (void *)__get_free_page(GFP_KERNEL); INIT_WORK(&proc_removal_work, emmc_ipanic_remove_proc_work); - printk(KERN_INFO "Android kernel panic handler initialized!\n"); + printk(KERN_INFO "Android kernel panic handler initialized on partition %sp%d!\n", + emmc_info.emmc_disk_name, emmc_info.part_number); return 0; } -- 2.7.4