Message ID | 1556788021-6531-2-git-send-email-sgruszka@redhat.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Kalle Valo |
Headers | show |
Series | rt2800: add experimental watchdog implementation | expand |
Stanislaw Gruszka <sgruszka@redhat.com> wrote: > Allow subdriver to change watchdog interval by intialize > link->watchdog_interval value before rt2x00link_register(). > > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Failed to apply: fatal: sha1 information is lacking or useless (drivers/net/wireless/ralink/rt2x00/rt2800lib.c). error: could not build fake ancestor Applying: rt2800: initial watchdog implementation Patch failed at 0001 rt2800: initial watchdog implementation The copy of the patch that failed is found in: .git/rebase-apply/patch 7 patches set to Changes Requested. 10926395 [1/7] rt2x00: allow to specify watchdog interval 10926397 [2/7] rt2800: add helpers for reading dma done index 10926401 [3/7] rt2800: initial watchdog implementation 10926403 [4/7] rt2800: add pre_reset_hw callback 10926405 [5/7] rt2800: do not nullify initialization vector data 10926407 [6/7] rt2x00: add restart hw 10926409 [7/7] rt2800: do not enable watchdog by default
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h index 4b1744e9fb78..a241efa0a4f5 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h @@ -336,6 +336,7 @@ struct link { * to bring the device/driver back into the desired state. */ struct delayed_work watchdog_work; + unsigned int watchdog_interval; /* * Work structure for scheduling periodic AGC adjustments. diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00link.c b/drivers/net/wireless/ralink/rt2x00/rt2x00link.c index 2010a7715f21..fcc59553918f 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00link.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00link.c @@ -398,7 +398,7 @@ void rt2x00link_start_watchdog(struct rt2x00_dev *rt2x00dev) rt2x00dev->ops->lib->watchdog) ieee80211_queue_delayed_work(rt2x00dev->hw, &link->watchdog_work, - WATCHDOG_INTERVAL); + link->watchdog_interval); } void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev) @@ -424,11 +424,16 @@ static void rt2x00link_watchdog(struct work_struct *work) if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) ieee80211_queue_delayed_work(rt2x00dev->hw, &link->watchdog_work, - WATCHDOG_INTERVAL); + link->watchdog_interval); } void rt2x00link_register(struct rt2x00_dev *rt2x00dev) { - INIT_DELAYED_WORK(&rt2x00dev->link.watchdog_work, rt2x00link_watchdog); - INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00link_tuner); + struct link *link = &rt2x00dev->link; + + INIT_DELAYED_WORK(&link->work, rt2x00link_tuner); + INIT_DELAYED_WORK(&link->watchdog_work, rt2x00link_watchdog); + + if (link->watchdog_interval == 0) + link->watchdog_interval = WATCHDOG_INTERVAL; }
Allow subdriver to change watchdog interval by intialize link->watchdog_interval value before rt2x00link_register(). Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> --- drivers/net/wireless/ralink/rt2x00/rt2x00.h | 1 + drivers/net/wireless/ralink/rt2x00/rt2x00link.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)