package/wilc-driver: bump to linux4microchip-2024.04
PATCH 1/1 package/wilc-driver: bump to linux4microchip-2024.04
Latest update from Microchip's kernel.
Removes Buildroot patches and instead incorporates these directly to a community branch of the repo. Also adds a check in wilc-driver.mk to use the new linux4microchip-2024.04-community tag when BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_4 is true.
See help for BR2_PACKAGE_WILC_DRIVER as well as the project's README for more information.
---
We investigated the potential to use backports to make maintenance easier as I mentioned, however it did not work out as we had expected. Instead, we've decided to keep the main branch of the repo we maintain matching the Microchip driver as it exists in the matching tag in their kernel repo; and then split off branches from those points in time to host community changes. These include things like Giulio Benetti's work to support kernel versions outside of what the Microchip driver would directly support.
This change uses the linux4microchip-2024.04 base tag, and a patch we've supplied on top of it to support building against kernel 6.4~6.10. And moving forward, we will continue to add patches as needed to the community branch.
I'm not sure if I did the kernel dependency check in the most elegant way. If there is a preferred way to handle that, please let me know and I'll happily make a revision.
...missing-prandom_u32-with-Linux-6.1.0.patch | 34 --- ...fix-build-failure-on-remove-callback.patch | 44 ---- ...uild-failure-with-Linux-5.19-and-6.1.patch | 98 -------- ...on_parameters-Linux-6.1-build-failur.patch | 216 ------------------ .../wilc-driver/0005-Fix-cast-warnings.patch | 43 ---- .../wilc-driver/0006-Support-Linux-6.3.patch | 43 ---- .../wilc-driver/0007-Support-Linux-6.4.patch | 36 --- package/wilc-driver/Config.in | 11 +- package/wilc-driver/wilc-driver.hash | 3 +- package/wilc-driver/wilc-driver.mk | 9 +- 10 files changed, 18 insertions(+), 519 deletions(-) delete mode 100644 package/wilc-driver/0001-cfg80211.c-fix-missing-prandom_u32-with-Linux-6.1.0.patch delete mode 100644 package/wilc-driver/0002-spi.c-fix-build-failure-on-remove-callback.patch delete mode 100644 package/wilc-driver/0003-cfg80211.c-fix-build-failure-with-Linux-5.19-and-6.1.patch delete mode 100644 package/wilc-driver/0004-Fix-struct-station_parameters-Linux-6.1-build-failur.patch delete mode 100644 package/wilc-driver/0005-Fix-cast-warnings.patch delete mode 100644 package/wilc-driver/0006-Support-Linux-6.3.patch delete mode 100644 package/wilc-driver/0007-Support-Linux-6.4.patch
package/wilc-driver/0001-cfg80211.c-fix-missing-prandom_u32-with-Linux-6.1.0.patch deleted +0 -34
@@ -1,34 +0,0 @@ -From f80e4343fa0a4d8b22933d1704c85a771fe234a4 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti <[email protected]> -Date: Wed, 28 Dec 2022 19:56:46 +0100 -Subject: [PATCH] cfg80211.c: fix missing prandom_u32() with Linux >= 6.1.0 - -prandom_u32() previously was only calling get_random_u32() so it's been -dropped with Linux 6.1.0. So let's directly call get_random_u32() if Linux -version >= 6.1.0. - -[Upstream status: https://github.com/embeddedTS/wilc3000-external-module/pull/2] -Signed-off-by: Giulio Benetti <[email protected]> ---- - cfg80211.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/cfg80211.c b/cfg80211.c -index 016aa06..41edd02 100644 ---- a/cfg80211.c -+++ b/cfg80211.c -@@ -1422,7 +1422,11 @@ static int mgmt_tx(struct wiphy *wiphy, - const u8 *vendor_ie; - int ret = 0; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) -+ *cookie = get_random_u32(); -+#else - *cookie = prandom_u32(); -+#endif - priv->tx_cookie = *cookie; - mgmt = (const struct ieee80211_mgmt *)buf; - --- -2.34.1 -
package/wilc-driver/0002-spi.c-fix-build-failure-on-remove-callback.patch deleted +0 -44
44 lines not on this page · raw message
package/wilc-driver/0003-cfg80211.c-fix-build-failure-with-Linux-5.19-and-6.1.patch deleted +0 -98
98 lines not on this page · raw message
package/wilc-driver/0004-Fix-struct-station_parameters-Linux-6.1-build-failur.patch deleted +0 -216
216 lines not on this page · raw message
package/wilc-driver/0005-Fix-cast-warnings.patch deleted +0 -43
43 lines not on this page · raw message
package/wilc-driver/0006-Support-Linux-6.3.patch deleted +0 -43
43 lines not on this page · raw message
package/wilc-driver/0007-Support-Linux-6.4.patch deleted +0 -36
@@ -1,36 +0,0 @@ -From 94fc4594659494b8c5cbdf1a719aea4d66d3398d Mon Sep 17 00:00:00 2001 -From: Giulio Benetti <[email protected]> -Date: Wed, 27 Sep 2023 11:20:50 +0200 -Subject: [PATCH] Support Linux 6.4 - -With Linux 6.4 commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1aaba11da9aa7d7d6b52a74d45b31cac118295a1 -class_create() doesn't require first argument THIS_MODULE anymore so let's -drop first argument if Linux version >= 6.4 - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/5 - -Signed-off-by: Giulio Benetti <[email protected]> ---- - bt.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/bt.c b/bt.c -index 48a5302..a752457 100644 ---- a/bt.c -+++ b/bt.c -@@ -135,7 +135,11 @@ static void wilc_bt_create_device(void) - ret = alloc_chrdev_region(&chc_dev_no, 0, 1, "atmel"); - if (ret < 0) - return; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) -+ chc_dev_class = class_create("atmel"); -+#else - chc_dev_class = class_create(THIS_MODULE, "atmel"); -+#endif - if (IS_ERR(chc_dev_class)) { - unregister_chrdev_region(chc_dev_no, 1); - return; --- -2.34.1 -
package/wilc-driver/Config.in +8 -3
@@ -10,12 +10,17 @@ config BR2_PACKAGE_WILC_DRIVER external module. The wilc1000 driver currently maintained in Linux kernel does - not support BLE of the WILC3000 hardware. This package is - meant to bridge that gap until Microchip can get WILC3000 - support upstream. + not support the WILC3000 hardware. This package is meant to + bridge that gap until Microchip can get WILC3000 support + upstream. Supports both SDIO and SPI modes. + Note that the version of this driver that is compiled is + automatically chosen based on + BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_4 being set. See the + project README linked below for more information. + https://github.com/embeddedTS/wilc3000-external-module if BR2_PACKAGE_WILC_DRIVER
package/wilc-driver/wilc-driver.hash +2 -1
@@ -1,3 +1,4 @@ # Locally calculated -sha256 4796b1a53781f8702a335b0146d488a9422b71dab39f6f154f955b0ad1711199 wilc-driver-linux4microchip-2021.10-1.tar.gz +sha256 fbec43ca432a58a924c1d40ca4b7a37aeb117b2654135c225c85d6c5258de5be wilc-driver-linux4microchip-2021.10-1-upto-linux-6.6.tar.gz +sha256 a87188d7cfc7718231e8b6033139ee645f4ed543d8eaba384c30f9a7d25d89e4 wilc-driver-linux4microchip-2024.04-community.tar.gz sha256 f6b78c087c3ebdf0f3c13415070dd480a3f35d8fc76f3d02180a407c1c812f79 LICENSE
package/wilc-driver/wilc-driver.mk +8 -1
@@ -4,7 +4,14 @@ # ################################################################################ -WILC_DRIVER_VERSION = linux4microchip-2021.10-1 +# Set up driver version based on kernel headers +# See the project's README for more information on this +ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_4),y) +WILC_DRIVER_VERSION = linux4microchip-2024.04-community +else +WILC_DRIVER_VERSION = linux4microchip-2021.10-1-upto-linux-6.6 +endif + WILC_DRIVER_SITE = $(call github,embeddedTS,wilc3000-external-module,$(WILC_DRIVER_VERSION)) WILC_DRIVER_LICENSE = GPL-2.0
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Kris,
Quoted 6 lines · On Wed, 31 Jul 2024 23:55:48 +0000 Kris Bahnsen via buildroot…
Latest update from Microchip's kernel.
Removes Buildroot patches and instead incorporates these directly to a community branch of the repo. Also adds a check in wilc-driver.mk to use the new linux4microchip-2024.04-community tag when
BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_4is true.
Could you clarify why the code in linux4microchip-2024.04-community doesn't work on older kernels?
Quoted 2 lines
We investigated the potential to use backports to make maintenance easier as I mentioned, however it did not work out as we had expected.
Not sure what "backports" you're referring to here. Backporting what from what, to what?
Quoted 3 lines
I'm not sure if I did the kernel dependency check in the most elegant way. If there is a preferred way to handle that, please let me know and I'll happily make a revision.
The version dependency check is annoying, which is why I'm asking above if we could get away with it, which would be the best solution.
package/wilc-driver/wilc-driver.mk line 13
Quoted 8 lines
package/wilc-driver/wilc-driver.mk +7
-1-WILC_DRIVER_VERSION = linux4microchip-2021.10-1 +# Set up driver version based on kernel headers +# See the project's README for more information on this +ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_4),y) +WILC_DRIVER_VERSION = linux4microchip-2024.04-community +else +WILC_DRIVER_VERSION = linux4microchip-2021.10-1-upto-linux-6.6 +endif
Unfortunately, we cannot use the kernel headers version. Some people use external toolchains that have possibly a bit old kernel headers, but they may be running a very up-to-date kernel. So the only option I believe is to do like AUFS in linux/Config.ext.in, with an explicit choice.
But that's also going to break badly with autobuilder testing. So really, if we can use a single version for all kernel versions, it would be much, much, much better.
Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 7 lines · Thomas Petazzoni
Hello Kris,
Quoted 2 lines · On Wed, 31 Jul 2024 23:55:48 +0000 Kris Bahnsen via buildroot…
Latest update from Microchip's kernel.
Quoted 8 lines
Quoted 5 lines
Removes Buildroot patches and instead incorporates these directly to a community branch of the repo. Also adds a check in wilc- driver.mk
to use the new linux4microchip-2024.04-community tag whenBR2_TOOLCHAIN_HEADERS_AT_LEAST_6_4is true.Could you clarify why the code in linux4microchip-2024.04-community doesn't work on older kernels?
The driver has a chaotic history. It used to be maintained as an external driver as well as in-kernel for Atmel/Microchip's kernel fork.
At some point in history, they deprecated the external module and only maintained it in their kernel fork. This is where we decided to take what was in their kernel and modify it enough to load as an external module.
There are two major tag bases in our wilc3000-external-module.git, linux4microchip-2021.10 and linux4microchip-2024.04. These match the same named tags in the Microchip WILC3000 driver source in the Microchip kernel fork, https://github.com/linux4sam/linux-at91
Finally, the reason why linux4microchip-2024.04-community won't work on older kernels is because Microchip used to have kernel version checks in that codebase (it was a copy of the externally maintained driver they had). And between linux4microchip-2021.10 and linux4microchip- 2024.04 in their kernel, all of those checks were removed along with added updates and changes.
Further complicating things, individual parts of the driver history have been rebased away. And the driver they maintain in that kernel is meant to be compatible with both WILC1000 and WILC3000. That is, the shared driver is maintained in the same folder where the upstream kernel only supports the WILC1000, so they do a lot of merging and rebasing over time.
Part of that rebased history has their changes to remove kernel version checks for backwards compatibility mixed in with changes they make to improve the driver.
It would require significant effort to keep their latest driver changes as well as kernel version checks for compatibility in place. That is time that I am not greenlit to spend on it.
Instead, the compromise was a split in kernel version compatibility. For this driver version, we will maintain patches on top of it to keep it compiling in forward kernels as well as do our best to apply feature changes from Microchip alongside that.
If there ever is another significant set of changes from Microchip, we will likely re-do this split.
Quoted 7 lines
Quoted 4 lines
We investigated the potential to use backports to make maintenance easier as I mentioned, however it did not work out as we had expected.
Not sure what "backports" you're referring to here. Backporting what from what, to what?
https://backports.wiki.kernel.org/index.php/Main_Page
As I mentioned, the backports project only targets kernel 6.1 as the most recent kernel version it will backport to. And I believe it would still have the same issue of needing to select an appropriate kernel version to target.
Quoted 11 lines
Quoted 6 lines
I'm not sure if I did the kernel dependency check in the most elegant
way. If there is a preferred way to handle that, please let me know and
I'll happily make a revision.The version dependency check is annoying, which is why I'm asking above
if we could get away with it, which would be the best solution.
Quoted 15 lines
package/wilc-driver/wilc-driver.mk line 13
Quoted 8 lines
package/wilc-driver/wilc-driver.mk +7
-1-WILC_DRIVER_VERSION = linux4microchip-2021.10-1 +# Set up driver version based on kernel headers +# See the project's README for more information on this +ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_4),y) +WILC_DRIVER_VERSION = linux4microchip-2024.04-community +else +WILC_DRIVER_VERSION = linux4microchip-2021.10-1-upto-linux-6.6 +endifUnfortunately, we cannot use the kernel headers version. Some people use external toolchains that have possibly a bit old kernel headers, but they may be running a very up-to-date kernel. So the only option I
believe is to do like AUFS in linux/Config.ext.in, with an explicit choice.
That is a good point that I had not considered.
Aside from selecting the driver version like AUFS, the only other thing I can think of would be rather than a hard cutoff point we could maintain the older linux4microchip-2021.10 release by patching kernel version checks in as time goes on. That doesn't give me the warm fuzzies though because there may be lurking bugs in that older driver version that will be kept limped along. I would rather have the cutoff and try to keep things moving forward.
If you are okay with the choice selection, I can work on a second version of this patch for that. Or if you have any other ideas sparked by the additional detail on the history of the driver, please let me know.
Quoted 8 lines
But that's also going to break badly with autobuilder testing. So really, if we can use a single version for all kernel versions, it would be much, much, much better.
Thanks!
Thomas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot