diff options
author | Kyle Manna | 2023-07-15 20:14:30 -0500 |
---|---|---|
committer | Kyle Manna | 2023-07-15 21:05:58 -0500 |
commit | 705786d4b11d1089670ef35b635bbbfe3e5e5b22 (patch) | |
tree | 5319dea913456698fa476d7b8e1de8c69f5681fa | |
parent | 2326cf8da1d3f7040a06fc415b0e233b751d33bd (diff) | |
download | aur-705786d4b11d1089670ef35b635bbbfe3e5e5b22.tar.gz |
release: Linux v6.4.2 fixes and LTS support
* Support newer kernels while maintaining support for v6.1.x LTS kernel
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | 0001-bnx2x-Add-support-for-2.5-Gbps-HSGMII-mode.patch (renamed from bnx2x_warpcore+8727_2_5g_sgmii_arch.patch) | 40 | ||||
-rw-r--r-- | 0002-bnx2x-Handle-DEFINE_SEMAPHORE-for-older-kernels.patch | 38 | ||||
-rw-r--r-- | 0003-bnx2x-Handle-skb_vlan_eth_hdr-for-older-kernels.patch | 39 | ||||
-rw-r--r-- | 0004-bnx2x-Handle-build_skb-helper-for-older-kernels.patch | 57 | ||||
-rw-r--r-- | PKGBUILD | 18 |
6 files changed, 187 insertions, 21 deletions
@@ -1,22 +1,28 @@ pkgbase = bnx2x-2500m-dkms pkgdesc = Broadcom bnx2x driver with 2500 Mbps HSGMII patch - pkgver = 6.2.2.arch1 + pkgver = 6.4.2.arch1 pkgrel = 1 - url = https://github.com/archlinux/linux/commits/v6.2.2-arch1 + url = https://github.com/archlinux/linux/commits/v6.4.2-arch1 arch = x86_64 license = GPL2 makedepends = git depends = dkms depends = linux-firmware-bnx2x - source = archlinux-linux::git+https://github.com/archlinux/linux?signed#tag=v6.2.2-arch1 - source = bnx2x_warpcore+8727_2_5g_sgmii_arch.patch + source = archlinux-linux::git+https://github.com/archlinux/linux?signed#tag=v6.4.2-arch1 + source = 0001-bnx2x-Add-support-for-2.5-Gbps-HSGMII-mode.patch + source = 0002-bnx2x-Handle-DEFINE_SEMAPHORE-for-older-kernels.patch + source = 0003-bnx2x-Handle-skb_vlan_eth_hdr-for-older-kernels.patch + source = 0004-bnx2x-Handle-build_skb-helper-for-older-kernels.patch source = dkms.conf validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886 validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E validpgpkeys = A2FF3A36AAA56654109064AB19802F8B0D70FC30 validpgpkeys = C7E7849466FE2358343588377258734B41C31549 sha256sums = SKIP - sha256sums = d655669179109ae8e801a259c35dbe442ca67a49b9ceb6ca3ef0e56f48149a7d + sha256sums = e953356ac35b28bf0e1a31090689d51fd18ea7ec853282ae820f0b3ef1a85151 + sha256sums = b714961a3ff24f9cf2e8617d27a3b417cd6407c00e5982f42e8a5004ab0f8249 + sha256sums = b1b0d90fd1047def666c9311d3c5f91fd4a9d68bb0bb644e4859b40a0e505b24 + sha256sums = 25711bb089f0d60f82d882e9d4cf3ef6e62e38c0c22942424e08bed714eb597e sha256sums = 9e8de01f4f7d7ed966cd979bc4e41bee95f37398327a094cc705d7e590c06f2a pkgname = bnx2x-2500m-dkms diff --git a/bnx2x_warpcore+8727_2_5g_sgmii_arch.patch b/0001-bnx2x-Add-support-for-2.5-Gbps-HSGMII-mode.patch index 897f8082da80..cade3cc885f1 100644 --- a/bnx2x_warpcore+8727_2_5g_sgmii_arch.patch +++ b/0001-bnx2x-Add-support-for-2.5-Gbps-HSGMII-mode.patch @@ -1,5 +1,16 @@ +From 5a83a143a6da8427234800c73baaa5c4572f40e6 Mon Sep 17 00:00:00 2001 +From: Kyle Manna <kyle@kylemanna.com> +Date: Sat, 15 Jul 2023 20:27:10 -0500 +Subject: [PATCH 1/4] bnx2x: Add support for 2.5 Gbps HSGMII mode + +* Original patch name 'bnx2x_warpcore+8727_2_5g_sgmii_arch.patch' +--- + .../net/ethernet/broadcom/bnx2x/bnx2x_link.c | 51 +++++++++++++++++-- + .../net/ethernet/broadcom/bnx2x/bnx2x_reg.h | 3 +- + 2 files changed, 49 insertions(+), 5 deletions(-) + diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c -index 4e85e7dbc2be..717dbb42cf0d 100644 +index 02808513ffe4..8bf9fe320f78 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c @@ -151,6 +151,7 @@ typedef int (*read_sfp_module_eeprom_func_p)(struct bnx2x_phy *phy, @@ -35,7 +46,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 val16 |= 0x0040; break; default: -@@ -8172,6 +8184,7 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, +@@ -8174,6 +8186,7 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, break; } case SFP_EEPROM_CON_TYPE_VAL_UNKNOWN: @@ -43,7 +54,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 case SFP_EEPROM_CON_TYPE_VAL_LC: case SFP_EEPROM_CON_TYPE_VAL_RJ45: check_limiting_mode = 1; -@@ -8182,7 +8195,8 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, +@@ -8184,7 +8197,8 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, (val[SFP_EEPROM_1G_COMP_CODE_ADDR] != 0)) { DP(NETIF_MSG_LINK, "1G SFP module detected\n"); phy->media_type = ETH_PHY_SFP_1G_FIBER; @@ -53,7 +64,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 u8 gport = params->port; phy->req_line_speed = SPEED_1000; if (!CHIP_IS_E1x(bp)) { -@@ -9236,6 +9250,7 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, +@@ -9238,6 +9252,7 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, u16 tmp1, val; /* Set option 1G speed */ if ((phy->req_line_speed == SPEED_1000) || @@ -61,7 +72,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 (phy->media_type == ETH_PHY_SFP_1G_FIBER)) { DP(NETIF_MSG_LINK, "Setting 1G force\n"); bnx2x_cl45_write(bp, phy, -@@ -9245,6 +9260,22 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, +@@ -9247,6 +9262,22 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_10G_CTRL2, &tmp1); DP(NETIF_MSG_LINK, "1.7 = 0x%x\n", tmp1); @@ -84,7 +95,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 /* Power down the XAUI until link is up in case of dual-media * and 1G */ -@@ -9266,7 +9297,7 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, +@@ -9268,7 +9299,7 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, DP(NETIF_MSG_LINK, "Setting 1G clause37\n"); bnx2x_cl45_write(bp, phy, @@ -93,7 +104,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x1300); } else { -@@ -9274,8 +9305,11 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, +@@ -9276,8 +9307,11 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, * registers although it is default */ bnx2x_cl45_write(bp, phy, @@ -106,7 +117,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x0100); bnx2x_cl45_write(bp, phy, -@@ -9565,6 +9599,11 @@ static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy, +@@ -9567,6 +9601,11 @@ static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy, vars->line_speed = SPEED_10000; DP(NETIF_MSG_LINK, "port %x: External link up in 10G\n", params->port); @@ -118,7 +129,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 } else if ((link_status & (1<<0)) && (!(link_status & (1<<13)))) { link_up = 1; vars->line_speed = SPEED_1000; -@@ -9596,7 +9635,8 @@ static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy, +@@ -9598,7 +9637,8 @@ static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy, } if ((DUAL_MEDIA(params)) && @@ -128,7 +139,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_8727_PCS_GP, &val1); -@@ -11720,6 +11760,7 @@ static const struct bnx2x_phy phy_warpcore = { +@@ -11722,6 +11762,7 @@ static const struct bnx2x_phy phy_warpcore = { SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Full | SUPPORTED_1000baseKX_Full | @@ -136,7 +147,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 SUPPORTED_10000baseT_Full | SUPPORTED_10000baseKR_Full | SUPPORTED_20000baseKR2_Full | -@@ -11906,6 +11947,7 @@ static const struct bnx2x_phy phy_8727 = { +@@ -11908,6 +11949,7 @@ static const struct bnx2x_phy phy_8727 = { .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, .mdio_ctrl = 0, .supported = (SUPPORTED_10000baseT_Full | @@ -144,7 +155,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 SUPPORTED_1000baseT_Full | SUPPORTED_FIBRE | SUPPORTED_Pause | -@@ -12253,6 +12295,7 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port, +@@ -12255,6 +12297,7 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port, break; case PORT_HW_CFG_NET_SERDES_IF_SFI: phy->supported &= (SUPPORTED_1000baseT_Full | @@ -153,7 +164,7 @@ index 4e85e7dbc2be..717dbb42cf0d 100644 SUPPORTED_FIBRE | SUPPORTED_Pause | diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h -index 5caa75b41b73..eaeaf4d90b68 100644 +index 4e9215bce4ad..6979397ee458 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h @@ -7169,7 +7169,8 @@ Theotherbitsarereservedandshouldbezero*/ @@ -166,3 +177,6 @@ index 5caa75b41b73..eaeaf4d90b68 100644 #define MDIO_PMA_REG_8073_CHIP_REV 0xc801 #define MDIO_PMA_REG_8073_SPEED_LINK_STATUS 0xc820 +-- +2.41.0 + diff --git a/0002-bnx2x-Handle-DEFINE_SEMAPHORE-for-older-kernels.patch b/0002-bnx2x-Handle-DEFINE_SEMAPHORE-for-older-kernels.patch new file mode 100644 index 000000000000..0b1194f5842b --- /dev/null +++ b/0002-bnx2x-Handle-DEFINE_SEMAPHORE-for-older-kernels.patch @@ -0,0 +1,38 @@ +From fe69fd47e3e2f79fde7b6453f73772591b8a77d6 Mon Sep 17 00:00:00 2001 +From: Kyle Manna <kyle@kylemanna.com> +Date: Sat, 15 Jul 2023 20:09:18 -0500 +Subject: [PATCH 2/4] bnx2x: Handle DEFINE_SEMAPHORE() for older kernels + +* Older kernels didn't need the number argument. +* See 48380368dec14859723b9e3fbd43e042638d9a76 +--- + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +index 1e7a6f1d4223..339ca36801be 100644 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +@@ -19,6 +19,7 @@ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include <linux/version.h> + #include <linux/module.h> + #include <linux/moduleparam.h> + #include <linux/kernel.h> +@@ -297,7 +298,11 @@ const u32 dmae_reg_go_c[] = { + + /* Global resources for unloading a previously loaded device */ + #define BNX2X_PREV_WAIT_NEEDED 1 ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) ++static DEFINE_SEMAPHORE(bnx2x_prev_sem); ++#else + static DEFINE_SEMAPHORE(bnx2x_prev_sem, 1); ++#endif + static LIST_HEAD(bnx2x_prev_list); + + /* Forward declaration */ +-- +2.41.0 + diff --git a/0003-bnx2x-Handle-skb_vlan_eth_hdr-for-older-kernels.patch b/0003-bnx2x-Handle-skb_vlan_eth_hdr-for-older-kernels.patch new file mode 100644 index 000000000000..2c56d81a2e73 --- /dev/null +++ b/0003-bnx2x-Handle-skb_vlan_eth_hdr-for-older-kernels.patch @@ -0,0 +1,39 @@ +From 9b44453984078670b0de7b9c3670256a24e93227 Mon Sep 17 00:00:00 2001 +From: Kyle Manna <kyle@kylemanna.com> +Date: Sat, 15 Jul 2023 20:31:33 -0500 +Subject: [PATCH 3/4] bnx2x: Handle skb_vlan_eth_hdr() for older kernels + +* Newer kernels have a helper function. +* See 1f5020acb33f926030f62563c86dffca35c7b701 +--- + drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +index 6ea5521074d3..e31c3a63a333 100644 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +@@ -19,6 +19,7 @@ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include <linux/version.h> + #include <linux/etherdevice.h> + #include <linux/if_vlan.h> + #include <linux/interrupt.h> +@@ -1935,7 +1936,12 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb, + + /* Skip VLAN tag if present */ + if (ether_type == ETH_P_8021Q) { ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) ++ struct vlan_ethhdr *vhdr = ++ (struct vlan_ethhdr *)skb->data; ++#else + struct vlan_ethhdr *vhdr = skb_vlan_eth_hdr(skb); ++#endif + + ether_type = ntohs(vhdr->h_vlan_encapsulated_proto); + } +-- +2.41.0 + diff --git a/0004-bnx2x-Handle-build_skb-helper-for-older-kernels.patch b/0004-bnx2x-Handle-build_skb-helper-for-older-kernels.patch new file mode 100644 index 000000000000..4f90b4849d26 --- /dev/null +++ b/0004-bnx2x-Handle-build_skb-helper-for-older-kernels.patch @@ -0,0 +1,57 @@ +From b2ded126262a146e65533668487a4ae38ad843c4 Mon Sep 17 00:00:00 2001 +From: Kyle Manna <kyle@kylemanna.com> +Date: Sat, 15 Jul 2023 20:46:30 -0500 +Subject: [PATCH 4/4] bnx2x: Handle build_skb() helper for older kernels + +* Revert commit 8c495270845d6b4854607e946baef3637a8259ed for older kernels. +--- + drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +index e31c3a63a333..186f46e2bc76 100644 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +@@ -673,6 +673,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, + return 0; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)) + static struct sk_buff * + bnx2x_build_skb(const struct bnx2x_fastpath *fp, void *data) + { +@@ -684,6 +685,7 @@ bnx2x_build_skb(const struct bnx2x_fastpath *fp, void *data) + skb = slab_build_skb(data); + return skb; + } ++#endif + + static void bnx2x_frag_free(const struct bnx2x_fastpath *fp, void *data) + { +@@ -792,7 +794,11 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, + dma_unmap_single(&bp->pdev->dev, dma_unmap_addr(rx_buf, mapping), + fp->rx_buf_size, DMA_FROM_DEVICE); + if (likely(new_data)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) ++ skb = build_skb(data, fp->rx_frag_size); ++#else + skb = bnx2x_build_skb(fp, data); ++#endif + + if (likely(skb)) { + #ifdef BNX2X_STOP_ON_ERROR +@@ -1059,7 +1065,11 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) + dma_unmap_addr(rx_buf, mapping), + fp->rx_buf_size, + DMA_FROM_DEVICE); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) ++ skb = build_skb(data, fp->rx_frag_size); ++#else + skb = bnx2x_build_skb(fp, data); ++#endif + if (unlikely(!skb)) { + bnx2x_frag_free(fp, data); + bnx2x_fp_qstats(bp, fp)-> +-- +2.41.0 + @@ -4,13 +4,19 @@ # Inspired by AUR package "linux-bnx2x-2.5g" from # Charles Leclerc <charles[at]la-mouette[d0t]net> # +# Goal: +# - Maintain compataiblity with 'linux-lts' and 'linux' Arch kernels +# # Usage: # rmmod bnx2x; modprobe bnx2x-2500m +# +# Todo: +# - Consider how to handle LTS kernels better? Backport patches? _pkgbase=bnx2x-2500m pkgname="$_pkgbase-dkms" # Don't need to update unless there's an upstream change! -pkgver=6.2.2.arch1 +pkgver=6.4.2.arch1 pkgrel=1 pkgdesc='Broadcom bnx2x driver with 2500 Mbps HSGMII patch' _srctag=v${pkgver%.*}-${pkgver##*.} @@ -24,7 +30,10 @@ depends=('dkms' 'linux-firmware-bnx2x') _ksrcname=archlinux-linux source=( "$_ksrcname::git+https://github.com/archlinux/linux?signed#tag=$_srctag" - "bnx2x_warpcore+8727_2_5g_sgmii_arch.patch" + "0001-bnx2x-Add-support-for-2.5-Gbps-HSGMII-mode.patch" + "0002-bnx2x-Handle-DEFINE_SEMAPHORE-for-older-kernels.patch" + "0003-bnx2x-Handle-skb_vlan_eth_hdr-for-older-kernels.patch" + "0004-bnx2x-Handle-build_skb-helper-for-older-kernels.patch" "dkms.conf" ) validpgpkeys=( @@ -34,7 +43,10 @@ validpgpkeys=( 'C7E7849466FE2358343588377258734B41C31549' # David Runge <dvzrv@archlinux.org> ) sha256sums=('SKIP' - 'd655669179109ae8e801a259c35dbe442ca67a49b9ceb6ca3ef0e56f48149a7d' + 'e953356ac35b28bf0e1a31090689d51fd18ea7ec853282ae820f0b3ef1a85151' + 'b714961a3ff24f9cf2e8617d27a3b417cd6407c00e5982f42e8a5004ab0f8249' + 'b1b0d90fd1047def666c9311d3c5f91fd4a9d68bb0bb644e4859b40a0e505b24' + '25711bb089f0d60f82d882e9d4cf3ef6e62e38c0c22942424e08bed714eb597e' '9e8de01f4f7d7ed966cd979bc4e41bee95f37398327a094cc705d7e590c06f2a') export KBUILD_BUILD_HOST=archlinux |