From: Greg Kroah-Hartman Date: Tue, 26 Nov 2013 22:56:28 +0000 (-0800) Subject: 3.10-stable patches X-Git-Tag: v3.11.10~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53038f168b7e69427353d387d98ccfc7556159e5;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: rt2800usb-slow-down-tx-status-polling.patch usb-hub-clear-port-reset-change-during-init-resume.patch --- diff --git a/queue-3.10/rt2800usb-slow-down-tx-status-polling.patch b/queue-3.10/rt2800usb-slow-down-tx-status-polling.patch new file mode 100644 index 00000000000..95089a6e93e --- /dev/null +++ b/queue-3.10/rt2800usb-slow-down-tx-status-polling.patch @@ -0,0 +1,71 @@ +From 36165fd5b00bf8163f89c21bb16a3e9834555b10 Mon Sep 17 00:00:00 2001 +From: Stanislaw Gruszka +Date: Fri, 18 Oct 2013 11:36:54 +0200 +Subject: rt2800usb: slow down TX status polling + +From: Stanislaw Gruszka + +commit 36165fd5b00bf8163f89c21bb16a3e9834555b10 upstream. + +Polling TX statuses too frequently has two negative effects. First is +randomly peek CPU usage, causing overall system functioning delays. +Second bad effect is that device is not able to fill TX statuses in +H/W register on some workloads and we get lot of timeouts like below: + +ieee80211 phy4: rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for entry 7 in queue 2 +ieee80211 phy4: rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for entry 7 in queue 2 +ieee80211 phy4: rt2800usb_txdone: Warning - Got TX status for an empty queue 2, dropping + +This not only cause flood of messages in dmesg, but also bad throughput, +since rate scaling algorithm can not work optimally. + +In the future, we should probably make polling interval be adjusted +automatically, but for now just increase values, this make mentioned +problems gone. + +Resolve: +https://bugzilla.kernel.org/show_bug.cgi?id=62781 + +Signed-off-by: Stanislaw Gruszka +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -148,6 +148,8 @@ static bool rt2800usb_txstatus_timeout(s + return false; + } + ++#define TXSTATUS_READ_INTERVAL 1000000 ++ + static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev, + int urb_status, u32 tx_status) + { +@@ -176,8 +178,9 @@ static bool rt2800usb_tx_sta_fifo_read_c + queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work); + + if (rt2800usb_txstatus_pending(rt2x00dev)) { +- /* Read register after 250 us */ +- hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000), ++ /* Read register after 1 ms */ ++ hrtimer_start(&rt2x00dev->txstatus_timer, ++ ktime_set(0, TXSTATUS_READ_INTERVAL), + HRTIMER_MODE_REL); + return false; + } +@@ -202,8 +205,9 @@ static void rt2800usb_async_read_tx_stat + if (test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags)) + return; + +- /* Read TX_STA_FIFO register after 500 us */ +- hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 500000), ++ /* Read TX_STA_FIFO register after 2 ms */ ++ hrtimer_start(&rt2x00dev->txstatus_timer, ++ ktime_set(0, 2*TXSTATUS_READ_INTERVAL), + HRTIMER_MODE_REL); + } + diff --git a/queue-3.10/series b/queue-3.10/series index 6ab1871defd..7ffef4eb849 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -70,3 +70,5 @@ powerpc-signals-mark-vsx-not-saved-with-small-contexts.patch slub-handle-null-parameter-in-kmem_cache_flags.patch sunrpc-fix-a-data-corruption-issue-when-retransmitting-rpc-calls.patch mei-nfc-fix-memory-leak-in-error-path.patch +usb-hub-clear-port-reset-change-during-init-resume.patch +rt2800usb-slow-down-tx-status-polling.patch diff --git a/queue-3.10/usb-hub-clear-port-reset-change-during-init-resume.patch b/queue-3.10/usb-hub-clear-port-reset-change-during-init-resume.patch new file mode 100644 index 00000000000..913232426fe --- /dev/null +++ b/queue-3.10/usb-hub-clear-port-reset-change-during-init-resume.patch @@ -0,0 +1,40 @@ +From e92aee330837e4911553761490a8fb843f2053a6 Mon Sep 17 00:00:00 2001 +From: Julius Werner +Date: Tue, 15 Oct 2013 17:45:00 -0700 +Subject: usb: hub: Clear Port Reset Change during init/resume + +From: Julius Werner + +commit e92aee330837e4911553761490a8fb843f2053a6 upstream. + +This patch adds the Port Reset Change flag to the set of bits that are +preemptively cleared on init/resume of a hub. In theory this bit should +never be set unexpectedly... in practice it can still happen if BIOS, +SMM or ACPI code plays around with USB devices without cleaning up +correctly. This is especially dangerous for XHCI root hubs, which don't +generate any more Port Status Change Events until all change bits are +cleared, so this is a good precaution to have (similar to how it's +already done for the Warm Port Reset Change flag). + +Signed-off-by: Julius Werner +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/hub.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -1129,6 +1129,11 @@ static void hub_activate(struct usb_hub + usb_clear_port_feature(hub->hdev, port1, + USB_PORT_FEAT_C_ENABLE); + } ++ if (portchange & USB_PORT_STAT_C_RESET) { ++ need_debounce_delay = true; ++ usb_clear_port_feature(hub->hdev, port1, ++ USB_PORT_FEAT_C_RESET); ++ } + if ((portchange & USB_PORT_STAT_C_BH_RESET) && + hub_is_superspeed(hub->hdev)) { + need_debounce_delay = true;