diff options
author | Daniel Golle <daniel@makrotopia.org> | 2019-11-05 10:48:53 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2019-11-05 10:54:05 +0100 |
commit | 439ac8104bf68b4843b94e9848a33f99ee5a3085 (patch) | |
tree | 106d297857bbe986d10f01a57799be2d77f71c0e /package/kernel/mac80211/patches/rt2x00/062-rt2800-initial-watchdog-implementation.patch | |
parent | d6d9f582907630c77309a13a42781010adfff441 (diff) | |
download | upstream-439ac8104bf68b4843b94e9848a33f99ee5a3085.tar.gz upstream-439ac8104bf68b4843b94e9848a33f99ee5a3085.tar.bz2 upstream-439ac8104bf68b4843b94e9848a33f99ee5a3085.zip |
mac80211: rt2x00: backport upstream patches
Import patches from upstream to sync 19.07 with master:
9f3e3323e996 rt2x00: allow to specify watchdog interval
2034afe4db4a rt2800: add helpers for reading dma done index
759c5b599cf4 rt2800: initial watchdog implementation
09db3b000619 rt2800: add pre_reset_hw callback
710e6cc1595e rt2800: do not nullify initialization vector data
e403fa31ed71 rt2x00: add restart hw
0f47aeeada2a rt2800: do not enable watchdog by default
41a531ffa4c5 rt2x00usb: fix rx queue hang
3b902fa811cf rt2x00usb: remove unnecessary rx flag checks
1dc244064c47 rt2x00: no need to check return value of debugfs_create functions
706f0182b1ad rt2800usb: Add new rt2800usb device PLANEX GW-USMicroN
95844124385e rt2x00: clear IV's on start to fix AP mode regression
567a9b766b47 rt2x00: do not set IEEE80211_TX_STAT_AMPDU_NO_BACK on tx status
14d5e14c8a6c rt2x00: clear up IV's on key removal
13fa451568ab Revert "rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band"
--pending-- rt2800: remove errornous duplicate condition
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/kernel/mac80211/patches/rt2x00/062-rt2800-initial-watchdog-implementation.patch')
-rw-r--r-- | package/kernel/mac80211/patches/rt2x00/062-rt2800-initial-watchdog-implementation.patch | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/rt2x00/062-rt2800-initial-watchdog-implementation.patch b/package/kernel/mac80211/patches/rt2x00/062-rt2800-initial-watchdog-implementation.patch new file mode 100644 index 0000000000..24032b534b --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/062-rt2800-initial-watchdog-implementation.patch @@ -0,0 +1,158 @@ +From 759c5b599cf4ddb3b56e66d459b1bf0fe2724fb8 Mon Sep 17 00:00:00 2001 +From: Stanislaw Gruszka <sgruszka@redhat.com> +Date: Sat, 15 Jun 2019 12:00:56 +0200 +Subject: [PATCH 03/15] rt2800: initial watchdog implementation + +Add watchdog for rt2800 devices. For now it only detect hung +and print error. + +[Note: I verified that printing messages from process context is +fine on MT7620 (WT3020) platform that have problem when printk +is called from interrupt context]. + +Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> +Signed-off-by: Kalle Valo <kvalo@codeaurora.org> +--- + .../net/wireless/ralink/rt2x00/rt2800lib.c | 56 +++++++++++++++++++ + .../net/wireless/ralink/rt2x00/rt2800lib.h | 2 + + .../net/wireless/ralink/rt2x00/rt2800pci.c | 1 + + .../net/wireless/ralink/rt2x00/rt2800soc.c | 1 + + .../net/wireless/ralink/rt2x00/rt2800usb.c | 1 + + .../net/wireless/ralink/rt2x00/rt2x00queue.h | 6 ++ + 6 files changed, 67 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -1223,6 +1223,60 @@ void rt2800_txdone_nostatus(struct rt2x0 + } + EXPORT_SYMBOL_GPL(rt2800_txdone_nostatus); + ++static int rt2800_check_hung(struct data_queue *queue) ++{ ++ unsigned int cur_idx = rt2800_drv_get_dma_done(queue); ++ ++ if (queue->wd_idx != cur_idx) ++ queue->wd_count = 0; ++ else ++ queue->wd_count++; ++ ++ return queue->wd_count > 16; ++} ++ ++void rt2800_watchdog(struct rt2x00_dev *rt2x00dev) ++{ ++ struct data_queue *queue; ++ bool hung_tx = false; ++ bool hung_rx = false; ++ ++ if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) ++ return; ++ ++ queue_for_each(rt2x00dev, queue) { ++ switch (queue->qid) { ++ case QID_AC_VO: ++ case QID_AC_VI: ++ case QID_AC_BE: ++ case QID_AC_BK: ++ case QID_MGMT: ++ if (rt2x00queue_empty(queue)) ++ continue; ++ hung_tx = rt2800_check_hung(queue); ++ break; ++ case QID_RX: ++ /* For station mode we should reactive at least ++ * beacons. TODO: need to find good way detect ++ * RX hung for AP mode. ++ */ ++ if (rt2x00dev->intf_sta_count == 0) ++ continue; ++ hung_rx = rt2800_check_hung(queue); ++ break; ++ default: ++ break; ++ } ++ } ++ ++ if (hung_tx) ++ rt2x00_warn(rt2x00dev, "Watchdog TX hung detected\n"); ++ ++ if (hung_rx) ++ rt2x00_warn(rt2x00dev, "Watchdog RX hung detected\n"); ++} ++EXPORT_SYMBOL_GPL(rt2800_watchdog); ++ + static unsigned int rt2800_hw_beacon_base(struct rt2x00_dev *rt2x00dev, + unsigned int index) + { +@@ -10222,6 +10276,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r + __set_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags); + } + ++ rt2x00dev->link.watchdog_interval = msecs_to_jiffies(100); ++ + /* + * Set the rssi offset. + */ +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +@@ -208,6 +208,8 @@ void rt2800_txdone_nostatus(struct rt2x0 + bool rt2800_txstatus_timeout(struct rt2x00_dev *rt2x00dev); + bool rt2800_txstatus_pending(struct rt2x00_dev *rt2x00dev); + ++void rt2800_watchdog(struct rt2x00_dev *rt2x00dev); ++ + void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc); + void rt2800_clear_beacon(struct queue_entry *entry); + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c +@@ -362,6 +362,7 @@ static const struct rt2x00lib_ops rt2800 + .link_tuner = rt2800_link_tuner, + .gain_calibration = rt2800_gain_calibration, + .vco_calibration = rt2800_vco_calibration, ++ .watchdog = rt2800_watchdog, + .start_queue = rt2800mmio_start_queue, + .kick_queue = rt2800mmio_kick_queue, + .stop_queue = rt2800mmio_stop_queue, +--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +@@ -208,6 +208,7 @@ static const struct rt2x00lib_ops rt2800 + .link_tuner = rt2800_link_tuner, + .gain_calibration = rt2800_gain_calibration, + .vco_calibration = rt2800_vco_calibration, ++ .watchdog = rt2800_watchdog, + .start_queue = rt2800mmio_start_queue, + .kick_queue = rt2800mmio_kick_queue, + .stop_queue = rt2800mmio_stop_queue, +--- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c +@@ -698,6 +698,7 @@ static const struct rt2x00lib_ops rt2800 + .link_tuner = rt2800_link_tuner, + .gain_calibration = rt2800_gain_calibration, + .vco_calibration = rt2800_vco_calibration, ++ .watchdog = rt2800_watchdog, + .start_queue = rt2800usb_start_queue, + .kick_queue = rt2x00usb_kick_queue, + .stop_queue = rt2800usb_stop_queue, +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h +@@ -446,6 +446,9 @@ enum data_queue_flags { + * @length: Number of frames in queue. + * @index: Index pointers to entry positions in the queue, + * use &enum queue_index to get a specific index field. ++ * @wd_count: watchdog counter number of times entry does change ++ * in the queue ++ * @wd_idx: index of queue entry saved by watchdog + * @txop: maximum burst time. + * @aifs: The aifs value for outgoing frames (field ignored in RX queue). + * @cw_min: The cw min value for outgoing frames (field ignored in RX queue). +@@ -473,6 +476,9 @@ struct data_queue { + unsigned short length; + unsigned short index[Q_INDEX_MAX]; + ++ unsigned short wd_count; ++ unsigned int wd_idx; ++ + unsigned short txop; + unsigned short aifs; + unsigned short cw_min; |