* So the SDI cannot be re-enabled when it already by-passed.
*/
+static int in_panic;
+
+static int panic_prep_restart(struct notifier_block *this,
+ unsigned long event, void *ptr)
+{
+ in_panic = 1;
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block panic_blk = {
+ .notifier_call = panic_prep_restart,
+};
+
#ifdef CONFIG_QCOM_DLOAD_MODE
#define EDL_MODE_PROP "qcom,msm-imem-emergency_download_mode"
#define DL_MODE_PROP "qcom,msm-imem-download_mode"
#define KASLR_OFFSET_PROP "qcom,msm-imem-kaslr_offset"
#endif
-static int in_panic;
static int dload_type = SCM_DLOAD_FULLDUMP;
static int download_mode = 1;
static struct kobject dload_kobj;
module_param_call(download_mode, dload_set, param_get_int,
&download_mode, 0644);
-static int panic_prep_restart(struct notifier_block *this,
- unsigned long event, void *ptr)
-{
- in_panic = 1;
- return NOTIFY_DONE;
-}
-
-static struct notifier_block panic_blk = {
- .notifier_call = panic_prep_restart,
-};
-
int scm_set_dload_mode(int arg1, int arg2)
{
struct scm_desc desc = {
struct device_node *np;
int ret = 0;
+ atomic_notifier_chain_register(&panic_notifier_list, &panic_blk);
+
#ifdef CONFIG_QCOM_DLOAD_MODE
if (scm_is_call_available(SCM_SVC_BOOT, SCM_DLOAD_CMD) > 0)
scm_dload_supported = true;
- atomic_notifier_chain_register(&panic_notifier_list, &panic_blk);
np = of_find_compatible_node(NULL, NULL, DL_MODE_PROP);
if (!np) {
pr_err("unable to find DT imem DLOAD mode node\n");