0

Recently I had a problem with my wifi adapter, where the solution was to blacklist ideapad_laptop in the file /etc/modprobe.d/blacklist.conf.

That got me wondering how the modules are assigned. My laptop is not an Ideapad, and the wifi adapter is a Realtek Semiconductor Co., Ltd. RTL8111/8168/8411. How would I ever have guessed that? Beyond that, lets say I do lsmod and get my list of drivers (modules).

...
coretemp               16384  0
joydev                 24576  0
kvm_intel             204800  0
snd_seq_midi           16384  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            32768  1 snd_seq_midi
kvm                   593920  1 kvm_intel
bnep                   20480  2
hid_multitouch         20480  0
8250_dw                16384  0
irqbypass              16384  1 kvm
snd_seq                65536  2 snd_seq_midi_event,snd_seq_midi
crct10dif_pclmul       16384  0
crc32_pclmul           16384  0
snd_seq_device         16384  3 snd_seq,snd_rawmidi,snd_seq_midi
ghash_clmulni_intel    16384  0
intel_wmi_thunderbolt    16384  0
wmi_bmof               16384  0
arc4                   16384  2
snd_timer              32768  2 snd_seq,snd_pcm
pcbc                   16384  0
uvcvideo               86016  0
...

A friend of mine has an HP laptop, with the same Realtek wireless adapter as I have, and his wifi is also not working. could he blacklist ideapad_lenovo and get the same result? I would guess not.

How would someone find a kernel module that is causing problems?

Zanna
  • 70,465
j0h
  • 14,825
  • 1
    See https://askubuntu.com/q/1124641/295286 If you know the hardware, you can find the corresponding module, though modules may or may not load/depend on other modules. If your question is "How does kernel know X hardware needs Y module" then it's somewhat different type of question, and depends on the hardware. Things that use I2C bus, for example, have specific ID assigned to them. USB devices expose their model/maker when queried. – Sergiy Kolodyazhnyy Mar 31 '19 at 03:13
  • 1
    AS for ideapad_laptop that module is for ACPI things on IdeaPad, and you'll see it matches DMI of your computer. So I guess for some odd reason your laptop has DMI table which matches one of the many Lenovos listed in the driver source code – Sergiy Kolodyazhnyy Mar 31 '19 at 03:20
  • @SergiyKolodyazhnyy, I assume the modules are loaded in part at installation, but would a different brand computer have the same module such as ideapad_laptop? would an HP Elitebook be called elitebook_laptop? or some other model of that brand? how would I, or anyone else guess which modules to blacklist if things dont work? how would I or anyone else even guess that a given module is cause of conflict or dysfunction? I know my wifi adapter is a realtek, and I knew it wasnt working... but what logical step could I take to solve similar issues in the future? – j0h Mar 31 '19 at 05:10
  • 1
    Yes, it is possible. Modules aren't tied to a brand of computer. They are for specific hardware, and often similar hardware can use the same module. Doesn't particularly matter what laptop I have, the wifi adapter in question matters. Also the name ideapad_laptop is probably a bad naming choice, but that's what the authors chose. And no, HP Elitebook wouldn't have module named elitebook_laptop. Steps for identifying the module to blacklist are in general: 1) identify the hardware that is having problems 2) use lshw to find the driver or /sys directory – Sergiy Kolodyazhnyy Mar 31 '19 at 05:32
  • 1
    Often dmesg can help identifying the module, since modules can write to system console via printk() function. For example, my r8169 ethernet module is faulty and it kept spamming dmesg with errors that start r8169 0000:01:00.0: – Sergiy Kolodyazhnyy Mar 31 '19 at 05:41
  • 1
    @SergiyKolodyazhnyy you've posted a huge amount of useful info in the comments here! Can I interest you in rolling it into an answer at all? – Zanna Aug 13 '21 at 17:52

1 Answers1

1

I think it should work fine.

My understanding is that the hardware has some identifiers (like the model name), and the kernel mainains a lookup database to find potential modules. This will inevitably result in several relatively compatible modules, and the kernel goes with the first one (until it fails), then tries the next one, etc.

Blacklisting tells it to skip specific modules. But you shouldn't need to do this unless there is a reason you don't want to use it (examples: issues, performance. etc.)

So yes, it should work fine.

jenks
  • 41