From 207286b118d58d5322aca4a941bf33d1863a5697 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Fri, 22 Feb 2019 10:52:33 -0800 Subject: [PATCH] qcacld-3.0: Provide reason to QDF_DEBUG_PANIC() A common pattern in WLAN to panic the driver is to log the reason and then unconditionally panic. QDF_DEBUG_PANIC() takes a reason string to help make the reason for the panic more obvious, but it is not always used. Ensure all callers of QDF_DEBUG_PANIC() provide a reason string. Change-Id: I3d23a8980adaeaa1a9798a4a6b0fba1f36eb52ad CRs-Fixed: 2403829 --- components/dsc/test/wlan_dsc_test.c | 4 ++-- core/dp/txrx3.0/dp_rx_thread.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/components/dsc/test/wlan_dsc_test.c b/components/dsc/test/wlan_dsc_test.c index 9420f2afc8..dd9f286039 100644 --- a/components/dsc/test/wlan_dsc_test.c +++ b/components/dsc/test/wlan_dsc_test.c @@ -51,7 +51,7 @@ static struct dsc_psoc *nth_psoc(struct dsc_driver *driver, int n) return psoc; } - QDF_DEBUG_PANIC(); + QDF_DEBUG_PANIC("Failed to find nth psoc: %d", n); return NULL; } @@ -72,7 +72,7 @@ static struct dsc_vdev *nth_vdev(struct dsc_psoc *psoc, int n) return vdev; } - QDF_DEBUG_PANIC(); + QDF_DEBUG_PANIC("Failed to find nth vdev: %d", n); return NULL; } diff --git a/core/dp/txrx3.0/dp_rx_thread.c b/core/dp/txrx3.0/dp_rx_thread.c index fddd234165..ae42f3a713 100644 --- a/core/dp/txrx3.0/dp_rx_thread.c +++ b/core/dp/txrx3.0/dp_rx_thread.c @@ -402,8 +402,7 @@ static int dp_rx_thread_loop(void *arg) dp_debug("woken up"); if (status == -ERESTARTSYS) { - dp_err("wait_event_interruptible returned -ERESTARTSYS"); - QDF_DEBUG_PANIC(); + QDF_DEBUG_PANIC("wait_event_interruptible returned -ERESTARTSYS"); break; } qdf_atomic_clear_bit(RX_POST_EVENT, &rx_thread->event_flag); @@ -428,8 +427,8 @@ static int dp_rx_thread_loop(void *arg) */ static int dp_rx_tm_thread_napi_poll(struct napi_struct *napi, int budget) { - dp_err("this napi_poll should not be polled as we don't schedule it"); - QDF_BUG(0); + QDF_DEBUG_PANIC("this napi_poll should not be polled as we don't schedule it"); + return 0; }