Loading drivers/soc/qcom/sysmon-qmi.c +9 −3 Original line number Diff line number Diff line /* * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -88,6 +88,7 @@ static void sysmon_clnt_svc_arrive(struct work_struct *work); static void sysmon_clnt_svc_exit(struct work_struct *work); static const int notif_map[SUBSYS_NOTIF_TYPE_COUNT] = { [0 ... SUBSYS_NOTIF_TYPE_COUNT - 1] = SSCTL_SSR_EVENT_INVALID, [SUBSYS_BEFORE_POWERUP] = SSCTL_SSR_EVENT_BEFORE_POWERUP, [SUBSYS_AFTER_POWERUP] = SSCTL_SSR_EVENT_AFTER_POWERUP, [SUBSYS_BEFORE_SHUTDOWN] = SSCTL_SSR_EVENT_BEFORE_SHUTDOWN, Loading Loading @@ -147,6 +148,11 @@ static void sysmon_clnt_notify(struct qmi_handle *handle, } } static bool is_ssctl_event(enum subsys_notif_type notif) { return notif_map[notif] != SSCTL_SSR_EVENT_INVALID; } static void sysmon_clnt_svc_arrive(struct work_struct *work) { int rc; Loading Loading @@ -318,8 +324,8 @@ int sysmon_send_event(struct subsys_desc *dest_desc, const char *dest_ss = dest_desc->name; int ret; if (notif < 0 || notif >= SUBSYS_NOTIF_TYPE_COUNT || event_ss == NULL || dest_ss == NULL) if (notif < 0 || notif >= SUBSYS_NOTIF_TYPE_COUNT || !is_ssctl_event(notif) || event_ss == NULL || dest_ss == NULL) return -EINVAL; mutex_lock(&sysmon_list_lock); Loading include/soc/qcom/sysmon.h +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ enum subsys_id { */ enum ssctl_ssr_event_enum_type { SSCTL_SSR_EVENT_ENUM_TYPE_MIN_ENUM_VAL = -2147483647, SSCTL_SSR_EVENT_INVALID = -1, SSCTL_SSR_EVENT_BEFORE_POWERUP = 0, SSCTL_SSR_EVENT_AFTER_POWERUP = 1, SSCTL_SSR_EVENT_BEFORE_SHUTDOWN = 2, Loading Loading
drivers/soc/qcom/sysmon-qmi.c +9 −3 Original line number Diff line number Diff line /* * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -88,6 +88,7 @@ static void sysmon_clnt_svc_arrive(struct work_struct *work); static void sysmon_clnt_svc_exit(struct work_struct *work); static const int notif_map[SUBSYS_NOTIF_TYPE_COUNT] = { [0 ... SUBSYS_NOTIF_TYPE_COUNT - 1] = SSCTL_SSR_EVENT_INVALID, [SUBSYS_BEFORE_POWERUP] = SSCTL_SSR_EVENT_BEFORE_POWERUP, [SUBSYS_AFTER_POWERUP] = SSCTL_SSR_EVENT_AFTER_POWERUP, [SUBSYS_BEFORE_SHUTDOWN] = SSCTL_SSR_EVENT_BEFORE_SHUTDOWN, Loading Loading @@ -147,6 +148,11 @@ static void sysmon_clnt_notify(struct qmi_handle *handle, } } static bool is_ssctl_event(enum subsys_notif_type notif) { return notif_map[notif] != SSCTL_SSR_EVENT_INVALID; } static void sysmon_clnt_svc_arrive(struct work_struct *work) { int rc; Loading Loading @@ -318,8 +324,8 @@ int sysmon_send_event(struct subsys_desc *dest_desc, const char *dest_ss = dest_desc->name; int ret; if (notif < 0 || notif >= SUBSYS_NOTIF_TYPE_COUNT || event_ss == NULL || dest_ss == NULL) if (notif < 0 || notif >= SUBSYS_NOTIF_TYPE_COUNT || !is_ssctl_event(notif) || event_ss == NULL || dest_ss == NULL) return -EINVAL; mutex_lock(&sysmon_list_lock); Loading
include/soc/qcom/sysmon.h +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ enum subsys_id { */ enum ssctl_ssr_event_enum_type { SSCTL_SSR_EVENT_ENUM_TYPE_MIN_ENUM_VAL = -2147483647, SSCTL_SSR_EVENT_INVALID = -1, SSCTL_SSR_EVENT_BEFORE_POWERUP = 0, SSCTL_SSR_EVENT_AFTER_POWERUP = 1, SSCTL_SSR_EVENT_BEFORE_SHUTDOWN = 2, Loading