diff mbox series

[23/47] patches: Remove usage of threaded NAPI from mt76

Message ID 20211019214320.2035704-24-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 5.15-rc6 | expand

Commit Message

Hauke Mehrtens Oct. 19, 2021, 9:42 p.m. UTC
mt76 uses threaded napi which was introduced in kernel 5.12, it is hard
to backport this, so just remove usage from mt76 in older kernel
versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0101-net_device-threaded/mt76.patch | 41 +++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 patches/0101-net_device-threaded/mt76.patch
diff mbox series

Patch

diff --git a/patches/0101-net_device-threaded/mt76.patch b/patches/0101-net_device-threaded/mt76.patch
new file mode 100644
index 00000000..0aef6a1b
--- /dev/null
+++ b/patches/0101-net_device-threaded/mt76.patch
@@ -0,0 +1,41 @@ 
+--- a/drivers/net/wireless/mediatek/mt76/debugfs.c
++++ b/drivers/net/wireless/mediatek/mt76/debugfs.c
+@@ -25,6 +25,7 @@ mt76_reg_get(void *data, u64 *val)
+ DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt76_reg_get, mt76_reg_set,
+ 			 "0x%08llx\n");
+ 
++#if LINUX_VERSION_IS_GEQ(5,12,0)
+ static int
+ mt76_napi_threaded_set(void *data, u64 val)
+ {
+@@ -50,6 +51,7 @@ mt76_napi_threaded_get(void *data, u64 *
+ 
+ DEFINE_DEBUGFS_ATTRIBUTE(fops_napi_threaded, mt76_napi_threaded_get,
+ 			 mt76_napi_threaded_set, "%llu\n");
++#endif
+ 
+ int mt76_queues_read(struct seq_file *s, void *data)
+ {
+@@ -128,8 +130,10 @@ struct dentry *mt76_register_debugfs(str
+ 	debugfs_create_u32("regidx", 0600, dir, &dev->debugfs_reg);
+ 	debugfs_create_file_unsafe("regval", 0600, dir, dev,
+ 				   &fops_regval);
++#if LINUX_VERSION_IS_GEQ(5,12,0)
+ 	debugfs_create_file_unsafe("napi_threaded", 0600, dir, dev,
+ 				   &fops_napi_threaded);
++#endif
+ 	debugfs_create_blob("eeprom", 0400, dir, &dev->eeprom);
+ 	if (dev->otp.data)
+ 		debugfs_create_blob("otp", 0400, dir, &dev->otp);
+--- a/drivers/net/wireless/mediatek/mt76/dma.c
++++ b/drivers/net/wireless/mediatek/mt76/dma.c
+@@ -643,7 +643,9 @@ mt76_dma_init(struct mt76_dev *dev,
+ 	init_dummy_netdev(&dev->tx_napi_dev);
+ 	snprintf(dev->napi_dev.name, sizeof(dev->napi_dev.name), "%s",
+ 		 wiphy_name(dev->hw->wiphy));
++#if LINUX_VERSION_IS_GEQ(5,12,0)
+ 	dev->napi_dev.threaded = 1;
++#endif
+ 
+ 	mt76_for_each_q_rx(dev, i) {
+ 		netif_napi_add(&dev->napi_dev, &dev->napi[i], poll, 64);