aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/568-ath9k_tid_fairness.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/kernel/mac80211/patches/568-ath9k_tid_fairness.patch')
-rw-r--r--package/kernel/mac80211/patches/568-ath9k_tid_fairness.patch148
1 files changed, 148 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/568-ath9k_tid_fairness.patch b/package/kernel/mac80211/patches/568-ath9k_tid_fairness.patch
new file mode 100644
index 0000000000..6512cf04a0
--- /dev/null
+++ b/package/kernel/mac80211/patches/568-ath9k_tid_fairness.patch
@@ -0,0 +1,148 @@
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -1282,8 +1282,8 @@ ath_tx_form_burst(struct ath_softc *sc,
+ } while (1);
+ }
+
+-static void ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq,
+- struct ath_atx_tid *tid)
++static bool ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq,
++ struct ath_atx_tid *tid, bool *stop)
+ {
+ struct ath_buf *bf;
+ struct ieee80211_tx_info *tx_info;
+@@ -1292,37 +1292,36 @@ static void ath_tx_sched_aggr(struct ath
+ int aggr_len = 0;
+ bool aggr, last = true;
+
+- do {
+- if (!ath_tid_has_buffered(tid))
+- return;
+-
+- INIT_LIST_HEAD(&bf_q);
++ if (!ath_tid_has_buffered(tid))
++ return false;
+
+- bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q);
+- if (!bf)
+- break;
+-
+- tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
+- aggr = !!(tx_info->flags & IEEE80211_TX_CTL_AMPDU);
+- if ((aggr && txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) ||
+- (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH))
+- break;
++ INIT_LIST_HEAD(&bf_q);
+
+- ath_set_rates(tid->an->vif, tid->an->sta, bf);
+- if (aggr)
+- last = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf,
+- tid_q, &aggr_len);
+- else
+- ath_tx_form_burst(sc, txq, tid, &bf_q, bf, tid_q);
++ bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q);
++ if (!bf)
++ return false;
++
++ tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
++ aggr = !!(tx_info->flags & IEEE80211_TX_CTL_AMPDU);
++ if ((aggr && txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) ||
++ (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH))
++ return false;
++
++ ath_set_rates(tid->an->vif, tid->an->sta, bf);
++ if (aggr)
++ last = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf,
++ tid_q, &aggr_len);
++ else
++ ath_tx_form_burst(sc, txq, tid, &bf_q, bf, tid_q);
+
+- if (tid->ac->clear_ps_filter) {
+- tid->ac->clear_ps_filter = false;
+- tx_info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
+- }
++ if (tid->ac->clear_ps_filter) {
++ tid->ac->clear_ps_filter = false;
++ tx_info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
++ }
+
+- ath_tx_fill_desc(sc, bf, txq, aggr_len);
+- ath_tx_txqaddbuf(sc, txq, &bf_q, false);
+- } while (!last);
++ ath_tx_fill_desc(sc, bf, txq, aggr_len);
++ ath_tx_txqaddbuf(sc, txq, &bf_q, false);
++ return true;
+ }
+
+ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
+@@ -1754,8 +1753,9 @@ void ath_tx_cleanupq(struct ath_softc *s
+ */
+ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
+ {
+- struct ath_atx_ac *ac, *ac_tmp, *last_ac;
++ struct ath_atx_ac *ac, *last_ac;
+ struct ath_atx_tid *tid, *last_tid;
++ bool sent = false;
+
+ if (test_bit(SC_OP_HW_RESET, &sc->sc_flags) ||
+ list_empty(&txq->axq_acq) ||
+@@ -1764,15 +1764,17 @@ void ath_txq_schedule(struct ath_softc *
+
+ rcu_read_lock();
+
+- ac = list_first_entry(&txq->axq_acq, struct ath_atx_ac, list);
+ last_ac = list_entry(txq->axq_acq.prev, struct ath_atx_ac, list);
++ while (!list_empty(&txq->axq_acq)) {
++ bool stop = false;
+
+- list_for_each_entry_safe(ac, ac_tmp, &txq->axq_acq, list) {
++ ac = list_first_entry(&txq->axq_acq, struct ath_atx_ac, list);
+ last_tid = list_entry(ac->tid_q.prev, struct ath_atx_tid, list);
+ list_del(&ac->list);
+ ac->sched = false;
+
+ while (!list_empty(&ac->tid_q)) {
++
+ tid = list_first_entry(&ac->tid_q, struct ath_atx_tid,
+ list);
+ list_del(&tid->list);
+@@ -1781,7 +1783,8 @@ void ath_txq_schedule(struct ath_softc *
+ if (tid->paused)
+ continue;
+
+- ath_tx_sched_aggr(sc, txq, tid);
++ if (ath_tx_sched_aggr(sc, txq, tid, &stop))
++ sent = true;
+
+ /*
+ * add tid to round-robin queue if more frames
+@@ -1790,8 +1793,7 @@ void ath_txq_schedule(struct ath_softc *
+ if (ath_tid_has_buffered(tid))
+ ath_tx_queue_tid(txq, tid);
+
+- if (tid == last_tid ||
+- txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
++ if (stop || tid == last_tid)
+ break;
+ }
+
+@@ -1800,9 +1802,17 @@ void ath_txq_schedule(struct ath_softc *
+ list_add_tail(&ac->list, &txq->axq_acq);
+ }
+
+- if (ac == last_ac ||
+- txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
++ if (stop)
+ break;
++
++ if (ac == last_ac) {
++ if (!sent)
++ break;
++
++ sent = false;
++ last_ac = list_entry(txq->axq_acq.prev,
++ struct ath_atx_ac, list);
++ }
+ }
+
+ rcu_read_unlock();
>329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "qcom-ipq4019.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/soc/qcom,tcsr.h>

/ {
	model = "MobiPromo CM520-79F";
	compatible = "mobipromo,cm520-79f";

	aliases {
		led-boot = &led_sys;
		led-failsafe = &led_sys;
		led-running = &led_sys;
		led-upgrade = &led_sys;
	};

	soc {
		rng@22000 {
			status = "okay";
		};

		mdio@90000 {
			status = "okay";
			pinctrl-0 = <&mdio_pins>;
			pinctrl-names = "default";
			reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>;
			reset-delay-us = <1000>;
		};

		ess-psgmii@98000 {
			status = "okay";
		};

		tcsr@1949000 {
			compatible = "qcom,tcsr";
			reg = <0x1949000 0x100>;
			qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
		};

		tcsr@194b000 {
			compatible = "qcom,tcsr";
			reg = <0x194b000 0x100>;
			qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
		};

		ess_tcsr@1953000 {
			compatible = "qcom,tcsr";
			reg = <0x1953000 0x1000>;
			qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
		};

		tcsr@1957000 {
			compatible = "qcom,tcsr";
			reg = <0x1957000 0x100>;
			qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
		};

		usb2@60f8800 {
			status = "okay";

			dwc3@6000000 {
				#address-cells = <1>;
				#size-cells = <0>;

				usb2_port1: port@1 {
					reg = <1>;
					#trigger-source-cells = <0>;
				};
			};
		};

		usb3@8af8800 {
			status = "okay";

			dwc3@8a00000 {
				#address-cells = <1>;
				#size-cells = <0>;

				usb3_port1: port@1 {
					reg = <1>;
					#trigger-source-cells = <0>;
				};

				usb3_port2: port@2 {
					reg = <2>;
					#trigger-source-cells = <0>;
				};
			};
		};

		crypto@8e3a000 {
			status = "okay";
		};

		watchdog@b017000 {
			status = "okay";
		};

		ess-switch@c000000 {
			status = "okay";
		};

		edma@c080000 {
			status = "okay";
		};
	};

	led_spi {
		compatible = "spi-gpio";
		#address-cells = <1>;
		ranges;

		sck-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
		mosi-gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>;
		num-chipselects = <0>;

		led_gpio: led_gpio@0 {
			compatible = "fairchild,74hc595";
			reg = <0>;
			gpio-controller;
			#gpio-cells = <2>;
			registers-number = <1>;
			spi-max-frequency = <1000000>;
		};
	};

	leds {
		compatible = "gpio-leds";

		usb {
			label = "cm520-79f:blue:usb";
			gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "usbport";
			trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>;
		};

		led_sys: can {
			label = "cm520-79f:blue:can";
			gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>;
		};

		wan {
			label = "cm520-79f:blue:wan";
			gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
		};

		lan1 {
			label = "cm520-79f:blue:lan1";
			gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
		};

		lan2 {
			label = "cm520-79f:blue:lan2";
			gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
		};

		wlan2g {
			label = "cm520-79f:blue:wlan2g";
			gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0tpt";
		};

		wlan5g {
			label = "cm520-79f:blue:wlan5g";
			gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy1tpt";
		};
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	};
};

&blsp_dma {
	status = "okay";
};

&blsp1_uart1 {
	status = "okay";
};

&blsp1_uart2 {
	status = "okay";
};

&cryptobam {
	status = "okay";
};

&gmac0 {
	mtd-mac-address = <&art 0x1006>;
};

&gmac1 {
	mtd-mac-address = <&art 0x5006>;
};

&nand {
	pinctrl-0 = <&nand_pins>;
	pinctrl-names = "default";
	status = "okay";

	nand@0 {
		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "SBL1";
				reg = <0x0 0x100000>;
				read-only;
			};

			partition@100000 {
				label = "MIBIB";
				reg = <0x100000 0x100000>;
				read-only;
			};

			partition@200000 {
				label = "BOOTCONFIG";
				reg = <0x200000 0x100000>;
			};

			partition@300000 {
				label = "QSEE";
				reg = <0x300000 0x100000>;
				read-only;
			};

			partition@400000 {
				label = "QSEE_1";
				reg = <0x400000 0x100000>;
				read-only;
			};

			partition@500000 {
				label = "CDT";
				reg = <0x500000 0x80000>;
				read-only;
			};

			partition@580000 {
				label = "CDT_1";
				reg = <0x580000 0x80000>;
				read-only;
			};

			partition@600000 {
				label = "BOOTCONFIG1";
				reg = <0x600000 0x80000>;
			};

			partition@680000 {
				label = "APPSBLENV";
				reg = <0x680000 0x80000>;
			};

			partition@700000 {
				label = "APPSBL";
				reg = <0x700000 0x200000>;
				read-only;
			};

			partition@900000 {
				label = "APPSBL_1";
				reg = <0x900000 0x200000>;
				read-only;
			};

			art: partition@b00000 {
				label = "ART";
				reg = <0xb00000 0x80000>;
				read-only;
			};

			partition@b80000 {
				label = "ubi";
				reg = <0xb80000 0x7480000>;
			};
		};
	};
};

&qpic_bam {
	status = "okay";
};

&tlmm {
	mdio_pins: mdio_pinmux {
		mux_1 {
			pins = "gpio6";
			function = "mdio";
			bias-pull-up;
		};

		mux_2 {
			pins = "gpio7";
			function = "mdc";
			bias-pull-up;
		};
	};

	nand_pins: nand_pins {
		pullups {
			pins =	"gpio52", "gpio53", "gpio58",
				"gpio59";
			function = "qpic";
			bias-pull-up;
		};

		pulldowns {
			pins =	"gpio54", "gpio55", "gpio56",
				"gpio57", "gpio60", "gpio61",
				"gpio62", "gpio63", "gpio64",
				"gpio65", "gpio66", "gpio67",
				"gpio68", "gpio69";
			function = "qpic";
			bias-pull-down;
		};
	};
};

&usb3_ss_phy {
	status = "okay";
};

&usb3_hs_phy {
	status = "okay";
};

&usb2_hs_phy {
	status = "okay";
};

&wifi0 {
	status = "okay";
	qcom,ath10k-calibration-variant = "CM520-79F";
};

&wifi1 {
	status = "okay";
	qcom,ath10k-calibration-variant = "CM520-79F";
};