From dba06ca031bcd564b51dcb66807680dbad0b3756 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 22 Dec 2016 15:25:33 -0800 Subject: qcacld-3.0: Improve bus suspend/resume logging Many branches in the bus suspend/resume code path are missing appropriate logging. Add error logging for failure cases, and info logging for enter/exit points. Change-Id: Ia1d82e2a3d48335b31772a0fa7532ec99c08de4d CRs-Fixed: 1104790 --- core/hdd/src/wlan_hdd_driver_ops.c | 54 +++++++++++++++++++++++++++----------- core/hdd/src/wlan_hdd_power.c | 3 +++ 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index a3686133c6c7..332bb3531005 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -512,38 +512,49 @@ static int __wlan_hdd_bus_suspend(pm_message_t state, uint32_t wow_flags) { hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); void *hif_ctx; - int err = wlan_hdd_validate_context(hdd_ctx); + int err; int status; - hdd_info("event %d", state.event); + hdd_info("starting bus suspend; event:%d, flags:%u", + state.event, wow_flags); - if (err) + err = wlan_hdd_validate_context(hdd_ctx); + if (err) { + hdd_err("Invalid hdd context"); goto done; + } if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) { - hdd_info("Driver Module closed return success"); + hdd_info("Driver Module closed; return success"); return 0; } hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); if (NULL == hif_ctx) { + hdd_err("Failed to get hif context"); err = -EINVAL; goto done; } err = qdf_status_to_os_return(ol_txrx_bus_suspend()); - if (err) + if (err) { + hdd_err("Failed tx/rx bus suspend"); goto done; + } err = wma_bus_suspend(wow_flags); - if (err) + if (err) { + hdd_err("Failed wma bus suspend"); goto resume_oltxrx; + } err = hif_bus_suspend(hif_ctx); - if (err) + if (err) { + hdd_err("Failed hif bus suspend"); goto resume_wma; + } - hdd_info("suspend done"); + hdd_info("bus suspend succeeded"); return 0; resume_wma: @@ -676,34 +687,45 @@ static int __wlan_hdd_bus_resume(void) if (cds_is_driver_recovering()) return 0; + hdd_info("starting bus resume"); + status = wlan_hdd_validate_context(hdd_ctx); - if (status) + if (status) { + hdd_err("Invalid hdd context"); return status; + } if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) { - hdd_info("Driver Module closed return success"); + hdd_info("Driver Module closed; return success"); return 0; } hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); - if (NULL == hif_ctx) + if (NULL == hif_ctx) { + hdd_err("Failed to get hif context"); return -EINVAL; + } status = hif_bus_resume(hif_ctx); - if (status) + if (status) { + hdd_err("Failed hif bus resume"); goto out; + } status = wma_bus_resume(); - if (status) + if (status) { + hdd_err("Failed wma bus resume"); goto out; + } qdf_status = ol_txrx_bus_resume(); status = qdf_status_to_os_return(qdf_status); - if (status) + if (status) { + hdd_err("Failed tx/rx bus resume"); goto out; + } - hdd_info("resume done"); - + hdd_info("bus resume succeeded"); return 0; out: diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 9576503586c3..2936eb4b6536 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -2493,6 +2493,8 @@ static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy, QDF_BUG(resume_err == 0); dev->watchdog_timeo = HDD_TX_TIMEOUT; + + hdd_info("Unit-test resume succeeded"); } /** @@ -2559,6 +2561,7 @@ int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy, struct net_device *dev) */ dev->watchdog_timeo = INT_MAX; + hdd_info("Unit-test suspend succeeded"); return 0; enable_irqs_and_bus_resume: -- cgit v1.2.3