• Published on | Aug 10, 2012 | by FozzTexx

Getting tg3 driver to load broadcom dependency

If you've ever had a problem getting the tg3 driver to work, you've probably encountered something like this:

[ 2.093513] tg3 0000:03:00.0: No PHY devices
[ 2.093531] tg3 0000:03:00.0: Problem fetching invariants of chip, aborting

After googling you found that you need to load the broadcom module before the tg3 module loads. That's great, but having to do it manually every time sucks. Since I'm building my own kernel and initramfs, a lot of the "fixes" are specific to a particular distro.

What I'd like is when the tg3 module loads it automatically loads the broadcom module. For whatever reason depmod doesn't include the broadcom dependency (something about broadcom being in user space). It seems the only solution is to hardcode a workaround into whatever scripts you're using. I don't like this at all. The best fix I could come up with was to hardcode something into my script that builds my initramfs, right after the depmod:

sed -e '/\/tg3.ko:/s,\( [^ ][^ ]*/\)\(.*\),\1\2\1broadcom.ko,' modules.dep > modules.dep.fix
mv modules.dep.fix modules.dep

With the broadcom dependency in modules.dep, the tg3 module loads perfectly.

Join The Discussion