Commit 0f47aeea authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Kalle Valo

rt2800: do not enable watchdog by default

Make watchdog disabled by default and add module parameter to enable it.

User will have to create file in /etc/modprobe.d/ with

options rt2800lib watchdog=1

to enable the watchdog or load "rt2800lib watchdog=1" module manually
before loading rt2800{soc,pci,usb} module.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent e403fa31
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
#include "rt2800lib.h" #include "rt2800lib.h"
#include "rt2800.h" #include "rt2800.h"
static bool modparam_watchdog;
module_param_named(watchdog, modparam_watchdog, bool, S_IRUGO);
MODULE_PARM_DESC(watchdog, "Enable watchdog to detect tx/rx hangs and reset hardware if detected");
/* /*
* Register access. * Register access.
* All access to the CSR registers will go through the methods * All access to the CSR registers will go through the methods
...@@ -10286,8 +10290,12 @@ int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) ...@@ -10286,8 +10290,12 @@ int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
__set_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags); __set_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags);
} }
__set_bit(CAPABILITY_RESTART_HW, &rt2x00dev->cap_flags); if (modparam_watchdog) {
rt2x00dev->link.watchdog_interval = msecs_to_jiffies(100); __set_bit(CAPABILITY_RESTART_HW, &rt2x00dev->cap_flags);
rt2x00dev->link.watchdog_interval = msecs_to_jiffies(100);
} else {
rt2x00dev->link.watchdog_disabled = true;
}
/* /*
* Set the rssi offset. * Set the rssi offset.
......
...@@ -326,6 +326,7 @@ struct link { ...@@ -326,6 +326,7 @@ struct link {
*/ */
struct delayed_work watchdog_work; struct delayed_work watchdog_work;
unsigned int watchdog_interval; unsigned int watchdog_interval;
bool watchdog_disabled;
/* /*
* Work structure for scheduling periodic AGC adjustments. * Work structure for scheduling periodic AGC adjustments.
......
...@@ -384,7 +384,7 @@ void rt2x00link_start_watchdog(struct rt2x00_dev *rt2x00dev) ...@@ -384,7 +384,7 @@ void rt2x00link_start_watchdog(struct rt2x00_dev *rt2x00dev)
struct link *link = &rt2x00dev->link; struct link *link = &rt2x00dev->link;
if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) && if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) &&
rt2x00dev->ops->lib->watchdog) rt2x00dev->ops->lib->watchdog && !link->watchdog_disabled)
ieee80211_queue_delayed_work(rt2x00dev->hw, ieee80211_queue_delayed_work(rt2x00dev->hw,
&link->watchdog_work, &link->watchdog_work,
link->watchdog_interval); link->watchdog_interval);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment