summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Brown <dustinb@codeaurora.org>2016-10-26 16:56:59 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-29 15:36:55 -0700
commitbc81a471db017f1f7c82ae739c885e54cff7d5d0 (patch)
treeae2b14fb4a2ebe48ec0969d8ecfda0b5b467a80d
parent40b16627b36627d9bb46a00a4a3ed8064c65e52b (diff)
qcacld-3.0: Disable NETDEV watchdog while Unit-Test suspended
If the TX queue is unresponsive for more than a few seconds, the Linux kernel raises a NETDEV watchdog event. Normally, this should never happen and indicates a problem because Apps should be suspended and not generating TX traffic. However, during Unit-Test suspend, Apps is not suspended and these events can be safely ignored. Disable NETDEV watchdog events in this case to dramatically reduce logging volume. Change-Id: Ia0d28f64d921add065d8dce3b2d6115600f16975 CRs-Fixed: 1076495
-rw-r--r--core/hdd/inc/wlan_hdd_power.h16
-rw-r--r--core/hdd/src/wlan_hdd_power.c30
-rw-r--r--core/hdd/src/wlan_hdd_wext.c4
3 files changed, 34 insertions, 16 deletions
diff --git a/core/hdd/inc/wlan_hdd_power.h b/core/hdd/inc/wlan_hdd_power.h
index abb69bd56e66..4623d9bb6b83 100644
--- a/core/hdd/inc/wlan_hdd_power.h
+++ b/core/hdd/inc/wlan_hdd_power.h
@@ -224,26 +224,30 @@ void wlan_hdd_inc_suspend_stats(hdd_context_t *hdd_ctx,
#ifdef WLAN_SUSPEND_RESUME_TEST
/**
* hdd_wlan_fake_apps_resume() - Resume from unit-test triggered suspend
- * @wiphy: wiphy struct from a validated hdd context
+ * @wiphy: the kernel wiphy struct for the device being resumed
+ * @dev: the kernel net_device struct for the device being resumed
*
* Return: Zero on success, calls QDF_BUG() on failure
*/
-int hdd_wlan_fake_apps_resume(struct wiphy *wiphy);
+int hdd_wlan_fake_apps_resume(struct wiphy *wiphy, struct net_device *dev);
/**
* hdd_wlan_fake_apps_suspend() - Initiate a unit-test triggered suspend
- * @wiphy: wiphy struct from a validated hdd context
+ * @wiphy: the kernel wiphy struct for the device being suspended
+ * @dev: the kernel net_device struct for the device being suspended
*
* Return: Zero on success, suspend related non-zero error code on failure
*/
-int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy);
+int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy, struct net_device *dev);
#else
-static inline int hdd_wlan_fake_apps_resume(struct wiphy *wiphy)
+static inline int
+hdd_wlan_fake_apps_resume(struct wiphy *wiphy, struct net_device *dev)
{
return 0;
}
-static inline int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy)
+static inline int
+hdd_wlan_fake_apps_suspend(struct wiphy *wiphy, struct net_device *dev)
{
return 0;
}
diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c
index e555233a7b5e..bee6a6f01ba4 100644
--- a/core/hdd/src/wlan_hdd_power.c
+++ b/core/hdd/src/wlan_hdd_power.c
@@ -2430,6 +2430,7 @@ int hdd_set_qpower_config(hdd_context_t *hddctx, hdd_adapter_t *adapter,
*/
#define CE_IRQ_COUNT 12
#define CE_WAKE_IRQ 2
+static struct net_device *g_dev;
static struct wiphy *g_wiphy;
#define HDD_FA_SUSPENDED_BIT (0)
@@ -2439,11 +2440,13 @@ static unsigned long fake_apps_state;
* __hdd_wlan_fake_apps_resume() - The core logic for
* hdd_wlan_fake_apps_resume() skipping the call to hif_fake_apps_resume(),
* which is only need for non-irq resume
- * @wiphy: wiphy struct from a validated hdd context
+ * @wiphy: the kernel wiphy struct for the device being resumed
+ * @dev: the kernel net_device struct for the device being resumed
*
- * Return: Zero on success, calls QDF_BUG() on failure
+ * Return: none, calls QDF_BUG() on failure
*/
-static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy)
+static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy,
+ struct net_device *dev)
{
qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
int i, resume_err;
@@ -2469,6 +2472,8 @@ static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy)
resume_err = wlan_hdd_cfg80211_resume_wlan(wiphy);
QDF_BUG(resume_err == 0);
+
+ dev->watchdog_timeo = HDD_TX_TIMEOUT;
}
/**
@@ -2485,11 +2490,13 @@ static void hdd_wlan_fake_apps_resume_irq_callback(uint32_t val)
hdd_info("Trigger unit-test resume WLAN; val: 0x%x", val);
QDF_BUG(g_wiphy);
- __hdd_wlan_fake_apps_resume(g_wiphy);
+ QDF_BUG(g_dev);
+ __hdd_wlan_fake_apps_resume(g_wiphy, g_dev);
g_wiphy = NULL;
+ g_dev = NULL;
}
-int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy)
+int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy, struct net_device *dev)
{
qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
struct hif_opaque_softc *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
@@ -2522,10 +2529,17 @@ int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy)
/* re-enable wake irq */
pld_enable_irq(qdf_dev->dev, CE_WAKE_IRQ);
- /* pass wiphy to callback via global variable */
+ /* pass wiphy/dev to callback via global variables */
g_wiphy = wiphy;
+ g_dev = dev;
hif_fake_apps_suspend(hif_ctx, hdd_wlan_fake_apps_resume_irq_callback);
+ /*
+ * Tell the kernel not to worry if TX queues aren't moving. This is
+ * expected since we are suspending the wifi hardware, but not APPS
+ */
+ dev->watchdog_timeo = INT_MAX;
+
return 0;
enable_irqs_and_bus_resume:
@@ -2546,12 +2560,12 @@ resume_done:
return suspend_err;
}
-int hdd_wlan_fake_apps_resume(struct wiphy *wiphy)
+int hdd_wlan_fake_apps_resume(struct wiphy *wiphy, struct net_device *dev)
{
struct hif_opaque_softc *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
hif_fake_apps_resume(hif_ctx);
- __hdd_wlan_fake_apps_resume(wiphy);
+ __hdd_wlan_fake_apps_resume(wiphy, dev);
return 0;
}
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index 9beba4fc996a..720d1f504fc2 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -9883,10 +9883,10 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
ret = wlan_hdd_set_mon_chan(pAdapter, value[1], value[2]);
break;
case WE_SET_WLAN_SUSPEND:
- ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy);
+ ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy, dev);
break;
case WE_SET_WLAN_RESUME:
- ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy);
+ ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy, dev);
break;
default:
hdd_err("Invalid IOCTL command %d", sub_cmd);