From 3c3d94424674b2a91e34e09359770dbd8a1b22eb Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Mon, 15 Feb 2021 22:24:16 +0530 Subject: [PATCH] qcacmn: Enhance error signature in qdf_check_state_before_panic Improve error signature in qdf_check_state_before_panic API. Change-Id: I5774c07e9359b711f0863c40072962b802318f2f CRs-Fixed: 2879026 --- hal/wifi3.0/hal_api.h | 12 ++++++------ qdf/inc/qdf_platform.h | 6 ++++-- qdf/src/qdf_platform.c | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/hal/wifi3.0/hal_api.h b/hal/wifi3.0/hal_api.h index 2a46200ff7..b2d2cf3159 100644 --- a/hal/wifi3.0/hal_api.h +++ b/hal/wifi3.0/hal_api.h @@ -290,7 +290,7 @@ static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset, ret = hif_force_wake_request(hal_soc->hif_handle); if (ret) { hal_err_rl("Wake up request failed"); - qdf_check_state_before_panic(); + qdf_check_state_before_panic(__func__, __LINE__); return; } } @@ -315,7 +315,7 @@ static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset, ret = hif_force_wake_release(hal_soc->hif_handle); if (ret) { hal_err("Wake up release failed"); - qdf_check_state_before_panic(); + qdf_check_state_before_panic(__func__, __LINE__); return; } } @@ -350,7 +350,7 @@ static inline void hal_write32_mb_confirm(struct hal_soc *hal_soc, ret = hif_force_wake_request(hal_soc->hif_handle); if (ret) { hal_err("Wake up request failed"); - qdf_check_state_before_panic(); + qdf_check_state_before_panic(__func__, __LINE__); return; } } @@ -385,7 +385,7 @@ static inline void hal_write32_mb_confirm(struct hal_soc *hal_soc, ret = hif_force_wake_release(hal_soc->hif_handle); if (ret) { hal_err("Wake up release failed"); - qdf_check_state_before_panic(); + qdf_check_state_before_panic(__func__, __LINE__); return; } } @@ -538,7 +538,7 @@ uint32_t hal_read32_mb(struct hal_soc *hal_soc, uint32_t offset) if ((!hal_soc->init_phase) && hif_force_wake_request(hal_soc->hif_handle)) { hal_err("Wake up request failed"); - qdf_check_state_before_panic(); + qdf_check_state_before_panic(__func__, __LINE__); return 0; } @@ -561,7 +561,7 @@ uint32_t hal_read32_mb(struct hal_soc *hal_soc, uint32_t offset) if ((!hal_soc->init_phase) && hif_force_wake_release(hal_soc->hif_handle)) { hal_err("Wake up release failed"); - qdf_check_state_before_panic(); + qdf_check_state_before_panic(__func__, __LINE__); return 0; } diff --git a/qdf/inc/qdf_platform.h b/qdf/inc/qdf_platform.h index 36e738eb00..43c471b3ad 100644 --- a/qdf/inc/qdf_platform.h +++ b/qdf/inc/qdf_platform.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -250,10 +250,12 @@ void qdf_register_drv_connected_callback(qdf_is_drv_connected_callback /** * qdf_check_state_before_panic() - API to check if FW is down * or driver is in recovery before calling assert + * @func: Caller function pointer used for debug info + * @line: Caller function line number * * Return: none */ -void qdf_check_state_before_panic(void); +void qdf_check_state_before_panic(const char *func, const uint32_t line); /** * qdf_is_drv_supported_callback() - callback to query if drv is supported diff --git a/qdf/src/qdf_platform.c b/qdf/src/qdf_platform.c index f1e486da74..5d3f68be51 100644 --- a/qdf/src/qdf_platform.c +++ b/qdf/src/qdf_platform.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -172,10 +172,10 @@ bool qdf_is_drv_connected(void) } qdf_export_symbol(qdf_is_drv_connected); -void qdf_check_state_before_panic(void) +void qdf_check_state_before_panic(const char *func, const uint32_t line) { if (!qdf_is_recovering() && !qdf_is_fw_down()) - QDF_BUG(0); + QDF_DEBUG_PANIC_FL(func, line, ""); } qdf_export_symbol(qdf_check_state_before_panic);