Loading sound/soc/msm/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,14 @@ config SND_SOC_QDSP6V2 audio drivers. This includes q6asm, q6adm, q6afe interfaces to DSP using apr. config SND_SOC_QDSP_DEBUG bool "QDSP Audio Driver Debug Feature" help Configuration to enable debugging utilities for QDSP6 based audio drivers. One debugging utility is inducing kernel panic upon encountering critical errors from DSP audio modules config DOLBY_DAP bool "Enable Dolby DAP" depends on SND_SOC_MSM_QDSP6V2_INTF Loading sound/soc/msm/qdsp6v2/adsp_err.c +56 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ */ #include <linux/errno.h> #include <linux/uaccess.h> #include <linux/debugfs.h> #include <sound/apr_audio-v2.h> Loading Loading @@ -61,6 +63,33 @@ /* Unexpected error code. */ #define ADSP_ERR_MAX_STR "ADSP_ERR_MAX" #ifdef CONFIG_SND_SOC_QDSP_DEBUG static bool adsp_err_panic; #ifdef CONFIG_DEBUG_FS static struct dentry *debugfs_adsp_err; static ssize_t adsp_err_debug_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *ppos) { char cmd; if (copy_from_user(&cmd, ubuf, 1)) return -EFAULT; if (cmd == '0') adsp_err_panic = false; else adsp_err_panic = true; return cnt; } static const struct file_operations adsp_err_debug_ops = { .write = adsp_err_debug_write, }; #endif #endif struct adsp_err_code { int lnx_err_code; Loading Loading @@ -94,8 +123,20 @@ static struct adsp_err_code adsp_err_code_info[ADSP_ERR_MAX+1] = { { -EADV, ADSP_ERR_MAX_STR}, }; #ifdef CONFIG_SND_SOC_QDSP_DEBUG static inline void adsp_err_check_panic(u32 adsp_error) { if (adsp_err_panic && adsp_error != ADSP_EALREADY) panic("%s: encounter adsp_err=0x%x\n", __func__, adsp_error); } #else static inline void adsp_err_check_panic(u32 adsp_error) {} #endif int adsp_err_get_lnx_err_code(u32 adsp_error) { adsp_err_check_panic(adsp_error); if (adsp_error > ADSP_ERR_MAX) return adsp_err_code_info[ADSP_ERR_MAX].lnx_err_code; else Loading @@ -109,3 +150,18 @@ char *adsp_err_get_err_str(u32 adsp_error) else return adsp_err_code_info[adsp_error].adsp_err_str; } #if defined(CONFIG_SND_SOC_QDSP_DEBUG) && defined(CONFIG_DEBUG_FS) static int __init adsp_err_init(void) { debugfs_adsp_err = debugfs_create_file("msm_adsp_audio_debug", S_IFREG | S_IRUGO, NULL, NULL, &adsp_err_debug_ops); return 0; } device_initcall(adsp_err_init); #endif Loading
sound/soc/msm/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,14 @@ config SND_SOC_QDSP6V2 audio drivers. This includes q6asm, q6adm, q6afe interfaces to DSP using apr. config SND_SOC_QDSP_DEBUG bool "QDSP Audio Driver Debug Feature" help Configuration to enable debugging utilities for QDSP6 based audio drivers. One debugging utility is inducing kernel panic upon encountering critical errors from DSP audio modules config DOLBY_DAP bool "Enable Dolby DAP" depends on SND_SOC_MSM_QDSP6V2_INTF Loading
sound/soc/msm/qdsp6v2/adsp_err.c +56 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ */ #include <linux/errno.h> #include <linux/uaccess.h> #include <linux/debugfs.h> #include <sound/apr_audio-v2.h> Loading Loading @@ -61,6 +63,33 @@ /* Unexpected error code. */ #define ADSP_ERR_MAX_STR "ADSP_ERR_MAX" #ifdef CONFIG_SND_SOC_QDSP_DEBUG static bool adsp_err_panic; #ifdef CONFIG_DEBUG_FS static struct dentry *debugfs_adsp_err; static ssize_t adsp_err_debug_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *ppos) { char cmd; if (copy_from_user(&cmd, ubuf, 1)) return -EFAULT; if (cmd == '0') adsp_err_panic = false; else adsp_err_panic = true; return cnt; } static const struct file_operations adsp_err_debug_ops = { .write = adsp_err_debug_write, }; #endif #endif struct adsp_err_code { int lnx_err_code; Loading Loading @@ -94,8 +123,20 @@ static struct adsp_err_code adsp_err_code_info[ADSP_ERR_MAX+1] = { { -EADV, ADSP_ERR_MAX_STR}, }; #ifdef CONFIG_SND_SOC_QDSP_DEBUG static inline void adsp_err_check_panic(u32 adsp_error) { if (adsp_err_panic && adsp_error != ADSP_EALREADY) panic("%s: encounter adsp_err=0x%x\n", __func__, adsp_error); } #else static inline void adsp_err_check_panic(u32 adsp_error) {} #endif int adsp_err_get_lnx_err_code(u32 adsp_error) { adsp_err_check_panic(adsp_error); if (adsp_error > ADSP_ERR_MAX) return adsp_err_code_info[ADSP_ERR_MAX].lnx_err_code; else Loading @@ -109,3 +150,18 @@ char *adsp_err_get_err_str(u32 adsp_error) else return adsp_err_code_info[adsp_error].adsp_err_str; } #if defined(CONFIG_SND_SOC_QDSP_DEBUG) && defined(CONFIG_DEBUG_FS) static int __init adsp_err_init(void) { debugfs_adsp_err = debugfs_create_file("msm_adsp_audio_debug", S_IFREG | S_IRUGO, NULL, NULL, &adsp_err_debug_ops); return 0; } device_initcall(adsp_err_init); #endif