pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.47k stars 87 forks source link

18.04: bcmwl dkms compile fails with 5.3.0-20 kernel #729

Open e3b0c442 opened 5 years ago

e3b0c442 commented 5 years ago

Distribution (run cat /etc/os-release): NAME="Pop!_OS" VERSION="18.04 LTS" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Pop!_OS 18.04 LTS" VERSION_ID="18.04" HOME_URL="https://system76.com/pop" SUPPORT_URL="http://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic n

Related Application and/or Package Version (run apt policy $PACKAGE NAME): bcmwl-kernel-source: Installed: 6.30.223.271+bdcom-0ubuntu4 Candidate: 6.30.223.271+bdcom-0ubuntu4 Version table: *** 6.30.223.271+bdcom-0ubuntu4 500 500 http://us.archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages 100 /var/lib/dpkg/status

Issue/Bug Description: DKMS recompile fails on kernel upgrade. Logs:

DKMS make.log for bcmwl-6.30.223.271+bdcom for kernel 5.3.0-20-generic (x86_64)
Thu Oct 31 06:46:36 CDT 2019
make: Entering directory '/usr/src/linux-headers-5.3.0-20-generic'
CFG80211 API is prefered for this kernel version
Using CFG80211 API
  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_cfg80211_hybrid.c: In function ‘wl_dev_ioctl’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:462:9: error: implicit declaration of function ‘get_ds’; did you mean ‘get_fs’? [-Werror=implicit-function-declaration]
  set_fs(get_ds());
         ^~~~~~
         get_fs
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:462:9: error: incompatible type for argument 1 of ‘set_fs’
In file included from ./include/linux/uaccess.h:11:0,
                 from ./arch/x86/include/asm/fpu/xstate.h:5,
                 from ./arch/x86/include/asm/pgtable.h:26,
                 from ./include/linux/mm.h:99,
                 from /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/include/linuxver.h:65,
                 from /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:26:
./arch/x86/include/asm/uaccess.h:29:20: note: expected ‘mm_segment_t {aka struct <anonymous>}’ but argument is of type ‘int’
 static inline void set_fs(mm_segment_t fs)
                    ^~~~~~
/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]
  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’
   bar1_size = pci_resource_len(pdev, 2);
   ^~~~~~~~~
In file included from /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:40:0:
/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=]
  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’
   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
  default:
  ^~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.o' failed
make[1]: *** [/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:1655: recipe for target '_module_/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build' failed
make: *** [_module_/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.3.0-20-generic'

Steps to reproduce (if you know): sudo dkms autoinstall with bcmwl-kernel-source package and linux-headers-5.3.-20-generic package

Expected behavior: Module compiles without issue

Other Notes:

e3b0c442 commented 5 years ago

I tried rolling back to the 5.3.0-19 kernel and experienced the same issue. Currently on 5.0.0-32 with no problems.

e3b0c442 commented 5 years ago

Looks like this may be related: https://bugs.launchpad.net/ubuntu/+source/bcmwl/+bug/1845716

e3b0c442 commented 5 years ago

Looks to be related to this kernel commit: https://github.com/torvalds/linux/commit/736706bee3298208343a76096370e4f6a5c55915

e3b0c442 commented 5 years ago

As demonstrated in that commit, I installed the bcmwl source package, updated the get_ds() calls to KERNEL_DS, and rebuilt the package (there were two, one in wl_iw.c line 120, the other in wl_cfg_80211_hybrid.c line 453). The rebuilt package is working. I will work on figuring out how to contribute the patch back to upstream, but that may be easier for somebody who has already set up that infrastructure/relationship.