Loading drivers/soc/qcom/bgcom_interface.c +16 −1 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -95,6 +95,7 @@ static dev_t bg_dev; static int device_open; static void *handle; static bool twm_exit; static bool bg_app_running; static struct bgcom_open_config_type config_type; static DECLARE_COMPLETION(bg_modem_down_wait); Loading Loading @@ -381,6 +382,10 @@ static long bg_com_ioctl(struct file *filp, twm_exit = true; ret = 0; break; case BG_APP_RUNNING: bg_app_running = true; ret = 0; break; default: ret = -ENOIOCTLCMD; } Loading Loading @@ -590,6 +595,16 @@ bool is_twm_exit(void) } EXPORT_SYMBOL(is_twm_exit); bool is_bg_running(void) { if (bg_app_running) { bg_app_running = false; return true; } return false; } EXPORT_SYMBOL(is_bg_running); static struct notifier_block ssr_modem_nb = { .notifier_call = ssr_modem_cb, .priority = 0, Loading drivers/soc/qcom/bgcom_interface.h +8 −1 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -26,4 +26,11 @@ int bg_soft_reset(void); */ bool is_twm_exit(void); /* * is_bg_running() * Return true if bg is running. * value is auto cleared once read. */ bool is_bg_running(void); #endif /* BGCOM_INTERFACE_H */ drivers/soc/qcom/subsys-pil-bg.c +5 −0 Original line number Diff line number Diff line Loading @@ -271,6 +271,11 @@ static int bg_powerup(const struct subsys_desc *subsys) struct pil_bg_data *bg_data = subsys_to_data(subsys); int ret; if (is_bg_running()) { pr_debug("bg is already up\n"); return 0; } init_completion(&bg_data->err_ready); if (!bg_data->qseecom_handle) { ret = pil_load_bg_tzapp(bg_data); Loading include/uapi/linux/bgcom_interface.h +5 −1 Original line number Diff line number Diff line /* Copyright (c) 2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2018-2019, 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 @@ -20,6 +20,7 @@ #define BGCOM_SOFT_RESET 6 #define BGCOM_MODEM_DOWN2_BG 7 #define BGCOM_TWM_EXIT 8 #define BGCOM_BG_APP_RUNNING 9 #define EXCHANGE_CODE 'V' struct bg_ui_data { Loading Loading @@ -61,6 +62,9 @@ enum bg_event_type { #define BG_TWM_EXIT \ _IOWR(EXCHANGE_CODE, BGCOM_TWM_EXIT, \ struct bg_ui_data) #define BG_APP_RUNNING \ _IOWR(EXCHANGE_CODE, BGCOM_BG_APP_RUNNING, \ struct bg_ui_data) #define BG_MODEM_DOWN2_BG_DONE \ _IOWR(EXCHANGE_CODE, BGCOM_MODEM_DOWN2_BG, \ struct bg_ui_data) Loading Loading
drivers/soc/qcom/bgcom_interface.c +16 −1 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -95,6 +95,7 @@ static dev_t bg_dev; static int device_open; static void *handle; static bool twm_exit; static bool bg_app_running; static struct bgcom_open_config_type config_type; static DECLARE_COMPLETION(bg_modem_down_wait); Loading Loading @@ -381,6 +382,10 @@ static long bg_com_ioctl(struct file *filp, twm_exit = true; ret = 0; break; case BG_APP_RUNNING: bg_app_running = true; ret = 0; break; default: ret = -ENOIOCTLCMD; } Loading Loading @@ -590,6 +595,16 @@ bool is_twm_exit(void) } EXPORT_SYMBOL(is_twm_exit); bool is_bg_running(void) { if (bg_app_running) { bg_app_running = false; return true; } return false; } EXPORT_SYMBOL(is_bg_running); static struct notifier_block ssr_modem_nb = { .notifier_call = ssr_modem_cb, .priority = 0, Loading
drivers/soc/qcom/bgcom_interface.h +8 −1 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -26,4 +26,11 @@ int bg_soft_reset(void); */ bool is_twm_exit(void); /* * is_bg_running() * Return true if bg is running. * value is auto cleared once read. */ bool is_bg_running(void); #endif /* BGCOM_INTERFACE_H */
drivers/soc/qcom/subsys-pil-bg.c +5 −0 Original line number Diff line number Diff line Loading @@ -271,6 +271,11 @@ static int bg_powerup(const struct subsys_desc *subsys) struct pil_bg_data *bg_data = subsys_to_data(subsys); int ret; if (is_bg_running()) { pr_debug("bg is already up\n"); return 0; } init_completion(&bg_data->err_ready); if (!bg_data->qseecom_handle) { ret = pil_load_bg_tzapp(bg_data); Loading
include/uapi/linux/bgcom_interface.h +5 −1 Original line number Diff line number Diff line /* Copyright (c) 2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2018-2019, 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 @@ -20,6 +20,7 @@ #define BGCOM_SOFT_RESET 6 #define BGCOM_MODEM_DOWN2_BG 7 #define BGCOM_TWM_EXIT 8 #define BGCOM_BG_APP_RUNNING 9 #define EXCHANGE_CODE 'V' struct bg_ui_data { Loading Loading @@ -61,6 +62,9 @@ enum bg_event_type { #define BG_TWM_EXIT \ _IOWR(EXCHANGE_CODE, BGCOM_TWM_EXIT, \ struct bg_ui_data) #define BG_APP_RUNNING \ _IOWR(EXCHANGE_CODE, BGCOM_BG_APP_RUNNING, \ struct bg_ui_data) #define BG_MODEM_DOWN2_BG_DONE \ _IOWR(EXCHANGE_CODE, BGCOM_MODEM_DOWN2_BG, \ struct bg_ui_data) Loading