Loading dsp/q6lsm.c +30 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2013-2020, Linux Foundation. All rights reserved. * Copyright (c) 2013-2021, Linux Foundation. All rights reserved. */ #include <linux/fs.h> #include <linux/mutex.h> Loading Loading @@ -63,6 +63,12 @@ struct lsm_common { struct cal_type_data *cal_data[LSM_MAX_CAL_IDX]; struct mutex apr_lock; #ifdef CONFIG_DEBUG_FS /* Debugfs related */ struct dentry *entry; bool panic_on_timeout; #endif }; static struct lsm_common lsm_common; Loading Loading @@ -508,6 +514,13 @@ static int q6lsm_apr_send_pkt(struct lsm_client *client, void *handle, __func__, msg_hdr->opcode, msg_hdr->pkt_size); /* ret = 0 means wait timed out */ ret = -ETIMEDOUT; #ifdef CONFIG_DEBUG_FS /* * If panic_on_timeout flag is explicitly set through the debugfs, * then trigger a device crash here to aid debugging. */ BUG_ON(lsm_common.panic_on_timeout); #endif } } else { ret = 0; Loading Loading @@ -3071,10 +3084,26 @@ int __init q6lsm_init(void) if (q6lsm_init_cal_data()) pr_err("%s: could not init cal data!\n", __func__); #ifdef CONFIG_DEBUG_FS lsm_common.entry = debugfs_create_dir("q6lsm_apr", NULL); if (!IS_ERR_OR_NULL(lsm_common.entry)) { if (IS_ERR(debugfs_create_bool("panic_on_timeout", 0644, lsm_common.entry, &lsm_common.panic_on_timeout))) lsm_common.panic_on_timeout = false; else pr_info("%s: panic_on_timeout debugfs flag is created\n", __func__); } #endif return 0; } void q6lsm_exit(void) { lsm_delete_cal_data(); #ifdef CONFIG_DEBUG_FS debugfs_remove_recursive(lsm_common.entry); lsm_common.entry = NULL; #endif } Loading
dsp/q6lsm.c +30 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2013-2020, Linux Foundation. All rights reserved. * Copyright (c) 2013-2021, Linux Foundation. All rights reserved. */ #include <linux/fs.h> #include <linux/mutex.h> Loading Loading @@ -63,6 +63,12 @@ struct lsm_common { struct cal_type_data *cal_data[LSM_MAX_CAL_IDX]; struct mutex apr_lock; #ifdef CONFIG_DEBUG_FS /* Debugfs related */ struct dentry *entry; bool panic_on_timeout; #endif }; static struct lsm_common lsm_common; Loading Loading @@ -508,6 +514,13 @@ static int q6lsm_apr_send_pkt(struct lsm_client *client, void *handle, __func__, msg_hdr->opcode, msg_hdr->pkt_size); /* ret = 0 means wait timed out */ ret = -ETIMEDOUT; #ifdef CONFIG_DEBUG_FS /* * If panic_on_timeout flag is explicitly set through the debugfs, * then trigger a device crash here to aid debugging. */ BUG_ON(lsm_common.panic_on_timeout); #endif } } else { ret = 0; Loading Loading @@ -3071,10 +3084,26 @@ int __init q6lsm_init(void) if (q6lsm_init_cal_data()) pr_err("%s: could not init cal data!\n", __func__); #ifdef CONFIG_DEBUG_FS lsm_common.entry = debugfs_create_dir("q6lsm_apr", NULL); if (!IS_ERR_OR_NULL(lsm_common.entry)) { if (IS_ERR(debugfs_create_bool("panic_on_timeout", 0644, lsm_common.entry, &lsm_common.panic_on_timeout))) lsm_common.panic_on_timeout = false; else pr_info("%s: panic_on_timeout debugfs flag is created\n", __func__); } #endif return 0; } void q6lsm_exit(void) { lsm_delete_cal_data(); #ifdef CONFIG_DEBUG_FS debugfs_remove_recursive(lsm_common.entry); lsm_common.entry = NULL; #endif }