From fa69876f48eec56d96a2a3970b46b6c2b1305823 Mon Sep 17 00:00:00 2001 From: John Michelau Date: Tue, 11 Jan 2011 16:52:25 -0600 Subject: [PATCH] Add dump_log cmd to mdm6600_ctrl This command triggers a dump of the MDM6600 RAM log buffers into non-volatile memory, so that they can be retrieved by bugreport or the RIL when submitting error reports. It provides a simple path for this which does not rely on the typical (and more error-prone) IPC mechanism. Change-Id: I17708704b94426b1541533978478192d3f4dab89 --- drivers/misc/radio_ctrl/mdm6600_ctrl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/misc/radio_ctrl/mdm6600_ctrl.c b/drivers/misc/radio_ctrl/mdm6600_ctrl.c index a6fa4fb902f8..dd0ac242533d 100644 --- a/drivers/misc/radio_ctrl/mdm6600_ctrl.c +++ b/drivers/misc/radio_ctrl/mdm6600_ctrl.c @@ -94,6 +94,7 @@ static unsigned int bp_power_idx = 0; static void __devexit mdm_ctrl_shutdown(struct platform_device *pdev); static void mdm_ctrl_powerup(void); static void mdm_ctrl_set_bootmode(int mode); +static void mdm_ctrl_dump_log(void); static const char *bp_status_string(unsigned int stat) { @@ -142,6 +143,8 @@ static ssize_t mdm_user_command(struct radio_dev *rdev, char *post_strip) mdm_ctrl_set_bootmode(0); } else if (strcmp(post_strip,"bootmode_flash") == 0) { mdm_ctrl_set_bootmode(1); + } else if (strcmp(post_strip,"dump_log") == 0) { + mdm_ctrl_dump_log(); } else { return -EINVAL; } @@ -550,6 +553,23 @@ static void __devexit mdm_ctrl_shutdown(struct platform_device *pdev) pr_err("%s: Modem failed to power down.", mdmctrl); } +static void mdm_ctrl_dump_log(void) +{ + pr_info("%s: Dumping modem log", mdmctrl); + + /* To implement the dump, the BP expects BP_PWRON to be asserted + * while the AP status pins remain normal. + */ + set_bp_pwron(1); + msleep(100); + set_bp_pwron(0); + + /* Allow enough time for the log to dump fully to EFS on the BP, + * so that users of this don't have to wait themselves. + */ + msleep(500); +} + static struct platform_driver mdm6x00_ctrl_driver = { .probe = mdm_ctrl_probe, .remove = __devexit_p(mdm_ctrl_remove), -- 2.34.1