Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH][next] rtw88: fix shift of more than 32 bits of a integer
From: Colin King @ 2019-05-01 14:19 UTC (permalink / raw)
  To: Yan-Hsuan Chuang, Kalle Valo, David S . Miller, linux-wireless,
	netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the shift of an integer value more than 32 bits can
occur when nss is more than 32.  Fix this by making the integer
constants unsigned long longs before shifting and bit-wise or'ing
with the u64 ra_mask to avoid the undefined shift behaviour.

Addresses-Coverity: ("Bad shift operation")
Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/realtek/rtw88/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 9893e5e297e3..6304082361a7 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -363,13 +363,13 @@ static u64 get_vht_ra_mask(struct ieee80211_sta *sta)
 		vht_mcs_cap = mcs_map & 0x3;
 		switch (vht_mcs_cap) {
 		case 2: /* MCS9 */
-			ra_mask |= 0x3ff << nss;
+			ra_mask |= 0x3ffULL << nss;
 			break;
 		case 1: /* MCS8 */
-			ra_mask |= 0x1ff << nss;
+			ra_mask |= 0x1ffULL << nss;
 			break;
 		case 0: /* MCS7 */
-			ra_mask |= 0x0ff << nss;
+			ra_mask |= 0x0ffULL << nss;
 			break;
 		default:
 			break;
-- 
2.20.1


^ permalink raw reply related

* Re: carl9170 crash
From: tedheadster @ 2019-05-01 14:10 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Matthew Whitehead, Christian Lamparter, linux-wireless
In-Reply-To: <87k1fawsio.fsf@purkki.adurom.net>

Kalle,

On Wed, May 1, 2019 at 3:20 AM Kalle Valo <kvalo@codeaurora.org> wrote:
> What was the last working version?

It worked perfectly in 4.14.110.

The next version I have to test is 4.18.20 where I first noticed
problems with loading regulatory.db, but the driver still worked. The
same for 4.19.33, 4.20.17, and 5.0.6:

# journalctl -b | egrep "cfg80211|regulatory|firmware"
May 01 09:38:15 pentiumii-laptop kernel: platform regulatory.0: Direct
firmware load for regulatory.db failed with error -2
May 01 09:38:15 pentiumii-laptop kernel: platform regulatory.0:
Falling back to syfs fallback for: regulatory.db
May 01 09:38:15 pentiumii-laptop kernel: usb 1-1: firmware API: 1.9.6 2012-07-07
May 01 09:39:23 pentiumii-laptop kernel: cfg80211: failed to load regulatory.db
May 01 09:39:23 pentiumii-laptop kernel: cfg80211: failed to load regulatory.db

It looks like the problems arose in the 5.1-rc series. Here is 5.1-rc7
(console messages are slightly garbled):

[   25.561373] usb 1-1: reset full-speed USB device number 2 using uhci_hcd
[  OK  ] Started Create Volatile Files and Directories.
         Starting Network Time Synchronization...
[   25.818199] usbcore: registered new interface driver carl9170
[   25.878181] usb 1-1: driver   API: 1.9.9 2016-02-15 [1-1]
[   25.909356] usb 1-1: firmware API: 1.9.6 2012-07-07
         Starting Update UTMP about System Boot/Shutdown...
[   26.163471] r8169 0000:06:00.0 enp6s0: Link is Up - 1Gbps/Full -
flow control rx/tx
[   26.583723] ath: EEPROM regdomain: 0x3a
[   26.589376] ath: EEPROM indicates we should expect a direct regpair map
[   26.613791] ath: Country alpha2 being used: BM
[  OK     26.633397] ath: Regpair used: 0x3a
m] Started Wait for Network to be Configured.

[   26.662129] invalid opcode: 0000 [#1] PREEMPT
[   26.665496] CPU: 0 PID: 104 Comm: kworker/0:3 Not tainted
5.1.0-rc7.pentiumii-laptop #1446
[   26.665496] Workqueue: events request_firmware_work_func
[   26.665496] EIP: nl80211_send_wiphy+0x558/0x1a58 [cfg80211]
[   26.665496] Code: 0f 85 73 02 00 00 80 7f 16 00 75 0c 80 7f 2c 00
0f 84 a4 00 00 00 eb 6a 8d 47 19 ba 03 00 00 00 50 b9 10 00 00 00 8b
75 bc c9 <f0> e8 2a 4e 83 f8 5a cd c0 0f 85 5d 14 00 00 4d b7 4f 14 ba
04 00
[   26.665496] EAX: c89fa05d EBX: c41ea000 ECX: 00000010 EDX: 00000003
[   26.665496] ESI: c775a720 EDI: c89fa044 EBP: c2cd5e14 ESP: c2cd5dd4
[   26.665496] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010202
[   26.665496] CR0: 80050033 CR2: b607b390 CR3: 0766f000 CR4: 00000290
[   26.665496] Call Trace:
[   26.665496]  ? nl80211_notify_wiphy+0x52/0x84 [cfg80211]
[   26.665496]  wiphy_register+0x303/0x624 [cfg80211]
[   26.665496]  ? ieee80211_register_hw+0x325/0x94a [mac80211]
[   26.665496]  ? __kmalloc+0x8c/0x9c
[   26.665496]  ? ieee80211_cs_list_valid+0xb/0x31 [mac80211]
[   26.665496]  ieee80211_register_hw+0x68f/0x94a [mac80211]
[   26.665496]  ? ath_reg_apply_radar_flags.isra.4+0xb/0x62 [ath]
[   26.665496]  ? ath_reg_apply_world_flags+0xa/0xba [ath]
[   26.665496]  ? ath_regd_init+0xd8/0xec [ath]
[   26.665496]  ? carl9170_op_bss_info_changed+0x16a/0x16a [carl9170]
[   26.665496]  carl9170_register+0x1f5/0x36d [carl9170]
[   26.665496]  ? carl9170_register+0x1f5/0x36d [carl9170]
[   26.665496]  carl9170_usb_firmware_step2+0x226/0x251 [carl9170]
[   26.665496]  request_firmware_work_func+0x2a/0x51
[   26.665496]  process_one_work+0x134/0x260
[   26.665496]  worker_thread+0x18b/0x24a
[   26.665496]  kthread+0xcd/0xcf
[   26.665496]  ? cancel_delayed_work_sync+0x14/0x14
[   26.665496]  ? kthread_create_worker_on_cpu+0x1c/0x1c
[   26.665496]  ret_from_fork+0x19/0x24
[   26.665496] Modules linked in: carl9170 mac80211 ath cfg80211 r8169
realtek libphy rfkill uhci_hcd ehci_pci ehci_hcd pcmcia usbcore
i2c_piix4 i2c_core usb_common yenta_socket pcmcia_rsrc pcmcia_core
autofs4
[   26.693414] ---[ end trace 21daf0caa557a17d ]---
[   26.735231] EIP: nl80211_send_wiphy+0x558/0x1a58 [cfg80211]
[  OK     26.761620] Code: 0f 85 73 02 00 00 80 7f 16 00 75 0c 80 7f
2c 00 0f 84 a4 00 00 00 eb 6a 8d 47 19 ba 03 00 00 00 50 b9 10 00 00
00 8b 75 bc c9 <f0> e8 2a 4e 83 f8 5a cd c0 0f 85 5d 14 00 00 4d b7 4f
14 ba 04 00
m]
Started Update UTMP about System Boot/Shutdown.
[   26.777652] EAX: c89fa05d EBX: c41ea000 ECX: 00000010 EDX: 00000003
[   26.793423] ESI: c775a720 EDI: c89fa044 EBP: c2cd5e14 ESP: c15b02b8
[   26.817190] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010202
[   26.817582] CR0: 80050033 CR2: b6224dd0 CR3: 00399000 CR4: 00000290
[   45.950502] random: crng init done
[   84.628925] cfg80211: failed to load regulatory.db

- Matthew

^ permalink raw reply

* [PATCH 4/4] mt76: move netif_napi_del in mt76_dma_cleanup
From: Lorenzo Bianconi @ 2019-05-01 14:06 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless, ryder.lee
In-Reply-To: <cover.1556718795.git.lorenzo@kernel.org>

Move netif_napi_del in mt76_dma_cleanup routine since it is done
by all drivers

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/dma.c          | 1 +
 drivers/net/wireless/mediatek/mt76/mt7603/dma.c   | 1 -
 drivers/net/wireless/mediatek/mt76/mt7615/dma.c   | 1 -
 drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 1 -
 4 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
index 4381155375e1..d8f61e540bfd 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/dma.c
@@ -588,6 +588,7 @@ void mt76_dma_cleanup(struct mt76_dev *dev)
 {
 	int i;
 
+	netif_napi_del(&dev->tx_napi);
 	for (i = 0; i < ARRAY_SIZE(dev->q_tx); i++)
 		mt76_dma_tx_cleanup(dev, i, true);
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/dma.c b/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
index 54314f6803c5..58dc511f93c5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
@@ -250,6 +250,5 @@ void mt7603_dma_cleanup(struct mt7603_dev *dev)
 		   MT_WPDMA_GLO_CFG_TX_WRITEBACK_DONE);
 
 	tasklet_kill(&dev->mt76.tx_tasklet);
-	netif_napi_del(&dev->mt76.tx_napi);
 	mt76_dma_cleanup(&dev->mt76);
 }
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
index 9c565c93988a..6a70273d4a69 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
@@ -220,6 +220,5 @@ void mt7615_dma_cleanup(struct mt7615_dev *dev)
 	mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_SW_RESET);
 
 	tasklet_kill(&dev->mt76.tx_tasklet);
-	netif_napi_del(&dev->mt76.tx_napi);
 	mt76_dma_cleanup(&dev->mt76);
 }
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
index 617934565818..467b28379870 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
@@ -335,7 +335,6 @@ static void mt76x02_dma_enable(struct mt76x02_dev *dev)
 void mt76x02_dma_cleanup(struct mt76x02_dev *dev)
 {
 	tasklet_kill(&dev->mt76.tx_tasklet);
-	netif_napi_del(&dev->mt76.tx_napi);
 	mt76_dma_cleanup(&dev->mt76);
 }
 EXPORT_SYMBOL_GPL(mt76x02_dma_cleanup);
-- 
2.20.1


^ permalink raw reply related

* [PATCH 3/4] mt76: mt7615: use napi polling for tx cleanup
From: Lorenzo Bianconi @ 2019-05-01 14:06 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless, ryder.lee
In-Reply-To: <cover.1556718795.git.lorenzo@kernel.org>

This allows tx scheduling and tx cleanup to run concurrently

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 .../net/wireless/mediatek/mt76/mt7615/dma.c   | 24 +++++++++++++++++--
 .../net/wireless/mediatek/mt76/mt7615/pci.c   |  2 +-
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
index 3ec6582afd8f..9c565c93988a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
@@ -93,18 +93,33 @@ void mt7615_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
 static void mt7615_tx_tasklet(unsigned long data)
 {
 	struct mt7615_dev *dev = (struct mt7615_dev *)data;
+
+	mt76_txq_schedule_all(&dev->mt76);
+}
+
+static int mt7615_poll_tx(struct napi_struct *napi, int budget)
+{
 	static const u8 queue_map[] = {
 		MT_TXQ_MCU,
 		MT_TXQ_BE
 	};
+	struct mt7615_dev *dev;
 	int i;
 
+	dev = container_of(napi, struct mt7615_dev, mt76.tx_napi);
+
 	for (i = 0; i < ARRAY_SIZE(queue_map); i++)
 		mt76_queue_tx_cleanup(dev, queue_map[i], false);
 
-	mt76_txq_schedule_all(&dev->mt76);
+	if (napi_complete_done(napi, 0))
+		mt7615_irq_enable(dev, MT_INT_TX_DONE_ALL);
 
-	mt7615_irq_enable(dev, MT_INT_TX_DONE_ALL);
+	for (i = 0; i < ARRAY_SIZE(queue_map); i++)
+		mt76_queue_tx_cleanup(dev, queue_map[i], false);
+
+	tasklet_schedule(&dev->mt76.tx_tasklet);
+
+	return 0;
 }
 
 int mt7615_dma_init(struct mt7615_dev *dev)
@@ -178,6 +193,10 @@ int mt7615_dma_init(struct mt7615_dev *dev)
 	if (ret < 0)
 		return ret;
 
+	netif_tx_napi_add(&dev->mt76.napi_dev, &dev->mt76.tx_napi,
+			  mt7615_poll_tx, NAPI_POLL_WEIGHT);
+	napi_enable(&dev->mt76.tx_napi);
+
 	mt76_poll(dev, MT_WPDMA_GLO_CFG,
 		  MT_WPDMA_GLO_CFG_TX_DMA_BUSY |
 		  MT_WPDMA_GLO_CFG_RX_DMA_BUSY, 0, 1000);
@@ -201,5 +220,6 @@ void mt7615_dma_cleanup(struct mt7615_dev *dev)
 	mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_SW_RESET);
 
 	tasklet_kill(&dev->mt76.tx_tasklet);
+	netif_napi_del(&dev->mt76.tx_napi);
 	mt76_dma_cleanup(&dev->mt76);
 }
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/pci.c b/drivers/net/wireless/mediatek/mt76/mt7615/pci.c
index 11122bd2d727..10a249e13a43 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/pci.c
@@ -49,7 +49,7 @@ irqreturn_t mt7615_irq_handler(int irq, void *dev_instance)
 
 	if (intr & MT_INT_TX_DONE_ALL) {
 		mt7615_irq_disable(dev, MT_INT_TX_DONE_ALL);
-		tasklet_schedule(&dev->mt76.tx_tasklet);
+		napi_schedule(&dev->mt76.tx_napi);
 	}
 
 	if (intr & MT_INT_RX_DONE(0)) {
-- 
2.20.1


^ permalink raw reply related

* [PATCH 2/4] mt76: mt7603: use napi polling for tx cleanup
From: Lorenzo Bianconi @ 2019-05-01 14:06 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless, ryder.lee
In-Reply-To: <cover.1556718795.git.lorenzo@kernel.org>

This allows tx scheduling and tx cleanup to run concurrently

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 .../net/wireless/mediatek/mt76/mt7603/core.c  |  2 +-
 .../net/wireless/mediatek/mt76/mt7603/dma.c   | 30 +++++++++++++++++--
 .../net/wireless/mediatek/mt76/mt7603/mac.c   |  4 ++-
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/core.c b/drivers/net/wireless/mediatek/mt76/mt7603/core.c
index 37e5644b45ef..e7ee58e3379c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/core.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/core.c
@@ -35,7 +35,7 @@ irqreturn_t mt7603_irq_handler(int irq, void *dev_instance)
 
 	if (intr & MT_INT_TX_DONE_ALL) {
 		mt7603_irq_disable(dev, MT_INT_TX_DONE_ALL);
-		tasklet_schedule(&dev->mt76.tx_tasklet);
+		napi_schedule(&dev->mt76.tx_napi);
 	}
 
 	if (intr & MT_INT_RX_DONE(0)) {
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/dma.c b/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
index 27e2d9f90553..54314f6803c5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
@@ -139,15 +139,30 @@ static void
 mt7603_tx_tasklet(unsigned long data)
 {
 	struct mt7603_dev *dev = (struct mt7603_dev *)data;
+
+	mt76_txq_schedule_all(&dev->mt76);
+}
+
+static int mt7603_poll_tx(struct napi_struct *napi, int budget)
+{
+	struct mt7603_dev *dev;
 	int i;
 
+	dev = container_of(napi, struct mt7603_dev, mt76.tx_napi);
 	dev->tx_dma_check = 0;
+
 	for (i = MT_TXQ_MCU; i >= 0; i--)
 		mt76_queue_tx_cleanup(dev, i, false);
 
-	mt76_txq_schedule_all(&dev->mt76);
+	if (napi_complete_done(napi, 0))
+		mt7603_irq_enable(dev, MT_INT_TX_DONE_ALL);
 
-	mt7603_irq_enable(dev, MT_INT_TX_DONE_ALL);
+	for (i = MT_TXQ_MCU; i >= 0; i--)
+		mt76_queue_tx_cleanup(dev, i, false);
+
+	tasklet_schedule(&dev->mt76.tx_tasklet);
+
+	return 0;
 }
 
 int mt7603_dma_init(struct mt7603_dev *dev)
@@ -216,7 +231,15 @@ int mt7603_dma_init(struct mt7603_dev *dev)
 		return ret;
 
 	mt76_wr(dev, MT_DELAY_INT_CFG, 0);
-	return mt76_init_queues(dev);
+	ret = mt76_init_queues(dev);
+	if (ret)
+		return ret;
+
+	netif_tx_napi_add(&dev->mt76.napi_dev, &dev->mt76.tx_napi,
+			  mt7603_poll_tx, NAPI_POLL_WEIGHT);
+	napi_enable(&dev->mt76.tx_napi);
+
+	return 0;
 }
 
 void mt7603_dma_cleanup(struct mt7603_dev *dev)
@@ -227,5 +250,6 @@ void mt7603_dma_cleanup(struct mt7603_dev *dev)
 		   MT_WPDMA_GLO_CFG_TX_WRITEBACK_DONE);
 
 	tasklet_kill(&dev->mt76.tx_tasklet);
+	netif_napi_del(&dev->mt76.tx_napi);
 	mt76_dma_cleanup(&dev->mt76);
 }
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
index 6d506e34c3ee..0ccba5926b68 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
@@ -1282,6 +1282,7 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
 	tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
 	napi_disable(&dev->mt76.napi[0]);
 	napi_disable(&dev->mt76.napi[1]);
+	napi_disable(&dev->mt76.tx_napi);
 
 	mutex_lock(&dev->mt76.mutex);
 
@@ -1326,7 +1327,8 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
 	mutex_unlock(&dev->mt76.mutex);
 
 	tasklet_enable(&dev->mt76.tx_tasklet);
-	tasklet_schedule(&dev->mt76.tx_tasklet);
+	napi_enable(&dev->mt76.tx_napi);
+	napi_schedule(&dev->mt76.tx_napi);
 
 	tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
 	mt7603_beacon_set_timer(dev, -1, beacon_int);
-- 
2.20.1


^ permalink raw reply related

* [PATCH 0/4] mt76: add tx napi polling support to mt7603/mt7615
From: Lorenzo Bianconi @ 2019-05-01 14:06 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless, ryder.lee

Use napi polling for tx cleanup in mt7603 and mt7615 drivers in order
to allow tx scheduling and tx cleanup to run concurrently

Lorenzo Bianconi (4):
  mt76: move tx_napi in mt76_dev
  mt76: mt7603: use napi polling for tx cleanup
  mt76: mt7615: use napi polling for tx cleanup
  mt76: move netif_napi_del in mt76_dma_cleanup

 drivers/net/wireless/mediatek/mt76/dma.c      |  1 +
 drivers/net/wireless/mediatek/mt76/mt76.h     |  1 +
 .../net/wireless/mediatek/mt76/mt7603/core.c  |  2 +-
 .../net/wireless/mediatek/mt76/mt7603/dma.c   | 29 +++++++++++++++++--
 .../net/wireless/mediatek/mt76/mt7603/mac.c   |  4 ++-
 .../net/wireless/mediatek/mt76/mt7615/dma.c   | 23 +++++++++++++--
 .../net/wireless/mediatek/mt76/mt7615/pci.c   |  2 +-
 drivers/net/wireless/mediatek/mt76/mt76x02.h  |  1 -
 .../net/wireless/mediatek/mt76/mt76x02_mmio.c | 18 ++++++------
 9 files changed, 63 insertions(+), 18 deletions(-)

-- 
2.20.1


^ permalink raw reply

* [PATCH 1/4] mt76: move tx_napi in mt76_dev
From: Lorenzo Bianconi @ 2019-05-01 14:06 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless, ryder.lee
In-Reply-To: <cover.1556718795.git.lorenzo@kernel.org>

Move tx_napi in mt76_dev data structure in order to implement
concurrency between tx scheduling and tx cleanup in mt7603 and mt7615
drivers

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt76.h     |  1 +
 drivers/net/wireless/mediatek/mt76/mt76x02.h  |  1 -
 .../net/wireless/mediatek/mt76/mt76x02_mmio.c | 19 ++++++++++---------
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 8ecbf81a906f..fc4169c83e76 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -452,6 +452,7 @@ struct mt76_dev {
 	int tx_dma_idx[4];
 
 	struct tasklet_struct tx_tasklet;
+	struct napi_struct tx_napi;
 	struct delayed_work mac_work;
 
 	wait_queue_head_t tx_wait;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02.h b/drivers/net/wireless/mediatek/mt76/mt76x02.h
index 687bd14b2d77..f7fd53a1738a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02.h
@@ -90,7 +90,6 @@ struct mt76x02_dev {
 
 	struct sk_buff *rx_head;
 
-	struct napi_struct tx_napi;
 	struct delayed_work cal_work;
 	struct delayed_work wdt_work;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
index 7b7163bc3b62..617934565818 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
@@ -166,7 +166,8 @@ static void mt76x02_tx_tasklet(unsigned long data)
 
 static int mt76x02_poll_tx(struct napi_struct *napi, int budget)
 {
-	struct mt76x02_dev *dev = container_of(napi, struct mt76x02_dev, tx_napi);
+	struct mt76x02_dev *dev = container_of(napi, struct mt76x02_dev,
+					       mt76.tx_napi);
 	int i;
 
 	mt76x02_mac_poll_tx_status(dev, false);
@@ -245,9 +246,9 @@ int mt76x02_dma_init(struct mt76x02_dev *dev)
 	if (ret)
 		return ret;
 
-	netif_tx_napi_add(&dev->mt76.napi_dev, &dev->tx_napi, mt76x02_poll_tx,
-			  NAPI_POLL_WEIGHT);
-	napi_enable(&dev->tx_napi);
+	netif_tx_napi_add(&dev->mt76.napi_dev, &dev->mt76.tx_napi,
+			  mt76x02_poll_tx, NAPI_POLL_WEIGHT);
+	napi_enable(&dev->mt76.tx_napi);
 
 	return 0;
 }
@@ -303,7 +304,7 @@ irqreturn_t mt76x02_irq_handler(int irq, void *dev_instance)
 
 	if (intr & (MT_INT_TX_STAT | MT_INT_TX_DONE_ALL)) {
 		mt76x02_irq_disable(dev, MT_INT_TX_DONE_ALL);
-		napi_schedule(&dev->tx_napi);
+		napi_schedule(&dev->mt76.tx_napi);
 	}
 
 	if (intr & MT_INT_GPTIMER) {
@@ -334,7 +335,7 @@ static void mt76x02_dma_enable(struct mt76x02_dev *dev)
 void mt76x02_dma_cleanup(struct mt76x02_dev *dev)
 {
 	tasklet_kill(&dev->mt76.tx_tasklet);
-	netif_napi_del(&dev->tx_napi);
+	netif_napi_del(&dev->mt76.tx_napi);
 	mt76_dma_cleanup(&dev->mt76);
 }
 EXPORT_SYMBOL_GPL(mt76x02_dma_cleanup);
@@ -454,7 +455,7 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
 
 	tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
 	tasklet_disable(&dev->mt76.tx_tasklet);
-	napi_disable(&dev->tx_napi);
+	napi_disable(&dev->mt76.tx_napi);
 
 	for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++)
 		napi_disable(&dev->mt76.napi[i]);
@@ -508,8 +509,8 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
 	clear_bit(MT76_RESET, &dev->mt76.state);
 
 	tasklet_enable(&dev->mt76.tx_tasklet);
-	napi_enable(&dev->tx_napi);
-	napi_schedule(&dev->tx_napi);
+	napi_enable(&dev->mt76.tx_napi);
+	napi_schedule(&dev->mt76.tx_napi);
 
 	tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
 
-- 
2.20.1


^ permalink raw reply related

* [PATCH] mt76: mt76x02: remove useless return in mt76x02_resync_beacon_timer
From: Lorenzo Bianconi @ 2019-05-01 13:44 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless, sgruszka
In-Reply-To: <cover.1556717431.git.lorenzo@kernel.org>

Remove useless return statment in mt76x02_resync_beacon_timer routine

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
index e196b9c0a686..d61c686e08de 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
@@ -189,10 +189,8 @@ mt76x02_resync_beacon_timer(struct mt76x02_dev *dev)
 	mt76_rmw_field(dev, MT_BEACON_TIME_CFG,
 		       MT_BEACON_TIME_CFG_INTVAL, timer_val);
 
-	if (dev->tbtt_count >= 64) {
+	if (dev->tbtt_count >= 64)
 		dev->tbtt_count = 0;
-		return;
-	}
 }
 EXPORT_SYMBOL_GPL(mt76x02_resync_beacon_timer);
 
-- 
2.20.1


^ permalink raw reply related

* [PATCH v2] cfg80211: Handle bss expiry during connection
From: chaitanya.mgit @ 2019-05-01 12:55 UTC (permalink / raw)
  To: linux-wireless; +Cc: Chaitanya Tata

From: Chaitanya Tata <chaitanya.tata@bluwireless.co.uk>

If the BSS is expired during connection, the connect result will
trigger a kernel warning. Ideally cfg80211 should hold the BSS
before the connection is attempted, but as the BSSID is not known
in case of auth/assoc MLME offload (connect op) it doesn't.

For those drivers without the connect op cfg80211 holds down the
reference so it wil not be removed from list.

Fix this by removing the warning and silently adding the BSS back to
the bss list which is return by the driver (with proper BSSID set) or
in case the BSS is already added use that.

The requirements for drivers are documented in the API's.

Signed-off-by: Chaitanya Tata <chaitanya.tata@bluwireless.co.uk>
---
Tested this using the below hack in cfg80211_connect_done():
        cfg80211_bss_age(rdev, get_seconds() - 30);
        cfg80211_bss_expire(rdev);
v2:
 - Modified to check for BSS to avoid overwriting fresh information with
 stale. The TS is still updated but IMHO shouldn't matter (avoids having
a additional flag to avoid that).
- Fixed BSS ref leak

---
 include/net/cfg80211.h | 15 +++++++++++----
 net/wireless/core.h    |  4 ++++
 net/wireless/scan.c    |  2 +-
 net/wireless/sme.c     | 29 ++++++++++++++++++++++++++---
 4 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bb307a11ee63..4f6c2c598618 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -6137,8 +6137,11 @@ struct cfg80211_fils_resp_params {
  *	case.
  * @bssid: The BSSID of the AP (may be %NULL)
  * @bss: Entry of bss to which STA got connected to, can be obtained through
- *	cfg80211_get_bss() (may be %NULL). Only one parameter among @bssid and
- *	@bss needs to be specified.
+ *	cfg80211_get_bss() (may be %NULL). But it is recommended to store the
+ *      bss from the connect_request and hold a reference to it and return
+ *      through this param to avoid a warning if the bss is expired during the
+ *      connection, esp. for those drivers implementing connect op.
+ *	Only one parameter among @bssid and @bss needs to be specified.
  * @req_ie: Association request IEs (may be %NULL)
  * @req_ie_len: Association request IEs length
  * @resp_ie: Association response IEs (may be %NULL)
@@ -6186,8 +6189,12 @@ void cfg80211_connect_done(struct net_device *dev,
  *
  * @dev: network device
  * @bssid: the BSSID of the AP
- * @bss: entry of bss to which STA got connected to, can be obtained
- *	through cfg80211_get_bss (may be %NULL)
+ * @bss: Entry of bss to which STA got connected to, can be obtained through
+ *	cfg80211_get_bss() (may be %NULL). But it is recommended to store the
+ *      bss from the connect_request and hold a reference to it and return
+ *      through this param to avoid a warning if the bss is expired during the
+ *      connection, esp. for those drivers implementing connect op.
+ *	Only one parameter among @bssid and @bss needs to be specified.
  * @req_ie: association request IEs (maybe be %NULL)
  * @req_ie_len: association request IEs length
  * @resp_ie: association response IEs (may be %NULL)
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 84d36ca7a7ab..238478341100 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -531,6 +531,10 @@ void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,
 void cfg80211_stop_nan(struct cfg80211_registered_device *rdev,
 		       struct wireless_dev *wdev);
 
+struct cfg80211_internal_bss *
+cfg80211_bss_update(struct cfg80211_registered_device *rdev,
+		    struct cfg80211_internal_bss *tmp,
+		    bool signal_valid);
 #ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS
 #define CFG80211_DEV_WARN_ON(cond)	WARN_ON(cond)
 #else
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 287518c6caa4..0f5ae54c7644 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -1035,7 +1035,7 @@ struct cfg80211_non_tx_bss {
 };
 
 /* Returned bss is reference counted and must be cleaned up appropriately. */
-static struct cfg80211_internal_bss *
+struct cfg80211_internal_bss *
 cfg80211_bss_update(struct cfg80211_registered_device *rdev,
 		    struct cfg80211_internal_bss *tmp,
 		    bool signal_valid)
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 7d34cb884840..35cbfdd56bf0 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -799,9 +799,32 @@ void cfg80211_connect_done(struct net_device *dev,
 		/* Make sure the bss entry provided by the driver is valid. */
 		struct cfg80211_internal_bss *ibss = bss_from_pub(params->bss);
 
-		if (WARN_ON(list_empty(&ibss->list))) {
-			cfg80211_put_bss(wdev->wiphy, params->bss);
-			return;
+		if ((list_empty(&ibss->list))) {
+			struct cfg80211_bss *found = NULL, *tmp = params->bss;
+
+			found = cfg80211_get_bss(wdev->wiphy, NULL,
+						 params->bss->bssid,
+						 wdev->ssid, wdev->ssid_len,
+						 wdev->conn_bss_type,
+						 IEEE80211_PRIVACY_ANY);
+			if (found)
+				/* The same BSS is already updated so use it
+				 * instead, as it has latest info.
+				 */
+				params->bss = found;
+			else
+				/* Update with BSS provided by driver, it will
+				 * be freshly added and ref cnted, we can free
+				 * the old one.
+				 *
+				 * signal_valid can be false, as we are not
+				 * expecting the BSS to be found.
+				 */
+				cfg80211_bss_update(rdev, ibss, false);
+			/* Put down the old BSS we don't need it
+			 * anymore.
+			 */
+			cfg80211_put_bss(wdev->wiphy, tmp);
 		}
 	}
 
-- 
2.17.1


^ permalink raw reply related

* Re: [PATCH] mac80211: fix possible deadlock in TX path
From: Erik Stromdahl @ 2019-05-01 11:06 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, johannes, davem, linux-wireless,
	linux-kernel
In-Reply-To: <87k1fcnd9y.fsf@toke.dk>



On 4/30/19 9:49 AM, Toke Høiland-Jørgensen wrote:
> Erik Stromdahl <erik.stromdahl@gmail.com> writes:
> 
>> This patch fixes a possible deadlock when updating the TX statistics
>> (when calling into ieee80211_tx_stats()) from ieee80211_tx_dequeue().
> 
> So is this the fix for the issue with TX scheduling you reported
> earlier? :)
> 

Actually not. I thought so initially, but then, after a few more test runs,
I was able to run into the issue again.

But it does seem to fix the other issue with the RCU stall since I haven't
seen it with this patch applied (could be just a coincidence though).

--
Erik

^ permalink raw reply

* pull request: mt76 2019-05-01
From: Felix Fietkau @ 2019-05-01 11:05 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

Hi Kalle,

here's my first pull request for 5.2

- Felix

The following changes since commit e3037485c68ec1a299ff41160d8fedbd4abc29b9:

  rtw88: new Realtek 802.11ac driver (2019-04-30 19:43:37 +0300)

are available in the Git repository at:

  https://github.com/nbd168/wireless tags/mt76-for-kvalo-2019-05-01

for you to fetch changes up to 4d2a6f7b4e17ede86be46013d114d58adaca5631:

  mt76: mt7603: dynamically alloc mcu req in mt7603_mcu_set_eeprom (2019-05-01 13:04:00 +0200)

----------------------------------------------------------------
mt76 patches for 5.2

* share more code across drivers
* new driver for MT7615 chipsets
* rework DMA API
* tx/rx performance optimizations
* use NAPI for tx cleanup on mt76x02
* AP mode support for USB devices
* USB stability fixes
* tx power handling fixes for 76x2
* endian fixes

----------------------------------------------------------------
Felix Fietkau (11):
      mt76: fix tx power issues
      mt76: use readl/writel instead of ioread32/iowrite32
      mt76: use mac80211 txq scheduling
      mt76: reduce locking in mt76_dma_tx_cleanup
      mt76: store wcid tx rate info in one u32 reduce locking
      mt76: move tx tasklet to struct mt76_dev
      mt76: only schedule txqs from the tx tasklet
      mt76: mt76x02: use napi polling for tx cleanup
      mt76: mt76x02: remove irqsave/restore in locking for tx status fifo
      mt76: mt7603: fix initialization of max rx length
      mt76: mt7615: use sizeof instead of sizeof_field

Lorenzo Bianconi (35):
      mt76: mmio: move mt76x02_set_irq_mask in mt76 module
      mt76: dma: move mt76x02_init_{tx,rx}_queue in mt76 module
      mt76: remove mt76_queue dependency from tx_queue_skb function pointer
      mt76: remove mt76_queue dependency from tx_prepare_skb function pointer
      mt76: remove mt76_queue dependency from tx_complete_skb function pointer
      mt76: introduce mt76_sw_queue data structure
      mt76: introduce mt76_txq_id field in mt76_queue_entry
      mt76: move mt76x02_insert_hdr_pad in mt76-core module
      mt76: mmio: move mt76_insert_hdr_pad in mt76_dma_tx_queue_skb
      mt76: move skb dma mapping before running tx_prepare_skb
      mt76: introduce mt76_tx_info data structure
      mt76: dma: add static qualifier to mt76_dma_tx_queue_skb
      mt7603: remove mt7603_mcu_init routine
      mt7603: core: do not use magic numbers in mt7603_reg_map
      mt76: usb: reduce code indentation in mt76u_alloc_tx
      mt76: introduce mt76_free_device routine
      mt76: move mac_work in mt76_dev
      mt76: usb: reduce locking in mt76u_tx_tasklet
      mt76: set txwi_size according to the driver value
      mt76: add skb pointer to mt76_tx_info
      mt76: dma: introduce skb field in mt76_txwi_cache
      mt76: dma: add skb check for dummy pointer
      mt76: mt7603: remove query from mt7603_mcu_msg_send signature
      mt76: mt7603: use standard signature for mt7603_mcu_msg_send
      mt76: mt7603: initialize mt76_mcu_ops data structure
      mt76: introduce mt76_mcu_restart macro
      mt76: mt7603: init mcu_restart function pointer
      mt76: mt7603: run __mt76_mcu_send_msg in mt7603_mcu_send_firmware
      mt76: mt7603: report firmware version using ethtool
      mt76: move beacon_int in mt76_dev
      mt76: move beacon_mask in mt76_dev
      mt76: move pre_tbtt_tasklet in mt76_dev
      mt76: mt7603: enable/disable pre_tbtt_tasklet in mt7603_set_channel
      mt76: do not enable/disable pre_tbtt_tasklet in scan_start/scan_complete
      mt76: mt7603: dynamically alloc mcu req in mt7603_mcu_set_eeprom

Ryder Lee (6):
      mt76: add mac80211 driver for MT7615 PCIe-based chipsets
      mt76: add unlikely() for dma_mapping_error() check
      mt76: use macro for sn and seq_ctrl conversion
      MAINTAINERS: update entry for mt76 wireless driver
      mt76: fix endianness sparse warnings
      mt76: add TX/RX antenna pattern capabilities

Stanislaw Gruszka (28):
      mt76x02: introduce mt76x02_beacon.c
      mt76x02: add hrtimer for pre TBTT for USB
      mt76x02: introduce beacon_ops
      mt76x02u: implement beacon_ops
      mt76x02: generalize some mmio beaconing functions
      mt76x02u: add sta_ps
      mt76x02: disable HW encryption for group frames
      mt76x02u: implement pre TBTT work for USB
      mt76x02: make beacon slots bigger for USB
      mt76x02u: add mt76_release_buffered_frames
      mt76: unify set_tim
      mt76x02: enable AP mode for USB
      mt76usb: change mt76u_submit_buf
      mt76: remove rx_page_lock
      mt76usb: change mt76u_fill_rx_sg arguments
      mt76usb: use usb_dev private data
      mt76usb: remove mt76u_buf redundant fileds
      mt76usb: move mt76u_buf->done to queue entry
      mt76usb: remove mt76u_buf and use urb directly
      mt76usb: remove MT_RXQ_MAIN queue from mt76u_urb_alloc
      mt76usb: resue mt76u_urb_alloc for tx
      mt76usb: remove unneded sg_init_table
      mt76usb: allocate urb and sg as linear data
      mt76usb: remove queue variable from rx_tasklet
      mt76: mt76x02u: remove bogus stop on suspend
      mt76usb: fix tx/rx stop
      mt76: mt76x02: remove bogus mutex usage
      mt76: usb: use EP max packet aligned buffer sizes for rx

kbuild test robot (1):
      mt76: mt76x02: mt76x02_poll_tx() can be static

 MAINTAINERS                                           |    2 +
 drivers/net/wireless/mediatek/mt76/Kconfig            |    1 +
 drivers/net/wireless/mediatek/mt76/Makefile           |    3 +-
 drivers/net/wireless/mediatek/mt76/agg-rx.c           |    2 +-
 drivers/net/wireless/mediatek/mt76/debugfs.c          |    7 +-
 drivers/net/wireless/mediatek/mt76/dma.c              |  164 +++++-----
 drivers/net/wireless/mediatek/mt76/dma.h              |    2 +
 drivers/net/wireless/mediatek/mt76/mac80211.c         |   41 ++-
 drivers/net/wireless/mediatek/mt76/mmio.c             |   17 +-
 drivers/net/wireless/mediatek/mt76/mt76.h             |  119 ++++---
 drivers/net/wireless/mediatek/mt76/mt7603/beacon.c    |   35 +-
 drivers/net/wireless/mediatek/mt76/mt7603/core.c      |   19 +-
 drivers/net/wireless/mediatek/mt76/mt7603/dma.c       |   39 +--
 drivers/net/wireless/mediatek/mt76/mt7603/init.c      |   12 +-
 drivers/net/wireless/mediatek/mt76/mt7603/mac.c       |   54 ++--
 drivers/net/wireless/mediatek/mt76/mt7603/main.c      |   34 +-
 drivers/net/wireless/mediatek/mt76/mt7603/mcu.c       |  116 ++++---
 drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h    |   23 +-
 drivers/net/wireless/mediatek/mt76/mt7603/regs.h      |    4 +
 drivers/net/wireless/mediatek/mt76/mt7615/Kconfig     |    7 +
 drivers/net/wireless/mediatek/mt76/mt7615/Makefile    |    5 +
 drivers/net/wireless/mediatek/mt76/mt7615/dma.c       |  205 ++++++++++++
 drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c    |   98 ++++++
 drivers/net/wireless/mediatek/mt76/mt7615/eeprom.h    |   18 ++
 drivers/net/wireless/mediatek/mt76/mt7615/init.c      |  229 ++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt7615/mac.c       |  775 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt7615/mac.h       |  300 ++++++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt7615/main.c      |  499 +++++++++++++++++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c       | 1655 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.h       |  520 ++++++++++++++++++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h    |  195 ++++++++++++
 drivers/net/wireless/mediatek/mt76/mt7615/pci.c       |  150 +++++++++
 drivers/net/wireless/mediatek/mt76/mt7615/regs.h      |  203 ++++++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/init.c      |    2 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/main.c      |    8 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/pci.c       |   26 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c       |   49 +--
 drivers/net/wireless/mediatek/mt76/mt76x02.h          |   44 ++-
 drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c   |  286 +++++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.c      |  185 ++---------
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.h      |    4 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c     |  266 +++++++---------
 drivers/net/wireless/mediatek/mt76/mt76x02_regs.h     |    5 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c     |   29 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_usb.h      |   12 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c |  188 ++++++++++-
 drivers/net/wireless/mediatek/mt76/mt76x02_util.c     |  107 +------
 drivers/net/wireless/mediatek/mt76/mt76x2/init.c      |   12 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/pci.c       |    3 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c  |    6 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c  |   27 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/phy.c       |    6 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/usb.c       |   14 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c  |    5 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c  |   19 +-
 drivers/net/wireless/mediatek/mt76/tx.c               |  148 ++++-----
 drivers/net/wireless/mediatek/mt76/usb.c              |  379 ++++++++++++----------
 57 files changed, 6283 insertions(+), 1100 deletions(-)
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/Kconfig
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/Makefile
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/dma.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/eeprom.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/init.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/mac.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/mac.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/main.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/mcu.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/pci.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt7615/regs.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c

^ permalink raw reply

* Re: [PATCH] mac80211: fix possible deadlock in TX path
From: Toke Høiland-Jørgensen @ 2019-04-30  7:49 UTC (permalink / raw)
  To: Erik Stromdahl, johannes, davem, linux-wireless, linux-kernel
  Cc: Erik Stromdahl
In-Reply-To: <20190427204155.14211-1-erik.stromdahl@gmail.com>

Erik Stromdahl <erik.stromdahl@gmail.com> writes:

> This patch fixes a possible deadlock when updating the TX statistics
> (when calling into ieee80211_tx_stats()) from ieee80211_tx_dequeue().

So is this the fix for the issue with TX scheduling you reported
earlier? :)

-Toke

^ permalink raw reply

* Re: [RFC/RFT] mac80211: Switch to a virtual time-based airtime scheduler
From: Toke Høiland-Jørgensen @ 2019-04-30 10:39 UTC (permalink / raw)
  To: Yibo Zhao
  Cc: make-wifi-fast, linux-wireless, Felix Fietkau, Rajkumar Manoharan,
	Kan Yan, linux-wireless-owner
In-Reply-To: <a9bfcb131944fafb838ab5cd448e7da2@codeaurora.org>

Yibo Zhao <yiboz@codeaurora.org> writes:

> On 2019-04-21 05:15, Toke Høiland-Jørgensen wrote:
>> Yibo Zhao <yiboz@codeaurora.org> writes:
>> 
>>> On 2019-04-11 19:24, Toke Høiland-Jørgensen wrote:
>>>> Yibo Zhao <yiboz@codeaurora.org> writes:
>>>> 
>>>>> On 2019-04-10 18:40, Toke Høiland-Jørgensen wrote:
>>>>>> Yibo Zhao <yiboz@codeaurora.org> writes:
>>>>>> 
>>>>>>> On 2019-04-10 04:41, Toke Høiland-Jørgensen wrote:
>>>>>>>> Yibo Zhao <yiboz@codeaurora.org> writes:
>>>>>>>> 
>>>>>>>>> On 2019-04-04 16:31, Toke Høiland-Jørgensen wrote:
>>>>>>>>>> Yibo Zhao <yiboz@codeaurora.org> writes:
>>>>>>>>>> 
>>>>>>>>>>> On 2019-02-16 01:05, Toke Høiland-Jørgensen wrote:
>>>>>>>>>>>> This switches the airtime scheduler in mac80211 to use a
>>>>>>>>>>>> virtual
>>>>>>>>>>>> time-based
>>>>>>>>>>>> scheduler instead of the round-robin scheduler used before.
>>>>>>>>>>>> This
>>>>>>>>>>>> has
>>>>>>>>>>>> a
>>>>>>>>>>>> couple of advantages:
>>>>>>>>>>>> 
>>>>>>>>>>>> - No need to sync up the round-robin scheduler in
>>>>>>>>>>>> firmware/hardware
>>>>>>>>>>>> with
>>>>>>>>>>>>   the round-robin airtime scheduler.
>>>>>>>>>>>> 
>>>>>>>>>>>> - If several stations are eligible for transmission we can
>>>>>>>>>>>> schedule
>>>>>>>>>>>> both of
>>>>>>>>>>>>   them; no need to hard-block the scheduling rotation until 
>>>>>>>>>>>> the
>>>>>>>>>>>> head
>>>>>>>>>>>> of
>>>>>>>>>>>> the
>>>>>>>>>>>>   queue has used up its quantum.
>>>>>>>>>>>> 
>>>>>>>>>>>> - The check of whether a station is eligible for transmission
>>>>>>>>>>>> becomes
>>>>>>>>>>>>   simpler (in ieee80211_txq_may_transmit()).
>>>>>>>>>>>> 
>>>>>>>>>>>> The drawback is that scheduling becomes slightly more
>>>>>>>>>>>> expensive,
>>>>>>>>>>>> as
>>>>>>>>>>>> we
>>>>>>>>>>>> need
>>>>>>>>>>>> to maintain an rbtree of TXQs sorted by virtual time. This
>>>>>>>>>>>> means
>>>>>>>>>>>> that
>>>>>>>>>>>> ieee80211_register_airtime() becomes O(logN) in the number of
>>>>>>>>>>>> currently
>>>>>>>>>>>> scheduled TXQs. However, hopefully this number rarely grows 
>>>>>>>>>>>> too
>>>>>>>>>>>> big
>>>>>>>>>>>> (it's
>>>>>>>>>>>> only TXQs currently backlogged, not all associated stations),
>>>>>>>>>>>> so
>>>>>>>>>>>> it
>>>>>>>>>>>> shouldn't be too big of an issue.
>>>>>>>>>>>> 
>>>>>>>>>>>> @@ -1831,18 +1830,32 @@ void
>>>>>>>>>>>> ieee80211_sta_register_airtime(struct
>>>>>>>>>>>> ieee80211_sta *pubsta, u8 tid,
>>>>>>>>>>>>  {
>>>>>>>>>>>>  	struct sta_info *sta = container_of(pubsta, struct 
>>>>>>>>>>>> sta_info,
>>>>>>>>>>>> sta);
>>>>>>>>>>>>  	struct ieee80211_local *local = sta->sdata->local;
>>>>>>>>>>>> +	struct ieee80211_txq *txq = sta->sta.txq[tid];
>>>>>>>>>>>>  	u8 ac = ieee80211_ac_from_tid(tid);
>>>>>>>>>>>> -	u32 airtime = 0;
>>>>>>>>>>>> +	u64 airtime = 0, weight_sum;
>>>>>>>>>>>> +
>>>>>>>>>>>> +	if (!txq)
>>>>>>>>>>>> +		return;
>>>>>>>>>>>> 
>>>>>>>>>>>>  	if (sta->local->airtime_flags & AIRTIME_USE_TX)
>>>>>>>>>>>>  		airtime += tx_airtime;
>>>>>>>>>>>>  	if (sta->local->airtime_flags & AIRTIME_USE_RX)
>>>>>>>>>>>>  		airtime += rx_airtime;
>>>>>>>>>>>> 
>>>>>>>>>>>> +	/* Weights scale so the unit weight is 256 */
>>>>>>>>>>>> +	airtime <<= 8;
>>>>>>>>>>>> +
>>>>>>>>>>>>  	spin_lock_bh(&local->active_txq_lock[ac]);
>>>>>>>>>>>> +
>>>>>>>>>>>>  	sta->airtime[ac].tx_airtime += tx_airtime;
>>>>>>>>>>>>  	sta->airtime[ac].rx_airtime += rx_airtime;
>>>>>>>>>>>> -	sta->airtime[ac].deficit -= airtime;
>>>>>>>>>>>> +
>>>>>>>>>>>> +	weight_sum = local->airtime_weight_sum[ac] ?:
>>>>>>>>>>>> sta->airtime_weight;
>>>>>>>>>>>> +
>>>>>>>>>>>> +	local->airtime_v_t[ac] += airtime / weight_sum;
>>> Hi Toke,
>>> 
>>> I was porting this version of ATF design to my ath10k platform and 
>>> found
>>> my old kernel version not supporting 64bit division. I'm wondering if 
>>> it
>>> is necessary to use u64 for airtime and weight_sum here though I can
>>> find a solution for it. I think u32 might be enough. For airtime,
>>> u32_max / 256 = 7182219 us(718 ms). As for weight_sum, u32_max / 8092 
>>> us
>>> = 130490, meaning we can support more than 130000 nodes with airtime
>>> weight 8092 us.
>> 
>> As Felix said, we don't really want divides in the fast path at all. 
>> And
>> since the divisors are constant, we should be able to just pre-compute
>> reciprocals and turn the whole thing into multiplications...
>> 
>>> Another finding was when I configured two 11ac STAs with different
>>> airtime weight, such as 256 and 1024 meaning ratio is 1:4, the
>>> throughput ratio was not roughly matching the ratio. Could you please
>>> share your results? I am not sure if it is due to platform difference.
>> 
>> Hmm, I tested them with ath9k where things seemed to work equivalently
>> to the DRR. Are you testing the same hardware with that? Would be a 
>> good
>> baseline.
>> 
>> I am on vacation until the end of the month, but can share my actual
>> test results once I get back...
> Hi Toke,
> I saw your commit in hostapd in
> http://patchwork.ozlabs.org/patch/1059334/
>
> For dynamic and limit mode described in above hostapd patch, do I need 
> to change any code in this kernel patch or any other patches am I 
> missing?

Nope, the kernel just exposes the API to set weights, hostapd does
everything else :)

> After a quick look at the hostapd patch, I guess all the efforts for 
> both modes are done in hostapd. Correct me if I am wrong. :)

You are quite right!

-Toke

^ permalink raw reply

* Re: [PATCH v9 00/14] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips
From: Greg KH @ 2019-05-01  8:42 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Stanislaw Gruszka, yhchuang, linux-wireless, johannes, pkshih,
	tehuang, Larry.Finger, briannorris
In-Reply-To: <20190501081935.GB15425@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 2638 bytes --]

On Wed, May 01, 2019 at 10:19:35AM +0200, Greg KH wrote:
> On Wed, May 01, 2019 at 10:09:34AM +0300, Kalle Valo wrote:
> > Greg KH <gregkh@linuxfoundation.org> writes:
> > 
> > > On Tue, Apr 30, 2019 at 07:47:13PM +0300, Kalle Valo wrote:
> > >> Stanislaw Gruszka <sgruszka@redhat.com> writes:
> > >> 
> > >> > On Tue, Apr 30, 2019 at 03:40:02PM +0300, Kalle Valo wrote:
> > >> >> > From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> > >> >> >
> > >> >> > This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
> > >> >> > rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
> > >> >> > functionalities. The firmware for both can be found at linux-firmware.
> > >> >> 
> > >> >> This looks very good now. I did a quick review of the driver and had few
> > >> >> netpicks but nothing really blocking applying this. So I have now
> > >> >> combined these patches into one big patch and pushed it to the pending
> > >> >> branch:
> > >> >> 
> > >> >> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=284d1e4e3311cfe67c1c57ccc275ff0f5666aeea
> > >> >> 
> > >> >> I appreciate if people could do a quick check and make sure that I
> > >> >> didn't do anything stupid when folding the patches.
> > >> >
> > >> > I've build pending branch and done few quick tests on Realtek
> > >> > 8822CE device. Everything works ok.
> > >> 
> > >> Thanks so much for this, I now feel much more comfortable merging it :)
> > >> 
> > >> So this is manually applied to wireless-drivers-next:
> > >> 
> > >> e3037485c68e rtw88: new Realtek 802.11ac driver
> > >> 
> > >> And it should be in tomorrow's linux-next build, let's see what kind of
> > >> reports we get. Greg, feel free to delete the corresponding staging
> > >> driver from your tree (I forgot the name of the driver already).
> > >
> > > I'll be glad to do so if someone also tells me what the driver's name is
> > > as well, I don't remember either :)
> > 
> > I checked it now, the directory is drivers/staging/rtlwifi. Here's the
> > commit adding the upstream driver, in case you need that in the commit
> > log:
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=e3037485c68ec1a299ff41160d8fedbd4abc29b9
> 
> Thanks for this, now dropped from my tree (with the exception of 2 .h
> files which a different driver used, and I'll clean that up as well with
> a later patch.)

Attached below are the 2 follow-on patches that I have applied that
clean up the remaining .h rtlwifi files, and then move them into the
location where they are used.

thanks,

greg k-h

[-- Attachment #2: 0001-staging-rtlwifi-strip-down-phydm-.h-files.patch --]
[-- Type: text/plain, Size: 11391 bytes --]

From 8a90bdcb64a9e3732279bb6d9f5054dd6ce3dfbd Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Wed, 1 May 2019 10:37:13 +0200
Subject: [PATCH 1/2] staging: rtlwifi: strip down phydm .h files

The phydm .h files are used by another driver, but not all of the
defines are used, so strip them down to their basic necessities before
we move them out of this directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/rtlwifi/phydm/phydm_reg.h     | 118 --------------
 .../rtlwifi/phydm/phydm_regdefine11n.h        | 153 +-----------------
 2 files changed, 2 insertions(+), 269 deletions(-)

diff --git a/drivers/staging/rtlwifi/phydm/phydm_reg.h b/drivers/staging/rtlwifi/phydm/phydm_reg.h
index 562c1199d669..e3ae006487ba 100644
--- a/drivers/staging/rtlwifi/phydm/phydm_reg.h
+++ b/drivers/staging/rtlwifi/phydm/phydm_reg.h
@@ -11,130 +11,12 @@
  * Larry Finger <Larry.Finger@lwfinger.net>
  *
  *****************************************************************************/
-/* ************************************************************
- * File Name: odm_reg.h
- *
- * Description:
- *
- * This file is for general register definition.
- *
- *
- * *************************************************************/
 #ifndef __HAL_ODM_REG_H__
 #define __HAL_ODM_REG_H__
 
-/*
- * Register Definition
- */
-
-/* MAC REG */
-#define ODM_BB_RESET 0x002
-#define ODM_DUMMY 0x4fe
-#define RF_T_METER_OLD 0x24
-#define RF_T_METER_NEW 0x42
-
 #define ODM_EDCA_VO_PARAM 0x500
 #define ODM_EDCA_VI_PARAM 0x504
 #define ODM_EDCA_BE_PARAM 0x508
 #define ODM_EDCA_BK_PARAM 0x50C
-#define ODM_TXPAUSE 0x522
-
-/* LTE_COEX */
-#define REG_LTECOEX_CTRL 0x07C0
-#define REG_LTECOEX_WRITE_DATA 0x07C4
-#define REG_LTECOEX_READ_DATA 0x07C8
-#define REG_LTECOEX_PATH_CONTROL 0x70
-
-/* BB REG */
-#define ODM_FPGA_PHY0_PAGE8 0x800
-#define ODM_PSD_SETTING 0x808
-#define ODM_AFE_SETTING 0x818
-#define ODM_TXAGC_B_6_18 0x830
-#define ODM_TXAGC_B_24_54 0x834
-#define ODM_TXAGC_B_MCS32_5 0x838
-#define ODM_TXAGC_B_MCS0_MCS3 0x83c
-#define ODM_TXAGC_B_MCS4_MCS7 0x848
-#define ODM_TXAGC_B_MCS8_MCS11 0x84c
-#define ODM_ANALOG_REGISTER 0x85c
-#define ODM_RF_INTERFACE_OUTPUT 0x860
-#define ODM_TXAGC_B_MCS12_MCS15 0x868
-#define ODM_TXAGC_B_11_A_2_11 0x86c
-#define ODM_AD_DA_LSB_MASK 0x874
-#define ODM_ENABLE_3_WIRE 0x88c
-#define ODM_PSD_REPORT 0x8b4
-#define ODM_R_ANT_SELECT 0x90c
-#define ODM_CCK_ANT_SELECT 0xa07
-#define ODM_CCK_PD_THRESH 0xa0a
-#define ODM_CCK_RF_REG1 0xa11
-#define ODM_CCK_MATCH_FILTER 0xa20
-#define ODM_CCK_RAKE_MAC 0xa2e
-#define ODM_CCK_CNT_RESET 0xa2d
-#define ODM_CCK_TX_DIVERSITY 0xa2f
-#define ODM_CCK_FA_CNT_MSB 0xa5b
-#define ODM_CCK_FA_CNT_LSB 0xa5c
-#define ODM_CCK_NEW_FUNCTION 0xa75
-#define ODM_OFDM_PHY0_PAGE_C 0xc00
-#define ODM_OFDM_RX_ANT 0xc04
-#define ODM_R_A_RXIQI 0xc14
-#define ODM_R_A_AGC_CORE1 0xc50
-#define ODM_R_A_AGC_CORE2 0xc54
-#define ODM_R_B_AGC_CORE1 0xc58
-#define ODM_R_AGC_PAR 0xc70
-#define ODM_R_HTSTF_AGC_PAR 0xc7c
-#define ODM_TX_PWR_TRAINING_A 0xc90
-#define ODM_TX_PWR_TRAINING_B 0xc98
-#define ODM_OFDM_FA_CNT1 0xcf0
-#define ODM_OFDM_PHY0_PAGE_D 0xd00
-#define ODM_OFDM_FA_CNT2 0xda0
-#define ODM_OFDM_FA_CNT3 0xda4
-#define ODM_OFDM_FA_CNT4 0xda8
-#define ODM_TXAGC_A_6_18 0xe00
-#define ODM_TXAGC_A_24_54 0xe04
-#define ODM_TXAGC_A_1_MCS32 0xe08
-#define ODM_TXAGC_A_MCS0_MCS3 0xe10
-#define ODM_TXAGC_A_MCS4_MCS7 0xe14
-#define ODM_TXAGC_A_MCS8_MCS11 0xe18
-#define ODM_TXAGC_A_MCS12_MCS15 0xe1c
-
-/* RF REG */
-#define ODM_GAIN_SETTING 0x00
-#define ODM_CHANNEL 0x18
-#define ODM_RF_T_METER 0x24
-#define ODM_RF_T_METER_92D 0x42
-#define ODM_RF_T_METER_88E 0x42
-#define ODM_RF_T_METER_92E 0x42
-#define ODM_RF_T_METER_8812 0x42
-#define REG_RF_TX_GAIN_OFFSET 0x55
-
-/* ant Detect Reg */
-#define ODM_DPDT 0x300
-
-/* PSD Init */
-#define ODM_PSDREG 0x808
-
-/* 92D path Div */
-#define PATHDIV_REG 0xB30
-#define PATHDIV_TRI 0xBA0
-
-/*
- * Bitmap Definition
- */
-
-#define BIT_FA_RESET BIT(0)
-
-#define REG_OFDM_0_XA_TX_IQ_IMBALANCE 0xC80
-#define REG_OFDM_0_ECCA_THRESHOLD 0xC4C
-#define REG_FPGA0_XB_LSSI_READ_BACK 0x8A4
-#define REG_FPGA0_TX_GAIN_STAGE 0x80C
-#define REG_OFDM_0_XA_AGC_CORE1 0xC50
-#define REG_OFDM_0_XB_AGC_CORE1 0xC58
-#define REG_A_TX_SCALE_JAGUAR 0xC1C
-#define REG_B_TX_SCALE_JAGUAR 0xE1C
-
-#define REG_AFE_XTAL_CTRL 0x0024
-#define REG_AFE_PLL_CTRL 0x0028
-#define REG_MAC_PHY_CTRL 0x002C
-
-#define RF_CHNLBW 0x18
 
 #endif
diff --git a/drivers/staging/rtlwifi/phydm/phydm_regdefine11n.h b/drivers/staging/rtlwifi/phydm/phydm_regdefine11n.h
index 765e0a0c8c7b..565996828cab 100644
--- a/drivers/staging/rtlwifi/phydm/phydm_regdefine11n.h
+++ b/drivers/staging/rtlwifi/phydm/phydm_regdefine11n.h
@@ -15,188 +15,39 @@
 #ifndef __ODM_REGDEFINE11N_H__
 #define __ODM_REGDEFINE11N_H__
 
-/* 2 RF REG LIST */
-#define ODM_REG_RF_MODE_11N 0x00
-#define ODM_REG_RF_0B_11N 0x0B
-#define ODM_REG_CHNBW_11N 0x18
-#define ODM_REG_T_METER_11N 0x24
-#define ODM_REG_RF_25_11N 0x25
-#define ODM_REG_RF_26_11N 0x26
-#define ODM_REG_RF_27_11N 0x27
-#define ODM_REG_RF_2B_11N 0x2B
-#define ODM_REG_RF_2C_11N 0x2C
-#define ODM_REG_RXRF_A3_11N 0x3C
-#define ODM_REG_T_METER_92D_11N 0x42
-#define ODM_REG_T_METER_88E_11N 0x42
-
-/* 2 BB REG LIST */
-/* PAGE 8 */
-#define ODM_REG_BB_CTRL_11N 0x800
-#define ODM_REG_RF_PIN_11N 0x804
-#define ODM_REG_PSD_CTRL_11N 0x808
 #define ODM_REG_TX_ANT_CTRL_11N 0x80C
-#define ODM_REG_BB_PWR_SAV5_11N 0x818
-#define ODM_REG_CCK_RPT_FORMAT_11N 0x824
-#define ODM_REG_CCK_RPT_FORMAT_11N_B 0x82C
 #define ODM_REG_RX_DEFAULT_A_11N 0x858
-#define ODM_REG_RX_DEFAULT_B_11N 0x85A
-#define ODM_REG_BB_PWR_SAV3_11N 0x85C
 #define ODM_REG_ANTSEL_CTRL_11N 0x860
 #define ODM_REG_RX_ANT_CTRL_11N 0x864
 #define ODM_REG_PIN_CTRL_11N 0x870
-#define ODM_REG_BB_PWR_SAV1_11N 0x874
-#define ODM_REG_ANTSEL_PATH_11N 0x878
-#define ODM_REG_BB_3WIRE_11N 0x88C
 #define ODM_REG_SC_CNT_11N 0x8C4
-#define ODM_REG_PSD_DATA_11N 0x8B4
-#define ODM_REG_CCX_PERIOD_11N 0x894
-#define ODM_REG_NHM_TH9_TH10_11N 0x890
-#define ODM_REG_CLM_11N 0x890
-#define ODM_REG_NHM_TH3_TO_TH0_11N 0x898
-#define ODM_REG_NHM_TH7_TO_TH4_11N 0x89c
-#define ODM_REG_NHM_TH8_11N 0xe28
-#define ODM_REG_CLM_READY_11N 0x8b4
-#define ODM_REG_CLM_RESULT_11N 0x8d0
-#define ODM_REG_NHM_CNT_11N 0x8d8
-
-/* For struct acs_info, Jeffery, 2014-12-26 */
-#define ODM_REG_NHM_CNT7_TO_CNT4_11N 0x8dc
-#define ODM_REG_NHM_CNT9_TO_CNT8_11N 0x8d0
-#define ODM_REG_NHM_CNT10_TO_CNT11_11N 0x8d4
 
-/* PAGE 9 */
-#define ODM_REG_BB_CTRL_PAGE9_11N 0x900
-#define ODM_REG_DBG_RPT_11N 0x908
-#define ODM_REG_BB_TX_PATH_11N 0x90c
 #define ODM_REG_ANT_MAPPING1_11N 0x914
-#define ODM_REG_ANT_MAPPING2_11N 0x918
-#define ODM_REG_EDCCA_DOWN_OPT_11N 0x948
-#define ODM_REG_RX_DFIR_MOD_97F 0x948
 
-/* PAGE A */
 #define ODM_REG_CCK_ANTDIV_PARA1_11N 0xA00
-#define ODM_REG_CCK_ANT_SEL_11N 0xA04
 #define ODM_REG_CCK_CCA_11N 0xA0A
 #define ODM_REG_CCK_ANTDIV_PARA2_11N 0xA0C
-#define ODM_REG_CCK_ANTDIV_PARA3_11N 0xA10
-#define ODM_REG_CCK_ANTDIV_PARA4_11N 0xA14
-#define ODM_REG_CCK_FILTER_PARA1_11N 0xA22
-#define ODM_REG_CCK_FILTER_PARA2_11N 0xA23
-#define ODM_REG_CCK_FILTER_PARA3_11N 0xA24
-#define ODM_REG_CCK_FILTER_PARA4_11N 0xA25
-#define ODM_REG_CCK_FILTER_PARA5_11N 0xA26
-#define ODM_REG_CCK_FILTER_PARA6_11N 0xA27
-#define ODM_REG_CCK_FILTER_PARA7_11N 0xA28
-#define ODM_REG_CCK_FILTER_PARA8_11N 0xA29
 #define ODM_REG_CCK_FA_RST_11N 0xA2C
 #define ODM_REG_CCK_FA_MSB_11N 0xA58
 #define ODM_REG_CCK_FA_LSB_11N 0xA5C
 #define ODM_REG_CCK_CCA_CNT_11N 0xA60
 #define ODM_REG_BB_PWR_SAV4_11N 0xA74
-/* PAGE B */
+
 #define ODM_REG_LNA_SWITCH_11N 0xB2C
-#define ODM_REG_PATH_SWITCH_11N 0xB30
-#define ODM_REG_RSSI_CTRL_11N 0xB38
-#define ODM_REG_CONFIG_ANTA_11N 0xB68
-#define ODM_REG_RSSI_BT_11N 0xB9C
-#define ODM_REG_RXCK_RFMOD 0xBB0
-#define ODM_REG_EDCCA_DCNF_97F 0xBC0
 
-/* PAGE C */
 #define ODM_REG_OFDM_FA_HOLDC_11N 0xC00
-#define ODM_REG_BB_RX_PATH_11N 0xC04
-#define ODM_REG_TRMUX_11N 0xC08
-#define ODM_REG_OFDM_FA_RSTC_11N 0xC0C
-#define ODM_REG_DOWNSAM_FACTOR_11N 0xC10
-#define ODM_REG_RXIQI_MATRIX_11N 0xC14
-#define ODM_REG_TXIQK_MATRIX_LSB1_11N 0xC4C
 #define ODM_REG_IGI_A_11N 0xC50
-#define ODM_REG_ANTDIV_PARA2_11N 0xC54
-#define ODM_REG_IGI_B_11N 0xC58
-#define ODM_REG_ANTDIV_PARA3_11N 0xC5C
-#define ODM_REG_L1SBD_PD_CH_11N 0XC6C
-#define ODM_REG_BB_PWR_SAV2_11N 0xC70
-#define ODM_REG_BB_AGC_SET_2_11N 0xc74
-#define ODM_REG_RX_OFF_11N 0xC7C
-#define ODM_REG_TXIQK_MATRIXA_11N 0xC80
-#define ODM_REG_TXIQK_MATRIXB_11N 0xC88
-#define ODM_REG_TXIQK_MATRIXA_LSB2_11N 0xC94
-#define ODM_REG_TXIQK_MATRIXB_LSB2_11N 0xC9C
-#define ODM_REG_RXIQK_MATRIX_LSB_11N 0xCA0
 #define ODM_REG_ANTDIV_PARA1_11N 0xCA4
-#define ODM_REG_SMALL_BANDWIDTH_11N 0xCE4
 #define ODM_REG_OFDM_FA_TYPE1_11N 0xCF0
-/* PAGE D */
+
 #define ODM_REG_OFDM_FA_RSTD_11N 0xD00
-#define ODM_REG_BB_RX_ANT_11N 0xD04
-#define ODM_REG_BB_ATC_11N 0xD2C
 #define ODM_REG_OFDM_FA_TYPE2_11N 0xDA0
 #define ODM_REG_OFDM_FA_TYPE3_11N 0xDA4
 #define ODM_REG_OFDM_FA_TYPE4_11N 0xDA8
-#define ODM_REG_RPT_11N 0xDF4
-/* PAGE E */
-#define ODM_REG_TXAGC_A_6_18_11N 0xE00
-#define ODM_REG_TXAGC_A_24_54_11N 0xE04
-#define ODM_REG_TXAGC_A_1_MCS32_11N 0xE08
-#define ODM_REG_TXAGC_A_MCS0_3_11N 0xE10
-#define ODM_REG_TXAGC_A_MCS4_7_11N 0xE14
-#define ODM_REG_TXAGC_A_MCS8_11_11N 0xE18
-#define ODM_REG_TXAGC_A_MCS12_15_11N 0xE1C
-#define ODM_REG_EDCCA_DCNF_11N 0xE24
-#define ODM_REG_TAP_UPD_97F 0xE24
-#define ODM_REG_FPGA0_IQK_11N 0xE28
-#define ODM_REG_PAGE_B1_97F 0xE28
-#define ODM_REG_TXIQK_TONE_A_11N 0xE30
-#define ODM_REG_RXIQK_TONE_A_11N 0xE34
-#define ODM_REG_TXIQK_PI_A_11N 0xE38
-#define ODM_REG_RXIQK_PI_A_11N 0xE3C
-#define ODM_REG_TXIQK_11N 0xE40
-#define ODM_REG_RXIQK_11N 0xE44
-#define ODM_REG_IQK_AGC_PTS_11N 0xE48
-#define ODM_REG_IQK_AGC_RSP_11N 0xE4C
-#define ODM_REG_BLUETOOTH_11N 0xE6C
-#define ODM_REG_RX_WAIT_CCA_11N 0xE70
-#define ODM_REG_TX_CCK_RFON_11N 0xE74
-#define ODM_REG_TX_CCK_BBON_11N 0xE78
-#define ODM_REG_OFDM_RFON_11N 0xE7C
-#define ODM_REG_OFDM_BBON_11N 0xE80
-#define ODM_REG_TX2RX_11N 0xE84
-#define ODM_REG_TX2TX_11N 0xE88
-#define ODM_REG_RX_CCK_11N 0xE8C
-#define ODM_REG_RX_OFDM_11N 0xED0
-#define ODM_REG_RX_WAIT_RIFS_11N 0xED4
-#define ODM_REG_RX2RX_11N 0xED8
-#define ODM_REG_STANDBY_11N 0xEDC
-#define ODM_REG_SLEEP_11N 0xEE0
-#define ODM_REG_PMPD_ANAEN_11N 0xEEC
-/* PAGE F */
-#define ODM_REG_PAGE_F_RST_11N 0xF14
-#define ODM_REG_IGI_C_11N 0xF84
-#define ODM_REG_IGI_D_11N 0xF88
-#define ODM_REG_CCK_CRC32_ERROR_CNT_11N 0xF84
-#define ODM_REG_CCK_CRC32_OK_CNT_11N 0xF88
-#define ODM_REG_HT_CRC32_CNT_11N 0xF90
-#define ODM_REG_OFDM_CRC32_CNT_11N 0xF94
 
-/* 2 MAC REG LIST */
-#define ODM_REG_BB_RST_11N 0x02
 #define ODM_REG_ANTSEL_PIN_11N 0x4C
-#define ODM_REG_EARLY_MODE_11N 0x4D0
-#define ODM_REG_RSSI_MONITOR_11N 0x4FE
-#define ODM_REG_EDCA_VO_11N 0x500
-#define ODM_REG_EDCA_VI_11N 0x504
-#define ODM_REG_EDCA_BE_11N 0x508
-#define ODM_REG_EDCA_BK_11N 0x50C
-#define ODM_REG_TXPAUSE_11N 0x522
 #define ODM_REG_RESP_TX_11N 0x6D8
-#define ODM_REG_ANT_TRAIN_PARA1_11N 0x7b0
-#define ODM_REG_ANT_TRAIN_PARA2_11N 0x7b4
 
-/* DIG Related */
 #define ODM_BIT_IGI_11N 0x0000007F
-#define ODM_BIT_CCK_RPT_FORMAT_11N BIT(9)
-#define ODM_BIT_BB_RX_PATH_11N 0xF
-#define ODM_BIT_BB_TX_PATH_11N 0xF
-#define ODM_BIT_BB_ATC_11N BIT(11)
 
 #endif
-- 
2.21.0


[-- Attachment #3: 0002-staging-rtlwifi-move-remaining-phydm-.h-files.patch --]
[-- Type: text/plain, Size: 2135 bytes --]

From adc7af464ceba1962c2eb875a97f4d3bd82fbc5f Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Wed, 1 May 2019 10:40:10 +0200
Subject: [PATCH 2/2] staging: rtlwifi: move remaining phydm .h files

The rtl8188eu driver uses the phydm .h files from the rtlwifi driver,
but now that the rtlwifi driver is gone, it's silly to have a whole
directory for just 2 .h files.  So move these files into the rtl8188eu
driver's directory so that it can be self-contained.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/rtl8188eu/include/odm_precomp.h               | 4 ++--
 .../staging/{rtlwifi/phydm => rtl8188eu/include}/phydm_reg.h  | 0
 .../{rtlwifi/phydm => rtl8188eu/include}/phydm_regdefine11n.h | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename drivers/staging/{rtlwifi/phydm => rtl8188eu/include}/phydm_reg.h (100%)
 rename drivers/staging/{rtlwifi/phydm => rtl8188eu/include}/phydm_regdefine11n.h (100%)

diff --git a/drivers/staging/rtl8188eu/include/odm_precomp.h b/drivers/staging/rtl8188eu/include/odm_precomp.h
index 6efddc8f1675..df096c37f5eb 100644
--- a/drivers/staging/rtl8188eu/include/odm_precomp.h
+++ b/drivers/staging/rtl8188eu/include/odm_precomp.h
@@ -24,12 +24,12 @@
 #include "odm.h"
 #include "odm_hwconfig.h"
 #include "odm_debug.h"
-#include "../../rtlwifi/phydm/phydm_regdefine11n.h"
+#include "phydm_regdefine11n.h"
 
 #include "hal8188e_rate_adaptive.h" /* for RA,Power training */
 #include "rtl8188e_hal.h"
 
-#include "../../rtlwifi/phydm/phydm_reg.h"
+#include "phydm_reg.h"
 
 #include "odm_rtl8188e.h"
 
diff --git a/drivers/staging/rtlwifi/phydm/phydm_reg.h b/drivers/staging/rtl8188eu/include/phydm_reg.h
similarity index 100%
rename from drivers/staging/rtlwifi/phydm/phydm_reg.h
rename to drivers/staging/rtl8188eu/include/phydm_reg.h
diff --git a/drivers/staging/rtlwifi/phydm/phydm_regdefine11n.h b/drivers/staging/rtl8188eu/include/phydm_regdefine11n.h
similarity index 100%
rename from drivers/staging/rtlwifi/phydm/phydm_regdefine11n.h
rename to drivers/staging/rtl8188eu/include/phydm_regdefine11n.h
-- 
2.21.0


^ permalink raw reply related

* Re: [PATCH v9 00/14] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips
From: Greg KH @ 2019-05-01  8:19 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Stanislaw Gruszka, yhchuang, linux-wireless, johannes, pkshih,
	tehuang, Larry.Finger, briannorris
In-Reply-To: <87muk6odld.fsf@kamboji.qca.qualcomm.com>

On Wed, May 01, 2019 at 10:09:34AM +0300, Kalle Valo wrote:
> Greg KH <gregkh@linuxfoundation.org> writes:
> 
> > On Tue, Apr 30, 2019 at 07:47:13PM +0300, Kalle Valo wrote:
> >> Stanislaw Gruszka <sgruszka@redhat.com> writes:
> >> 
> >> > On Tue, Apr 30, 2019 at 03:40:02PM +0300, Kalle Valo wrote:
> >> >> > From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> >> >> >
> >> >> > This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
> >> >> > rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
> >> >> > functionalities. The firmware for both can be found at linux-firmware.
> >> >> 
> >> >> This looks very good now. I did a quick review of the driver and had few
> >> >> netpicks but nothing really blocking applying this. So I have now
> >> >> combined these patches into one big patch and pushed it to the pending
> >> >> branch:
> >> >> 
> >> >> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=284d1e4e3311cfe67c1c57ccc275ff0f5666aeea
> >> >> 
> >> >> I appreciate if people could do a quick check and make sure that I
> >> >> didn't do anything stupid when folding the patches.
> >> >
> >> > I've build pending branch and done few quick tests on Realtek
> >> > 8822CE device. Everything works ok.
> >> 
> >> Thanks so much for this, I now feel much more comfortable merging it :)
> >> 
> >> So this is manually applied to wireless-drivers-next:
> >> 
> >> e3037485c68e rtw88: new Realtek 802.11ac driver
> >> 
> >> And it should be in tomorrow's linux-next build, let's see what kind of
> >> reports we get. Greg, feel free to delete the corresponding staging
> >> driver from your tree (I forgot the name of the driver already).
> >
> > I'll be glad to do so if someone also tells me what the driver's name is
> > as well, I don't remember either :)
> 
> I checked it now, the directory is drivers/staging/rtlwifi. Here's the
> commit adding the upstream driver, in case you need that in the commit
> log:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=e3037485c68ec1a299ff41160d8fedbd4abc29b9

Thanks for this, now dropped from my tree (with the exception of 2 .h
files which a different driver used, and I'll clean that up as well with
a later patch.)

Note, the diffstat involved here shows that a "proper" Linux driver that
is merged into the kernel tree follows the rule-of-thumb that I have
consistently seen over time.  An in-tree driver that has been reviewed
properly is 33% of the size of an "out of tree" driver.  It's always
nice to see users benefit from properly developed drivers like this.

thanks,

greg k-h

^ permalink raw reply

* Re: carl9170 crash
From: Kalle Valo @ 2019-05-01  7:19 UTC (permalink / raw)
  To: whiteheadm; +Cc: Christian Lamparter, linux-wireless
In-Reply-To: <CAP8WD_bTvWWTeh6BP_qgByiuWLbSN==CTBY1KD-v8XpWZkf_Rw@mail.gmail.com>

tedheadster <tedheadster@gmail.com> writes:

>   I am getting this crash for the carl9170 in recent kernels, though I
> have not yet bisected it. It hangs the networking system completely
> (ifconfig -a never returns) and it prevents a reboot. I have to use
> sysrq-b to 'cleanly' reboot the system.
>
> I can apply and test any patches.

What was the last working version?

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH v9 00/14] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips
From: Kalle Valo @ 2019-05-01  7:09 UTC (permalink / raw)
  To: Greg KH
  Cc: Stanislaw Gruszka, yhchuang, linux-wireless, johannes, pkshih,
	tehuang, Larry.Finger, briannorris
In-Reply-To: <20190430174234.GA16336@kroah.com>

Greg KH <gregkh@linuxfoundation.org> writes:

> On Tue, Apr 30, 2019 at 07:47:13PM +0300, Kalle Valo wrote:
>> Stanislaw Gruszka <sgruszka@redhat.com> writes:
>> 
>> > On Tue, Apr 30, 2019 at 03:40:02PM +0300, Kalle Valo wrote:
>> >> > From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>> >> >
>> >> > This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
>> >> > rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
>> >> > functionalities. The firmware for both can be found at linux-firmware.
>> >> 
>> >> This looks very good now. I did a quick review of the driver and had few
>> >> netpicks but nothing really blocking applying this. So I have now
>> >> combined these patches into one big patch and pushed it to the pending
>> >> branch:
>> >> 
>> >> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=284d1e4e3311cfe67c1c57ccc275ff0f5666aeea
>> >> 
>> >> I appreciate if people could do a quick check and make sure that I
>> >> didn't do anything stupid when folding the patches.
>> >
>> > I've build pending branch and done few quick tests on Realtek
>> > 8822CE device. Everything works ok.
>> 
>> Thanks so much for this, I now feel much more comfortable merging it :)
>> 
>> So this is manually applied to wireless-drivers-next:
>> 
>> e3037485c68e rtw88: new Realtek 802.11ac driver
>> 
>> And it should be in tomorrow's linux-next build, let's see what kind of
>> reports we get. Greg, feel free to delete the corresponding staging
>> driver from your tree (I forgot the name of the driver already).
>
> I'll be glad to do so if someone also tells me what the driver's name is
> as well, I don't remember either :)

I checked it now, the directory is drivers/staging/rtlwifi. Here's the
commit adding the upstream driver, in case you need that in the commit
log:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=e3037485c68ec1a299ff41160d8fedbd4abc29b9

-- 
Kalle Valo

^ permalink raw reply

* carl9170 crash
From: tedheadster @ 2019-05-01  2:46 UTC (permalink / raw)
  To: Christian Lamparter, linux-wireless

Christian,
  I am getting this crash for the carl9170 in recent kernels, though I
have not yet bisected it. It hangs the networking system completely
(ifconfig -a never returns) and it prevents a reboot. I have to use
sysrq-b to 'cleanly' reboot the system.

I can apply and test any patches.

usbcore: registered new interface driver carl9170
usb 1-1: driver   API: 1.9.9 2016-02-15 [1-1]
usb 1-1: firmware API: 1.9.6 2012-07-07
ath: EEPROM regdomain: 0x3a
ath: EEPROM indicates we should expect a direct regpair map
ath: Country alpha2 being used: BM
ath: Regpair used: 0x3a
PREEMPT
CPU: 0 PID: 44 Comm: kworker/0:2 Not tainted 5.1.0-rc7.pentiumii-laptop #1446
Workqueue: events request_firmware_work_func
EIP: nl80211_send_wiphy+0x558/0x1a58 [cfg80211]
Code: 0f 85 73 02 00 00 80 7f 16 00 75 0c 80 7f 2c 00 0f 84 a4 00 00
00 eb 6a 8d 47 19 ba 03 00 00 00 50 b9 10 00 00 00 8b 75 bc c9 <f0> e8
2a ae 81 f8 5a cd c0 0f 85 5d 14 00 00 4d b7 4f 14 ba 04 00
EAX: c891205d EBX: c4a76000 ECX: 00000010 EDX: 00000003
ESI: c76fa5a0 EDI: c8912044 EBP: c036de14 ESP: c036ddd4
DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010202
CR0: 80050033 CR2: b716c540 CR3: 07618000 CR4: 00000290
Call Trace:
 ? nl80211_notify_wiphy+0x52/0x84 [cfg80211]
 wiphy_register+0x303/0x624 [cfg80211]
 ? ieee80211_register_hw+0x325/0x94a [mac80211]
 ? __kmalloc+0x8c/0x9c
 ? ieee80211_cs_list_valid+0xb/0x31 [mac80211]
 ieee80211_register_hw+0x68f/0x94a [mac80211]
 ? ath_reg_apply_radar_flags.isra.4+0xb/0x62 [ath]
 ? ath_reg_apply_world_flags+0xa/0xba [ath]
 ? ath_regd_init+0xd8/0xec [ath]
 ? carl9170_op_bss_info_changed+0x16a/0x16a [carl9170]
 carl9170_register+0x1f5/0x36d [carl9170]
 ? carl9170_register+0x1f5/0x36d [carl9170]
 carl9170_usb_firmware_step2+0x226/0x251 [carl9170]
 request_firmware_work_func+0x2a/0x51
 process_one_work+0x134/0x260
 worker_thread+0x18b/0x24a
 kthread+0xcd/0xcf
 ? cancel_delayed_work_sync+0x14/0x14
 ? kthread_create_worker_on_cpu+0x1c/0x1c
 ret_from_fork+0x19/0x24
Modules linked in: carl9170 mac80211 ath cfg80211 r8169 realtek libphy
rfkill uhci_hcd ehci_pci ehci_hcd pcmcia usbcore i2c_piix4 i2c_core
usb_common yenta_socket pcmcia_rsrc pcmcia_core autofs4
---[ end trace dbf0bc816dabbb51 ]---
EIP: nl80211_send_wiphy+0x558/0x1a58 [cfg80211]
Code: 0f 85 73 02 00 00 80 7f 16 00 75 0c 80 7f 2c 00 0f 84 a4 00 00
00 eb 6a 8d 47 19 ba 03 00 00 00 50 b9 10 00 00 00 8b 75 bc c9 <f0> e8
2a ae 81 f8 5a cd c0 0f 85 5d 14 00 00 4d b7 4f 14 ba 04 00
EAX: c891205d EBX: c4a76000 ECX: 00000010 EDX: 00000003
ESI: c76fa5a0 EDI: c8912044 EBP: c036de14 ESP: c15b02b8
DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010202
CR0: 80050033 CR2: b7271500 CR3: 0770f000 CR4: 00000290
r8169 0000:06:00.0 enp6s0: Link is Up - 1Gbps/Full - flow control rx/tx

- Matthew Whitehead

^ permalink raw reply

* Re: [PATCH v9 00/14] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips
From: Greg KH @ 2019-04-30 17:42 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Stanislaw Gruszka, yhchuang, linux-wireless, johannes, pkshih,
	tehuang, Larry.Finger, briannorris
In-Reply-To: <87v9yvo2y6.fsf@kamboji.qca.qualcomm.com>

On Tue, Apr 30, 2019 at 07:47:13PM +0300, Kalle Valo wrote:
> Stanislaw Gruszka <sgruszka@redhat.com> writes:
> 
> > On Tue, Apr 30, 2019 at 03:40:02PM +0300, Kalle Valo wrote:
> >> > From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> >> >
> >> > This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
> >> > rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
> >> > functionalities. The firmware for both can be found at linux-firmware.
> >> 
> >> This looks very good now. I did a quick review of the driver and had few
> >> netpicks but nothing really blocking applying this. So I have now
> >> combined these patches into one big patch and pushed it to the pending
> >> branch:
> >> 
> >> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=284d1e4e3311cfe67c1c57ccc275ff0f5666aeea
> >> 
> >> I appreciate if people could do a quick check and make sure that I
> >> didn't do anything stupid when folding the patches.
> >
> > I've build pending branch and done few quick tests on Realtek
> > 8822CE device. Everything works ok.
> 
> Thanks so much for this, I now feel much more comfortable merging it :)
> 
> So this is manually applied to wireless-drivers-next:
> 
> e3037485c68e rtw88: new Realtek 802.11ac driver
> 
> And it should be in tomorrow's linux-next build, let's see what kind of
> reports we get. Greg, feel free to delete the corresponding staging
> driver from your tree (I forgot the name of the driver already).

I'll be glad to do so if someone also tells me what the driver's name is
as well, I don't remember either :)

thanks,

greg k-h

^ permalink raw reply

* Re: pull-request: wireless-drivers 2019-04-30
From: Kalle Valo @ 2019-04-30 16:55 UTC (permalink / raw)
  To: David Miller; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20190430.120117.1616322040923778364.davem@davemloft.net>

David Miller <davem@davemloft.net> writes:

> From: Kalle Valo <kvalo@codeaurora.org>
> Date: Tue, 30 Apr 2019 18:10:01 +0300
>
>> here's one more pull request to net tree for 5.1, more info below.
>> 
>> Also note that this pull conflicts with net-next. And I want to emphasie
>> that it's really net-next, so when you pull this to net tree it should
>> go without conflicts. Stephen reported the conflict here:
>> 
>> https://lkml.kernel.org/r/20190429115338.5decb50b@canb.auug.org.au
>> 
>> In iwlwifi oddly commit 154d4899e411 adds the IS_ERR_OR_NULL() in
>> wireless-drivers but commit c9af7528c331 removes the whole check in
>> wireless-drivers-next. The fix is easy, just drop the whole check for
>> mvmvif->dbgfs_dir in iwlwifi/mvm/debugfs-vif.c, it's unneeded anyway.
>> 
>> As usual, please let me know if you have any problems.
>
> Pulled, thanks Kalle.

Great, thanks.

> Thanks for the conflict resolution information, it is very helpful.
>
> However, can you put it into the merge commit text next time as well?
> I cut and pasted it in there when I pulled this stuff in.

A good idea, I'll do that. Just to be sure, do you mean that I should
add it only with conflicts between net and net-next (like in this case)?
Or should I add it everytime I see a conflict, for example between
wireless-drivers-next and net-next? I hope my question is not too
confusing...

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH v9 00/14] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips
From: Kalle Valo @ 2019-04-30 16:47 UTC (permalink / raw)
  To: Stanislaw Gruszka
  Cc: yhchuang, linux-wireless, johannes, pkshih, tehuang, Larry.Finger,
	briannorris, gregkh
In-Reply-To: <20190430155808.GA3019@redhat.com>

Stanislaw Gruszka <sgruszka@redhat.com> writes:

> On Tue, Apr 30, 2019 at 03:40:02PM +0300, Kalle Valo wrote:
>> > From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>> >
>> > This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
>> > rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
>> > functionalities. The firmware for both can be found at linux-firmware.
>> 
>> This looks very good now. I did a quick review of the driver and had few
>> netpicks but nothing really blocking applying this. So I have now
>> combined these patches into one big patch and pushed it to the pending
>> branch:
>> 
>> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=284d1e4e3311cfe67c1c57ccc275ff0f5666aeea
>> 
>> I appreciate if people could do a quick check and make sure that I
>> didn't do anything stupid when folding the patches.
>
> I've build pending branch and done few quick tests on Realtek
> 8822CE device. Everything works ok.

Thanks so much for this, I now feel much more comfortable merging it :)

So this is manually applied to wireless-drivers-next:

e3037485c68e rtw88: new Realtek 802.11ac driver

And it should be in tomorrow's linux-next build, let's see what kind of
reports we get. Greg, feel free to delete the corresponding staging
driver from your tree (I forgot the name of the driver already).

-- 
Kalle Valo

^ permalink raw reply

* Re: pull-request: wireless-drivers 2019-04-30
From: David Miller @ 2019-04-30 16:01 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <8736lzpm0m.fsf@kamboji.qca.qualcomm.com>

From: Kalle Valo <kvalo@codeaurora.org>
Date: Tue, 30 Apr 2019 18:10:01 +0300

> here's one more pull request to net tree for 5.1, more info below.
> 
> Also note that this pull conflicts with net-next. And I want to emphasie
> that it's really net-next, so when you pull this to net tree it should
> go without conflicts. Stephen reported the conflict here:
> 
> https://lkml.kernel.org/r/20190429115338.5decb50b@canb.auug.org.au
> 
> In iwlwifi oddly commit 154d4899e411 adds the IS_ERR_OR_NULL() in
> wireless-drivers but commit c9af7528c331 removes the whole check in
> wireless-drivers-next. The fix is easy, just drop the whole check for
> mvmvif->dbgfs_dir in iwlwifi/mvm/debugfs-vif.c, it's unneeded anyway.
> 
> As usual, please let me know if you have any problems.

Pulled, thanks Kalle.

Thanks for the conflict resolution information, it is very helpful.

However, can you put it into the merge commit text next time as well?
I cut and pasted it in there when I pulled this stuff in.

Thanks!

^ permalink raw reply

* Re: [PATCH v9 00/14] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips
From: Stanislaw Gruszka @ 2019-04-30 15:58 UTC (permalink / raw)
  To: Kalle Valo
  Cc: yhchuang, linux-wireless, johannes, pkshih, tehuang, Larry.Finger,
	briannorris, gregkh
In-Reply-To: <87sgtzwtst.fsf@purkki.adurom.net>

On Tue, Apr 30, 2019 at 03:40:02PM +0300, Kalle Valo wrote:
> > From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> >
> > This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
> > rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
> > functionalities. The firmware for both can be found at linux-firmware.
> 
> This looks very good now. I did a quick review of the driver and had few
> netpicks but nothing really blocking applying this. So I have now
> combined these patches into one big patch and pushed it to the pending
> branch:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=284d1e4e3311cfe67c1c57ccc275ff0f5666aeea
> 
> I appreciate if people could do a quick check and make sure that I
> didn't do anything stupid when folding the patches.

I've build pending branch and done few quick tests on Realtek
8822CE device. Everything works ok.

> I'm planning to
> apply this to master branch still today evening so that it makes to
> tomorrow's linux-next build, and I can get it to net-next before the
> merge window starts on Sunday.

Yay! Great :-)

Stanislaw

^ permalink raw reply

* [PATCH] mt76: mt7603: dynamically alloc mcu req in mt7603_mcu_set_eeprom
From: Lorenzo Bianconi @ 2019-04-30 15:17 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless
In-Reply-To: <cover.1556637012.git.lorenzo@kernel.org>

Do not allocate mcu requests on the stack in mt7603_mcu_set_eeprom
in order to avoid the following warning:

Warning: the frame size of 1032 bytes is larger than 1024 bytes
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 .../net/wireless/mediatek/mt76/mt7603/mcu.c   | 30 ++++++++++++-------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
index 766d968671b3..6357b5658a32 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
@@ -354,24 +354,34 @@ int mt7603_mcu_set_eeprom(struct mt7603_dev *dev)
 		u8 buffer_mode;
 		u8 len;
 		u8 pad[2];
-		struct req_data data[255];
-	} req = {
+	} req_hdr = {
 		.buffer_mode = 1,
 		.len = ARRAY_SIZE(req_fields) - 1,
 	};
-	u8 *eep = (u8 *)dev->mt76.eeprom.data;
-	int i;
+	const int size = 0xff * sizeof(struct req_data);
+	u8 *req, *eep = (u8 *)dev->mt76.eeprom.data;
+	int i, ret, len = sizeof(req_hdr) + size;
+	struct req_data *data;
 
-	BUILD_BUG_ON(ARRAY_SIZE(req_fields) > ARRAY_SIZE(req.data));
+	BUILD_BUG_ON(ARRAY_SIZE(req_fields) * sizeof(*data) > size);
+
+	req = kmalloc(len, GFP_KERNEL);
+	if (!req)
+		return -ENOMEM;
 
+	memcpy(req, &req_hdr, sizeof(req_hdr));
+	data = (struct req_data *)(req + sizeof(req_hdr));
+	memset(data, 0, size);
 	for (i = 0; i < ARRAY_SIZE(req_fields); i++) {
-		req.data[i].addr = cpu_to_le16(req_fields[i]);
-		req.data[i].val = eep[req_fields[i]];
-		req.data[i].pad = 0;
+		data[i].addr = cpu_to_le16(req_fields[i]);
+		data[i].val = eep[req_fields[i]];
 	}
 
-	return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EFUSE_BUFFER_MODE,
-				   &req, sizeof(req), true);
+	ret = __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EFUSE_BUFFER_MODE,
+				  req, len, true);
+	kfree(req);
+
+	return ret;
 }
 
 static int mt7603_mcu_set_tx_power(struct mt7603_dev *dev)
-- 
2.20.1


^ permalink raw reply related

* pull-request: wireless-drivers 2019-04-30
From: Kalle Valo @ 2019-04-30 15:10 UTC (permalink / raw)
  To: David Miller; +Cc: linux-wireless, netdev, linux-kernel

Hi Dave,

here's one more pull request to net tree for 5.1, more info below.

Also note that this pull conflicts with net-next. And I want to emphasie
that it's really net-next, so when you pull this to net tree it should
go without conflicts. Stephen reported the conflict here:

https://lkml.kernel.org/r/20190429115338.5decb50b@canb.auug.org.au

In iwlwifi oddly commit 154d4899e411 adds the IS_ERR_OR_NULL() in
wireless-drivers but commit c9af7528c331 removes the whole check in
wireless-drivers-next. The fix is easy, just drop the whole check for
mvmvif->dbgfs_dir in iwlwifi/mvm/debugfs-vif.c, it's unneeded anyway.

As usual, please let me know if you have any problems.

Kalle

The following changes since commit 614c70f35cd77a9af8e2ca841dcdb121cec3068f:

  bnx2x: fix spelling mistake "dicline" -> "decline" (2019-04-15 17:23:09 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git tags/wireless-drivers-for-davem-2019-04-30

for you to fetch changes up to 7a0f8ad5ff6323dd8badfeb01d338db146569976:

  Merge ath-current from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git (2019-04-29 19:33:33 +0300)

----------------------------------------------------------------
wireless-drivers fixes for 5.1

Third set of fixes for 5.1.

iwlwifi

* fix an oops when creating debugfs entries

* fix bug when trying to capture debugging info while in rfkill

* prevent potential uninitialized memory dumps into debugging logs

* fix some initialization parameters for AX210 devices

* fix an oops with non-MSIX devices

* fix an oops when we receive a packet with bogus lengths

* fix a bug that prevented 5350 devices from working

* fix a small merge damage from the previous series

mwifiex

* fig regression with resume on SDIO

ath10k

* fix locking problem with crashdump

* fix warnings during suspend and resume

----------------------------------------------------------------
Brian Norris (1):
      ath10k: perform crash dump collection in workqueue

Douglas Anderson (1):
      mwifiex: Make resume actually do something useful again on SDIO cards

Emmanuel Grumbach (1):
      iwlwifi: fix driver operation for 5350

Greg Kroah-Hartman (1):
      iwlwifi: mvm: properly check debugfs dentry before using it

Johannes Berg (1):
      iwlwifi: mvm: don't attempt debug collection in rfkill

Kalle Valo (3):
      Merge tag 'iwlwifi-for-kalle-2019-04-19' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
      Merge tag 'iwlwifi-for-kalle-2019-04-28' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
      Merge ath-current from git://git.kernel.org/.../kvalo/ath.git

Luca Coelho (2):
      iwlwifi: mvm: check for length correctness in iwl_mvm_create_skb()
      iwlwifi: mvm: fix merge damage in iwl_mvm_vif_dbgfs_register()

Rafael J. Wysocki (1):
      ath10k: Drop WARN_ON()s that always trigger during system resume

Shahar S Matityahu (2):
      iwlwifi: don't panic in error path on non-msix systems
      iwlwifi: dbg_ini: check debug TLV type explicitly

Shaul Triebitz (1):
      iwlwifi: cfg: use family 22560 based_params for AX210 family

 drivers/net/wireless/ath/ath10k/ce.c               |  2 +-
 drivers/net/wireless/ath/ath10k/core.c             |  1 +
 drivers/net/wireless/ath/ath10k/core.h             |  3 +++
 drivers/net/wireless/ath/ath10k/coredump.c         |  6 ++---
 drivers/net/wireless/ath/ath10k/mac.c              |  4 ++--
 drivers/net/wireless/ath/ath10k/pci.c              | 24 +++++++++++++++----
 drivers/net/wireless/ath/ath10k/pci.h              |  2 ++
 drivers/net/wireless/intel/iwlwifi/cfg/22000.c     |  2 +-
 drivers/net/wireless/intel/iwlwifi/cfg/5000.c      |  3 ++-
 drivers/net/wireless/intel/iwlwifi/fw/file.h       | 15 +++++++-----
 drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c   |  3 ++-
 .../net/wireless/intel/iwlwifi/mvm/debugfs-vif.c   |  3 +--
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c        |  4 +++-
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c       |  2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c      | 28 ++++++++++++++++++----
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c    | 19 ++++++++++-----
 drivers/net/wireless/marvell/mwifiex/sdio.c        |  2 +-
 17 files changed, 88 insertions(+), 35 deletions(-)

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox