bcmwl-kernel-source broken on kernel: 5.8.0-34-generic

15,595

Solution 1

The reason is obvious. Almost every time Canonical rolls out a HWE kernel, they forget to upgrade bcmwl-kernel-source in the repos.

You have two solutions (use one or the other, it makes no sense to use both):

  1. Install bcmwl-kernel-source from groovy repos. You can find it e.g. here. http://mirrors.kernel.org/ubuntu/pool/restricted/b/bcmwl/bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu7_amd64.deb It will compile with the 5.8 kernel.

Download the deb and install it by

sudo dpkg -i bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu7_amd64.deb
  1. Remove all 5.8 kernel packages using these commands:

     sudo apt remove linux-{image,modules,modules-extra,headers}-5.8.0-36-generic linux-hwe-5.8-headers-5.8.0-36
     sudo apt install linux-generic
    

Make sure that the linux-generic meta package is installed.

It is recommended to boot with the 5.4 kernel before you remove the 5.8.

The second solution will keep the 5.4 major kernel version with normal security upgrades.

Solution 2

I managed to restore WiFi with kernel 5.4.0-59-generic as follows:

  1. Purge all packages related to kernel 5.8.0-34-generic: sudo apt purge linux-image-5.8.0-34-generic linux-image-unsigned-5.8.0-34-generic linux-modules-5.8.0-34-generic linux-headers-5.8.0-34-generic
  2. Purge the Broadcom WiFi driver: sudo apt purge bcmwl-kernel-source
  3. Remove redundant packages: sudo apt autoremove
  4. Put the 5.4.0-59-generic kernel on hold: sudo apt-mark hold 5.4.0-59-generic
  5. Update package metadata: sudo apt update
  6. Re-install the driver: sudo apt install bcmwl-kernel-source

Since the 5.8.0-34-generic kernel is gone, the driver is compiled only for the 5.4.0-59-generic kernel which succeeds as expected. Reboot, and WiFi is restored.

Hopefully I can unhold the kernel and receive kernel updates as usual once this is sorted out.

Solution 3

Turns out, you can use the ubuntu 20.10 version of the package and it works just fine, at its origin repo

Solution 4

Broadcom Wifi crashed after Ubuntu 20.04 LTS kernel update 8.15.34 ~ 36

How to know kernel version?

uname -r

How to know your crashed adapter?

sudo lshw -C network 

You will see the crashed adapter with the following title:

*-network UNCLAIMED

How to fix:

SOLUTION 1

Install the following device driver:

http://archive.ubuntu.com/ubuntu/pool/restricted/b/bcmwl/bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu7_amd64.deb

ALTERNATIVE

If not worked, try the following:

sudo apt-get purge bcmwl-kernel-source
sudo apt-get install bcmwl-kernel-source

ALTERNATIVE Reinstall the kernel

sudo apt install --reinstall linux-image-$(uname -r)
sudo apt install --reinstall linux-modules-$(uname -r)
sudo apt install --reinstall linux-modules-extra-$(uname -r)

After that try the above solutions again.

Solution 5

Found an alternative solution while tracing errors in bcmwl-kernel-source.

See this question on Unix & Linux SE

I tried the solution listed in the thread, which involves purging the bcmwl-kernel-source and installing broadcom-sta and it works for me in Ubuntu 20.04 LTS with the Linux 5.8.0-36 headers installed.

sudo apt-get purge bcmwl-kernel-source
sudo apt-get install broadcom-sta-source broadcom-sta-dkms broadcom-sta-common
Share:
15,595
Donald Sebastian Leung
Author by

Donald Sebastian Leung

Cloud, virtualization and open source enthusiast

Updated on September 18, 2022

Comments

  • Donald Sebastian Leung
    Donald Sebastian Leung over 1 year

    Similar to bcmwl-kernel-source broken on kernel: 5.8.0-7630-generic except I'm using a standard kernel - WiFi worked without issues on my MacBook Air (2013) right until I pulled in the latest 20.04.2 update which included the 5.8.0-34-generic kernel, and booting back into 5.4.0-59-generic afterwards does not solve the issue. Anyway, details are as follows; any help would be much appreciated.

    lspci -vnn | grep Network

    03:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)
        Subsystem: Apple Inc. BCM4360 802.11ac Wireless Network Adapter [106b:0117]
    

    ip link show

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
        link/ether 52:54:00:49:bc:05 brd ff:ff:ff:ff:ff:ff
    3: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000
        link/ether 52:54:00:49:bc:05 brd ff:ff:ff:ff:ff:ff
    5: bnep0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
        link/ether 84:38:35:4a:43:4b brd ff:ff:ff:ff:ff:ff
    

    As can be seen, there's no wireless interface.

    sudo lshw -class network

      *-network                 
           description: Network controller
           product: BCM4360 802.11ac Wireless Network Adapter
           vendor: Broadcom Inc. and subsidiaries
           physical id: 0
           bus info: pci@0000:03:00.0
           version: 03
           width: 64 bits
           clock: 33MHz
           capabilities: pm msi pciexpress bus_master cap_list
           configuration: driver=bcma-pci-bridge latency=0
           resources: irq:18 memory:b0600000-b0607fff memory:b0400000-b05fffff
      *-network:0
           description: Ethernet interface
           physical id: 1
           logical name: virbr0
           serial: 52:54:00:49:bc:05
           capabilities: ethernet physical
           configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=192.168.122.1 link=no multicast=yes
      *-network:1
           description: Ethernet interface
           physical id: 2
           logical name: bnep0
           serial: 84:38:35:4a:43:4b
           capabilities: ethernet physical
           configuration: broadcast=yes ip=192.168.44.124 multicast=yes
      *-network:2 DISABLED
           description: Ethernet interface
           physical id: 3
           logical name: virbr0-nic
           serial: 52:54:00:49:bc:05
           size: 10Mbit/s
           capabilities: ethernet physical
           configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s
    

    Steps I took to try to resolve the issue

    I followed Installing Broadcom Wireless Drivers and did the following:

    1. lspci -nn -d 14e4: reveals that the PCI.ID is 14e4:43a0 (rev 03) so I should (re)install bcmwl-kernel-source
    2. sudo apt purge -y bcmwl-kernel-source
    3. sudo apt autoremove
    4. sudo apt update
    5. sudo update-pciids
    6. sudo apt-get install -y bcmwl-kernel-source

    ... followed by a reboot.

    I did all the steps (except the first one) with both the 5.8.0-34-generic and 5.4.0-59-generic kernels and the outputs for the last command are as follows:

    5.8.0-34-generic

    STDOUT:

    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following additional packages will be installed:
      dkms
    Suggested packages:
      menu
    The following NEW packages will be installed:
      bcmwl-kernel-source dkms
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/1,611 kB of archives.
    After this operation, 8,364 kB of additional disk space will be used.
    Selecting previously unselected package dkms.
    (Reading database ... 
    (Reading database ... 5%
    (Reading database ... 10%
    (Reading database ... 15%
    (Reading database ... 20%
    (Reading database ... 25%
    (Reading database ... 30%
    (Reading database ... 35%
    (Reading database ... 40%
    (Reading database ... 45%
    (Reading database ... 50%
    (Reading database ... 55%
    (Reading database ... 60%
    (Reading database ... 65%
    (Reading database ... 70%
    (Reading database ... 75%
    (Reading database ... 80%
    (Reading database ... 85%
    (Reading database ... 90%
    (Reading database ... 95%
    (Reading database ... 100%
    (Reading database ... 204877 files and directories currently installed.)
    Preparing to unpack .../dkms_2.8.1-5ubuntu1_all.deb ...
    Unpacking dkms (2.8.1-5ubuntu1) ...
    Selecting previously unselected package bcmwl-kernel-source.
    Preparing to unpack .../bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu5_amd64.deb ...
    Unpacking bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
    Setting up dkms (2.8.1-5ubuntu1) ...
    Setting up bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
    Loading new bcmwl-6.30.223.271+bdcom DKMS files...
    Building for 5.8.0-34-generic
    Building for architecture x86_64
    Building initial module for 5.8.0-34-generic
    Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
    Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more information.
    dpkg: error processing package bcmwl-kernel-source (--configure):
     installed bcmwl-kernel-source package post-installation script subprocess returned error exit status 10
    Processing triggers for man-db (2.9.1-1) ...
    Errors were encountered while processing:
     bcmwl-kernel-source
    

    STDERR:

    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    5.4.0-59-generic

    STDOUT:

    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following additional packages will be installed:
      dkms
    Suggested packages:
      menu
    The following NEW packages will be installed:
      bcmwl-kernel-source dkms
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/1,611 kB of archives.
    After this operation, 8,364 kB of additional disk space will be used.
    Selecting previously unselected package dkms.
    (Reading database ... 
    (Reading database ... 5%
    (Reading database ... 10%
    (Reading database ... 15%
    (Reading database ... 20%
    (Reading database ... 25%
    (Reading database ... 30%
    (Reading database ... 35%
    (Reading database ... 40%
    (Reading database ... 45%
    (Reading database ... 50%
    (Reading database ... 55%
    (Reading database ... 60%
    (Reading database ... 65%
    (Reading database ... 70%
    (Reading database ... 75%
    (Reading database ... 80%
    (Reading database ... 85%
    (Reading database ... 90%
    (Reading database ... 95%
    (Reading database ... 100%
    (Reading database ... 204877 files and directories currently installed.)
    Preparing to unpack .../dkms_2.8.1-5ubuntu1_all.deb ...
    Unpacking dkms (2.8.1-5ubuntu1) ...
    Selecting previously unselected package bcmwl-kernel-source.
    Preparing to unpack .../bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu5_amd64.deb ...
    Unpacking bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
    Setting up dkms (2.8.1-5ubuntu1) ...
    Setting up bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
    Loading new bcmwl-6.30.223.271+bdcom DKMS files...
    Building for 5.4.0-59-generic 5.8.0-34-generic
    Building for architecture x86_64
    Building initial module for 5.4.0-59-generic
    This system doesn't support Secure Boot
    Secure Boot not enabled on this system.
    Done.
    
    wl.ko:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/5.4.0-59-generic/updates/dkms/
    
    depmod...
    
    DKMS: install completed.
    Building initial module for 5.8.0-34-generic
    Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
    Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more information.
    dpkg: error processing package bcmwl-kernel-source (--configure):
     installed bcmwl-kernel-source package post-installation script subprocess returned error exit status 10
    Processing triggers for man-db (2.9.1-1) ...
    Errors were encountered while processing:
     bcmwl-kernel-source
    

    STDERR:

    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    In both cases, the output suggests looking at /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log which shows:

    DKMS make.log for bcmwl-6.30.223.271+bdcom for kernel 5.8.0-34-generic (x86_64)
    Thursday, January 07, 2021 PM01:19:23 CST
    make: Entering directory '/usr/src/linux-headers-5.8.0-34-generic'
    CFG80211 API is prefered for this kernel version
    Using CFG80211 API
      AR      /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/built-in.a
      CC [M]  /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.o
      CC [M]  /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.o
      CC [M]  /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_iw.o
      CC [M]  /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.o
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_attach’:
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:593:20: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
      593 |  if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
          |                    ^~~~~~~~~~~~~~~
          |                    ioremap_cache
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:593:18: warning: assignment to ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
      593 |  if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
          |                  ^
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_pci_probe’:
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:780:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
      780 |  if ((val & 0x0000ff00) != 0)
          |  ^~
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:782:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
      782 |   bar1_size = pci_resource_len(pdev, 2);
          |   ^~~~~~~~~
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:783:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      783 |   bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
          |               ^
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_reg_proc_entry’:
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:3376:58: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
     3376 |  if ((wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_fops, wl)) == NULL) {
          |                                                          ^~~~~~~~
          |                                                          |
          |                                                          const struct file_operations *
    In file included from /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:38:
    ./include/linux/proc_fs.h:102:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
      102 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
          |                               ^~~~~~~~~~~~~~~~
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.c: In function ‘osl_reg_map’:
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.c:949:10: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
      949 |  return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
          |          ^~~~~~~~~~~~~~~
          |          ioremap_cache
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.c:949:10: warning: returning ‘int’ from a function with return type ‘void *’ makes pointer from integer without a cast [-Wint-conversion]
      949 |  return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
          |         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:40:
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_set_auth_type’:
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.h:52:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
       52 |  if (wl_dbg_level & WL_DBG_DBG) {   \
          |     ^
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:816:3: note: in expansion of macro ‘WL_DBG’
      816 |   WL_DBG(("network eap\n"));
          |   ^~~~~~
    /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:817:2: note: here
      817 |  default:
          |  ^~~~~~~
    cc1: some warnings being treated as errors
    make[1]: *** [scripts/Makefile.build:288: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    cc1: some warnings being treated as errors
    make[1]: *** [scripts/Makefile.build:288: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.o] Error 1
    make: *** [Makefile:1780: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build] Error 2
    make: Leaving directory '/usr/src/linux-headers-5.8.0-34-generic'
    

    In the meantime, my Bluetooth is working so I am connecting to the Internet by Bluetooth tethering with my Android device. But it's very much a temporary solution and I would not like to rely on it for the long run.

  • Pilot6
    Pilot6 over 3 years
    It is not a good idea to put the 5.4.0-59-generic on hold. It won't get updates. If you removed linux-generic-hwe-20.04, linux-image-generic-hwe-20.04 you'll never get the 5.8 again. But the 5.4 will get updates normally, e.g. to 5.4.0-60.
  • Donald Sebastian Leung
    Donald Sebastian Leung over 3 years
    Thanks, I followed the second solution you suggested and unheld kernel updates. As for the first solution, I don't need such a new kernel as long as everything works for me and my system is secure.
  • Pilot6
    Pilot6 over 3 years
    I think adding the hwe meta was also a mistake by someone. They never came before till xx.04.2 releases. That will cause trouble for many people. But I am usng Ubuntu for a long time and expect some mess every beginning of an odd year ;-)
  • Pilot6
    Pilot6 over 3 years
    Install synaptic and remove all linux-image... and linux-headers... packages version 5.8 and also those meta packages.
  • Hani
    Hani over 3 years
    Thank you! Option 1 worked a treat for me!
  • Pilot6
    Pilot6 over 3 years
    broadcom-sta-dkms is enough.
  • bmaupin
    bmaupin over 3 years
    Could you also add a link to the upstream bug? While this is a great workaround, the proper fix needs to come from Canonical. Anyone affected by it should go to the bug report and mark that it affects them so it can get more attention: bugs.launchpad.net/ubuntu/+source/bcmwl/+bug/1910555
  • Anand Kulkarni
    Anand Kulkarni about 3 years
    worked 100%. I tried the installation of deb package and driver worked and wifi also works 100% now and i did not have to downgrade to 5.4 version. My laptop is a little mini Lenovo ideapad S10-3 Model.