[SRU] Fix compilation errors on 5.19

Bug #1993274 reported by Alexandre Ghiti
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
licheerv-rtl8723ds-dkms (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
New
Undecided
Unassigned
Kinetic
Fix Released
Undecided
Unassigned
Lunar
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

This dkms package builds the driver on the host and it fails to compile on 5.19 kernels with the following errors:

/home/itrue/host/git/riscv/sipeed-lichee-kernel-snap/parts/wlan-driver/build/rtl8723ds-dkms/5.1.1.5/build/8723ds/os_dep/linux/ioctl_cfg80211.c:6821:20: error: initialization of ‘int (*)(struct wiphy *, struct net_device *, unsigned int)’ from incompatible pointer type ‘int (*)(struct wiphy *, struct net_device *)’ [-Werror=incompatible-pointer-types]
 6821 | .stop_ap = cfg80211_rtw_stop_ap,
      | ^~~~~~~~~~~~~~~~~~~~
/home/itrue/host/git/riscv/sipeed-lichee-kernel-snap/parts/wlan-driver/build/rtl8723ds-dkms/5.1.1.5/build/8723ds/os_dep/linux/ioctl_cfg80211.c:6821:20: note: (near initialization for ‘rtw_cfg80211_ops.stop_ap’)
/home/itrue/host/git/riscv/sipeed-lichee-kernel-snap/parts/wlan-driver/build/rtl8723ds-dkms/5.1.1.5/build/8723ds/os_dep/linux/ioctl_cfg80211.c: In function ‘rtw_wdev_unregister’:
/home/itrue/host/git/riscv/sipeed-lichee-kernel-snap/parts/wlan-driver/build/rtl8723ds-dkms/5.1.1.5/build/8723ds/os_dep/linux/ioctl_cfg80211.c:7052:17: error: ‘struct wireless_dev’ has no member named ‘current_bss’
 7052 | if (wdev->current_bss) {
      | ^~

We need to backport this fix as the 5.19 linux kernel for this board is in proposed and will finally migrate after the release.

[ Test Plan ]

$ sudo apt install licheerv-rtl8723ds-dkms
Selecting previously unselected package licheerv-rtl8723ds-dkms.
(Reading database ... 112897 files and directories currently installed.)
Preparing to unpack licheerv-rtl8723ds-dkms_1.0-0ubuntu2~ppa0_riscv64.deb ...
Unpacking licheerv-rtl8723ds-dkms (1.0-0ubuntu2~ppa0) ...
Setting up licheerv-rtl8723ds-dkms (1.0-0ubuntu2~ppa0) ...
Loading new licheerv-rtl8723ds-1.0 DKMS files...
Building for 5.19.0-1003-allwinner
Building initial module for 5.19.0-1003-allwinner

Done.

8723ds.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.19.0-1003-allwinner/updates/dkms/
depmod...........................

The build of the module will take quite some time (more than 1hour..).

$ sudo ip link set dev wlan0 up

And finally use the following netplan configuration to connect to your AP (to store at /etc/netplan/wifi.yaml for example):

network:
 version: 2
 renderer: networkd
 wifis:
   wlan0:
     dhcp4: yes
     dhcp6: yes
     access-points:
       "YOUR_SSID":
         password: "YOUR_PASSWORD"

$ sudo netplan apply

Finally, we should be connected to the AP:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul0
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: usb0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOW0
    link/ether ae:12:05:64:8e:2c brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group def0
    link/ether 34:20:03:2a:0d:0c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.28/24 metric 600 brd 192.168.1.255 scope global dynamic wlan0
       valid_lft 86393sec preferred_lft 86393sec
    inet6 fe80::3620:3ff:fe2a:d0c/64 scope link
       valid_lft forever preferred_lft forever

[ Where problems could occur ]

One part of the fix is straightforward: it is the addition of a new parameter in a callback.
The other part is based on the upstream commit that removed "current_bss" field, there may be an oversight/misunderstanding in how to fix this and then the behaviour of the driver might in that particular case that I don't know how to trigger.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in licheerv-rtl8723ds-dkms (Ubuntu):
status: New → Confirmed
tags: added: foundation-todo
Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Please find attached a fix which successfully built in my PPA [1] and which I proposed upstream [2].

[1] https://launchpad.net/~alexghiti/+archive/ubuntu/riscv/+sourcepub/14002734/+listing-archive-extra
[2] https://github.com/lwfinger/rtl8723ds/pull/26

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

One can improve above patch with additional version guards, such that it compiles correctly against either v5.17 or v5.19 kernel.

As during upgrades dkms module may be upgraded/installed, whilst previous v5.17 kernel from kinetic-release or jammy-updates is still installed.

description: updated
Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Please find a newer version that takes into account the remarks from xnox: it successfully built in my PPA [1], was merged upstream [2] and I tested it successfully on my LicheeRV on both kernels 5.17 and 5.19.

[1] https://launchpad.net/~alexghiti/+archive/ubuntu/riscv/+sourcepub/14003072/+listing-archive-extra
[2] https://github.com/lwfinger/rtl8723ds/pull/26

summary: - FIx compilation errors on 5.19
+ [SRU] FIx compilation errors on 5.19
summary: - [SRU] FIx compilation errors on 5.19
+ [SRU] Fix compilation errors on 5.19
tags: added: foundations-todo
removed: foundation-todo
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

We should first update the package in lunar (lunar-licheerv-rtl8723ds-dkms_1.0-0ubuntu1..1.0-0ubuntu2.debdiff) before SRUing it to kinetic.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

sponsored to lunar & kinetic.

Changed in licheerv-rtl8723ds-dkms (Ubuntu Kinetic):
status: New → In Progress
Changed in licheerv-rtl8723ds-dkms (Ubuntu Lunar):
status: Confirmed → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Alexandre, or anyone else affected,

Accepted licheerv-rtl8723ds-dkms into kinetic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/licheerv-rtl8723ds-dkms/1.0-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-kinetic to verification-done-kinetic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-kinetic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in licheerv-rtl8723ds-dkms (Ubuntu Kinetic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-kinetic
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Whilst verifying this bug report I have noticed that this dkms module is using `bc` without depending on it. If one has minimal install without bc tool installed, then dkms module fails to install. With bc tool installed, the dkms module is installed correctly.

I will open a follow up bug report to add bc runtime dependency.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

# cat /var/lib/dkms/licheerv-rtl8723ds/1.0/build/make.log
DKMS make.log for licheerv-rtl8723ds-1.0 for kernel 5.19.0-1003-allwinner (riscv64)
Wed Nov 16 12:56:25 UTC 2022
/bin/sh: 1: bc: not found
make ARCH=riscv CROSS_COMPILE= -C /lib/modules/5.19.0-1003-allwinner/build M=/var/lib/dkms/licheerv-rtl8723ds/1.0/build modules
make[1]: Entering directory '/usr/src/linux-headers-5.19.0-1003-allwinner'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: riscv64-linux-gnu-gcc-12 (Ubuntu 12.2.0-3ubuntu1) 12.2.0
  You are using: gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0
...

which causes ftbfs

GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
ifeq ($(GCC_VER_49),1)
EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later
endif

However, gcc 49 is very old, and we can assume that it simply is available. and thus unconditionally add -Wno-date-time

Or we can drop the __DATE__ and __TIME__ stanzas from the source file, which upstream kernel prohibits anyway in kernel code.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Note that bc issue is present in release version of this dkms module, and thus is not a regression.

The other FTBFS issues that were v5.19 kernel specific have been resolved by this SRU update.

tags: added: verification-done verification-done-kinetic
removed: verification-needed verification-needed-kinetic
Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package licheerv-rtl8723ds-dkms - 1.0-0ubuntu2

---------------
licheerv-rtl8723ds-dkms (1.0-0ubuntu2) lunar; urgency=medium

  * Fix compilation errors on 5.19 kernels (LP: #1993274)
    Change maintainer to Ubuntu Developers.

 -- Heinrich Schuchardt <email address hidden> Fri, 04 Nov 2022 10:04:23 +0100

Changed in licheerv-rtl8723ds-dkms (Ubuntu Lunar):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Alexandre, or anyone else affected,

Accepted licheerv-rtl8723ds-dkms into kinetic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/licheerv-rtl8723ds-dkms/1.0-0ubuntu1.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-kinetic to verification-done-kinetic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-kinetic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-kinetic
removed: verification-done verification-done-kinetic
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

# apt remove --purge bc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'bc' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

# apt install licheerv-rtl8723ds-dkms
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

...
Preparing to unpack .../licheerv-rtl8723ds-dkms_1.0-0ubuntu1.2_riscv64.deb ...
Unpacking licheerv-rtl8723ds-dkms (1.0-0ubuntu1.2) ...
Setting up dh-dkms (3.0.6-2ubuntu2) ...
Setting up dctrl-tools (2.24-3build2) ...
Setting up dkms (3.0.6-2ubuntu2) ...
Setting up licheerv-rtl8723ds-dkms (1.0-0ubuntu1.2) ...
Loading new licheerv-rtl8723ds-1.0 DKMS files...
It is likely that 5.15.0-52-generic belongs to a chroot's host
Building for 5.19.0-1003-allwinner
Building initial module for 5.19.0-1003-allwinner
Done.

8723ds.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.19.0-1003-allwinner/updates/dkms/
depmod....
Processing triggers for libc-bin (2.36-0ubuntu4) ...

# dkms status
licheerv-rtl8723ds/1.0, 5.19.0-1003-allwinner, riscv64: installed

All is good.

tags: added: verification-done verification-done-kinetic
removed: verification-needed verification-needed-kinetic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package licheerv-rtl8723ds-dkms - 1.0-0ubuntu1.2

---------------
licheerv-rtl8723ds-dkms (1.0-0ubuntu1.2) kinetic; urgency=medium

  * Fix -Wdate-time and drop -Wno-date-time override. LP: #1996753

licheerv-rtl8723ds-dkms (1.0-0ubuntu1.1) kinetic; urgency=medium

  * Fix compilation errors on 5.19 kernels (LP: #1993274)
    Change maintainer to Ubuntu Developers.

 -- Dimitri John Ledkov <email address hidden> Wed, 16 Nov 2022 13:27:29 +0000

Changed in licheerv-rtl8723ds-dkms (Ubuntu Kinetic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for licheerv-rtl8723ds-dkms has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.