summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorLingutla Chandrasekhar <clingutla@codeaurora.org>2017-06-28 13:13:16 +0530
committerLingutla Chandrasekhar <clingutla@codeaurora.org>2017-06-28 14:42:39 +0530
commitf4beb492260b44c38d0852409501eba2b5571a33 (patch)
treea9e6228ec753dc622c50d5ae0c048a478e36bad7 /drivers/power
parentbe58516a4ea44bb79784103cfe337a1e3e6f7445 (diff)
power: reset: msm: add support to select both dumps
With Minidump support enabled, user may need to request to dump both fulldump as well as minidump for debug purpose. Add support on dload_mode sysfs entry to select both dumps. Enable both dumps with command: echo both > /sys/kernel/dload/dload_mode Change-Id: I2f7c4c6e26dc236c75ab89490990c87b7139880b Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/reset/msm-poweroff.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c
index acea4f213484..e17c65c1e4e7 100644
--- a/drivers/power/reset/msm-poweroff.c
+++ b/drivers/power/reset/msm-poweroff.c
@@ -47,7 +47,7 @@
#define SCM_EDLOAD_MODE 0X01
#define SCM_DLOAD_CMD 0x10
#define SCM_DLOAD_MINIDUMP 0X20
-
+#define SCM_DLOAD_BOTHDUMPS (SCM_DLOAD_MINIDUMP | SCM_DLOAD_FULLDUMP)
static int restart_mode;
static void *restart_reason;
@@ -488,7 +488,8 @@ static ssize_t show_dload_mode(struct kobject *kobj, struct attribute *attr,
char *buf)
{
return scnprintf(buf, PAGE_SIZE, "DLOAD dump type: %s\n",
- (dload_type == SCM_DLOAD_MINIDUMP) ? "mini" : "full");
+ (dload_type == SCM_DLOAD_BOTHDUMPS) ? "both" :
+ ((dload_type == SCM_DLOAD_MINIDUMP) ? "mini" : "full"));
}
static size_t store_dload_mode(struct kobject *kobj, struct attribute *attr,
@@ -502,8 +503,16 @@ static size_t store_dload_mode(struct kobject *kobj, struct attribute *attr,
return -ENODEV;
}
dload_type = SCM_DLOAD_MINIDUMP;
- } else {
- pr_err("Invalid value. Use 'full' or 'mini'\n");
+ } else if (sysfs_streq(buf, "both")) {
+ if (!minidump_enabled) {
+ pr_err("Minidump not enabled, setting fulldump only\n");
+ dload_type = SCM_DLOAD_FULLDUMP;
+ return count;
+ }
+ dload_type = SCM_DLOAD_BOTHDUMPS;
+ } else{
+ pr_err("Invalid Dump setup request..\n");
+ pr_err("Supported dumps:'full', 'mini', or 'both'\n");
return -EINVAL;
}