Skip to contentSkip to conversation

net: e1000e: solve insmod 'Unknown symbol mutex_lock' error

PATCH In review Hao Chen 2 participants 2 messages Sep 17, 2021

Subsystems (3)
lore
Share & tools
lore

Hao Chen

author
#0 lore raw

PATCH 1/1 net: e1000e: solve insmod 'Unknown symbol mutex_lock' error

After I turn on the CONFIG_LOCK_STAT=y, insmod e1000e.ko will report:

[    5.641579] e1000e: Unknown symbol mutex_lock (err -2)
[   90.775705] e1000e: Unknown symbol mutex_lock (err -2)
[  132.252339] e1000e: Unknown symbol mutex_lock (err -2)

This problem fixed after include <linux/mutex.h>.

---
 drivers/net/ethernet/intel/e1000e/e1000.h | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/e1000e/e1000.h +1 -0
index 5b2143f4b1f8..f3424255bd2b 100644
@@ -21,6 +21,7 @@
 #include <linux/ptp_classify.h>
 #include <linux/mii.h>
 #include <linux/mdio.h>
+#include <linux/mutex.h>
 #include <linux/pm_qos.h>
 #include "hw.h"
 
Signature · 1 line
2.20.1
#1 lore raw
Quoted 6 lines · Hao Chen

After I turn on the CONFIG_LOCK_STAT=y, insmod e1000e.ko will report:

[    5.641579] e1000e: Unknown symbol mutex_lock (err -2)
[   90.775705] e1000e: Unknown symbol mutex_lock (err -2)
[  132.252339] e1000e: Unknown symbol mutex_lock (err -2)

This problem fixed after include <linux/mutex.h>.

Thanks for taking the time to send a patch.
Why do you think including a file will fix this? That error is usually the user's fault for trying to use insmod which doesn't check module dependencies.

The advice I usually give is to try modprobe instead, does the problem still occur without this patch and just using modprobe?