LorenzoBianconi/mt76

__tracepoint_reg_* undefined! and Unknown symbol __tracepoint_reg_* issuse

Closed this issue · 9 comments

@LorenzoBianconi Hello again, after about a month later, now I can test the driver again(using the latest source mt76x2u_testing) on Ubuntu and openwrt,

but when I compile the driver on
Ubuntu 16.04 with kernel 4.13.0-43 ,the WARNING is

WARNING: "__tracepoint_reg_rr" [/home/myname/src//mt76-usb.ko] undefined!
WARNING: "__tracepoint_reg_wr" [/home/myname/src//mt76-usb.ko] undefined!

After install the modules and Insert the dongle the Error apperas

[  469.664087] usb 3-5: new high-speed USB device number 5 using xhci_hcd
[  469.805497] usb 3-5: New USB device found, idVendor=0846, idProduct=9053
[  469.805499] usb 3-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  469.805500] usb 3-5: Product: A6210
[  469.805501] usb 3-5: Manufacturer: NETGEAR
[  469.805502] usb 3-5: SerialNumber: 100
[  470.828483] mt76_usb: Unknown symbol __tracepoint_reg_wr (err 0)
[  470.828532] mt76_usb: Unknown symbol __tracepoint_reg_rr (err 0)

The same as on openwrt (EA4500 / Linux kernel 4.14.48 )

[    8.438201] mt76_usb: Unknown symbol __tracepoint_reg_wr (err 0)
[    8.444352] mt76_usb: Unknown symbol __tracepoint_reg_rr (err 0)

I don not know any about linux trace ,so I can not found a solution, is there any way to fix this?
Thank you.

@LorenzoBianconi No,I‘m not compile the kernel myself on Ubuntu, and on openwrt it seems enable
TRACING_SUPPORT make no sense. So I wonder if trace is just for debugging, could we add a debug switch , after all, for users like me, they don't know how to compile a kernel or enable some function in kernel.

@cyangy could you please try latest version of mt76x2u branch?

@LorenzoBianconi My pleasure.

@LorenzoBianconi I have tested the latest mt76x2u branch on both Ubuntu 16.04 (kernel 4.13.0-43) and latest Openwrt, When compile use openwrt sdk everything work well,but when compile on ubuntu , the Error

In file included from /home/myname/src/mac80211.c:17:0:
/home/myname/src/mt76.h:579:5: warning: "LINUX_VERSION_CODE" is not defined [-Wundef]
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
     ^
/home/myname/src/mt76.h:579:26: warning: "KERNEL_VERSION" is not defined [-Wundef]
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
                          ^

And

/home/myname/src/mt76x2_eeprom.c:669:16: error: expected declaration specifiers or ‘...’ before string constant
 MODULE_LICENSE("Dual BSD/GPL");
                ^

And

/home/myname/src/usb.c:702:15: error: expected declaration specifiers or ‘...’ before string constant
 MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>");
               ^
/home/myname/src/usb.c:703:16: error: expected declaration specifiers or ‘...’ before string constant
 MODULE_LICENSE("Dual BSD/GPL");
                ^

So I apply these patches to src

diff -Nur a/mt76.h b/mt76.h
--- a/mt76.h	2018-06-10 05:13:57.575071000 +0800
+++ b/mt76.h	2018-06-10 05:34:37.243025950 +0800
@@ -26,6 +26,12 @@
 #include <net/mac80211.h>
 #include "util.h"

+//  fix error
+//src/mt76.h:579:40: error: missing binary operator before token "("
+// #if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
+ 
+#include <linux/version.h>
+
 #define MT_TX_RING_SIZE     256
 #define MT_MCU_RING_SIZE    32
 #define MT_RX_BUF_SIZE      2048
diff -Nur a/mt76x2_eeprom.c b/mt76x2_eeprom.c
--- a/mt76x2_eeprom.c	2018-06-10 05:13:57.579071000 +0800
+++ b/mt76x2_eeprom.c	2018-06-10 05:39:39.639014867 +0800
@@ -18,6 +18,11 @@
 #include "mt76x2.h"
 #include "mt76x2_eeprom.h"
 
+
+// fix  mt76x2_eeprom.c:669:16: error: expected declaration specifiers or ‘...’ before string constant
+#include <linux/module.h>
+
+
 #define EE_FIELD(_name, _value) [MT_EE_##_name] = (_value) | 1
 
 static int
diff -Nur a/usb.c b/usb.c
--- a/usb.c	2018-06-10 05:13:57.579071000 +0800
+++ b/usb.c	2018-06-10 05:40:38.939012694 +0800
@@ -18,6 +18,10 @@
 #include "usb_trace.h"
 #include "dma.h"
 
+// fix  src/usb.c:702:15: error: expected declaration specifiers or ‘...’ before string constant
+// MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>");
+#include <linux/module.h>
+
 #define MT_VEND_REQ_MAX_RETRY	10
 #define MT_VEND_REQ_TOUT_MS	300

then it compiled successfully. Also ,after apply these patch ,openwrt sdk can still compile the module successfully. So , should we apply these patch to the mt76xu source?

Now both openwrt and ubuntu work with the mt76xu module very well. After 10 hours running and about 50GB data transfered (100Mbps bandwidth / 100Mbps speed), no any error or warning apperas in the dmesg.
So,today I can confirm that the mt76x2u branch STA mode is totally work well now .
Great work,Thank you! 🥇

@LorenzoBianconi I just use usb2.0 port.

@cyangy Can I close the issue?

@LorenzoBianconi Of course.Thanks.