From patchwork Fri May 24 18:11:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 13673436 Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 249AB22616 for ; Fri, 24 May 2024 18:11:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716574280; cv=none; b=Miu05GijnU2+zd1s+MxpchhEuzwMtaN12huRJTsM0Ra6JwGbGPNQHOml5YsZnQTm+agOsCt/J9MVNmiDqOJKaOECBTUqOKc9Zqw3WAiysA858zuzPgbul5+oYZJgn7MmvVhEP/0LqmB2g1aCmDkPfvAUtycKlwJJ580ZDjtYXGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716574280; c=relaxed/simple; bh=JAKhAedT4DF61A7nsOqed5CQj7plAA+O/I6WOANUEfs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oQou8HeDlHAsgp7SxencDMyTH+z2fwhFkYurpRYrGuEmUDYF2g/sK7tcU9wwAhZty2PueMKdojWUkS+B3DLNK+b/kjJSX2AYe2qZsm4TjD1BWmEZYnFGF91/XJxgAGw/PEBxtpbeFFkwYSS0hY3T3T1YkTc40joDJXdRyZS8QwQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=uLKc+iVm; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="uLKc+iVm" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=sk3bnx+Wc9v0tyUjFDQMqxrvWzr0mHq0KUfkbAf3Vnc=; t=1716574279; x=1717783879; b=uLKc+iVm4ytjmCafKMrS+3R5DLG1P5ddTQVPHdl/J2HdnAnyKyZYcGogpFeuoFl4TMdeUlLPANQ A3l6/12jTXLsRVENnbqkXZa4EtORsUaLPn4SLfWwFtYuny/8f4kPoffH0OJQFD2faZrmhQPs9HJi7 2MgDFLuK8a7pzAqExya63MOIM4GS0apOhJa17hanDa6hoOPeiJMpwPvpEcAHClEjRUwwSaINlO+6u UCPr+f0bMd822YW9Eu17X+EkmOkhdkoiHkxMB+TN+e5fH23Suxd/7/wAqfiQUU+xyFkH/OTc6c6+g V/1oUwrz8kgV4tX2P74rjMGXKRa3i+hOVUjQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sAZNr-00000008bYt-32TZ; Fri, 24 May 2024 20:11:16 +0200 From: Johannes Berg To: backports@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 1/3] backports: add BITS_TO_BYTES() Date: Fri, 24 May 2024 20:11:11 +0200 Message-ID: <20240524201112.bfc1a1eeddfa.I6ae09dfd2061693745358ecdac5f703f96b07e00@changeid> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: backports@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Johannes Berg Signed-off-by: Johannes Berg --- backport/backport-include/linux/bitops.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backport/backport-include/linux/bitops.h b/backport/backport-include/linux/bitops.h index 17bd8138ecd6..20890e198ee5 100644 --- a/backport/backport-include/linux/bitops.h +++ b/backport/backport-include/linux/bitops.h @@ -24,4 +24,8 @@ #define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE) #endif +#ifndef BITS_TO_BYTES +#define BITS_TO_BYTES(nr) __KERNEL_DIV_ROUND_UP(nr, BITS_PER_TYPE(char)) +#endif + #endif /* __BACKPORT_BITOPS_H */ From patchwork Fri May 24 18:11:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 13673437 Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E6093B1A3 for ; Fri, 24 May 2024 18:11:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716574281; cv=none; b=Gzu46joaKk382VHEa/kNum1hE+zSJ0ai6s+TWPPefnFy2bkZdFfw5wHGYHqOuj1EGCcb1NyoE6r6QIv6wiN8J4QYyjN44CGG7zlLAbUTeva2o0+vela2qouSn0anjoVEMmvN+ENZQ1m2TNu8aF42J8tP87NHkNKIeOZ5Mf1kFtQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716574281; c=relaxed/simple; bh=MIONFP6O2taSumAJaKHaHABGLgzaxU18okg+/PVvrME=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MIJ/enEUwfHq4dfNuIfZxrdOZQxOmaywYgOVnaz7fWUz7H9I+5yJy/PS8KUCGGFLSIgFe9CM8KC9n81SLLXzPDvogbl60X3qY1wZaTamMS1IomsRYuHUtKZg9Eeq+cCw4CiwUTcJBTmJGEGp43nPWbNlOlZUo6k9WbsStnt+WCg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=vB3mY0WV; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="vB3mY0WV" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=BqrDtpCa8BPaTZZvTUQyq9U5YeS3AFa5nyltjtSX9ZI=; t=1716574280; x=1717783880; b=vB3mY0WVNE7IggrvnygdnTqDjEobGV7cvjoBdd7BhMwqYg9 GmSDmx8f3YEVJJzkI6ccCO920cmqIu8XIYfDeBazI6mb9h3GcGbj6Xos8rqKZBQWtCF9DmNeaoaqD SUHYNMN5dOvqIvbjscmfPOy+guo0SsNPnymfBmQDEClVCyxXiVL1WDcn80oWp9Iq7ZQG1E1CtEaUj fxVUqp0V3rRx180ZQvH4UMoKBFDm98G146cSQ5lNcl0TKACMfiH3u1zw2kLH+1pbFH54WE1CSY4A3 dpTXUtazvKJKfUW8X8Uj9ZHy42fkW+1uiZspw8CiqrwP6eMp68QlFuRrkQJ2kcCQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sAZNs-00000008bYt-3Vu7; Fri, 24 May 2024 20:11:17 +0200 From: Johannes Berg To: backports@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 2/3] backports: add bitmap_zalloc/_free Date: Fri, 24 May 2024 20:11:12 +0200 Message-ID: <20240524201112.a746aafc99cc.I931412aa547e6b26a87de1b90f60fe6403073ef6@changeid> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240524201112.bfc1a1eeddfa.I6ae09dfd2061693745358ecdac5f703f96b07e00@changeid> References: <20240524201112.bfc1a1eeddfa.I6ae09dfd2061693745358ecdac5f703f96b07e00@changeid> Precedence: bulk X-Mailing-List: backports@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Johannes Berg Signed-off-by: Johannes Berg --- backport/backport-include/linux/bitmap.h | 10 ++++++++++ backport/compat/Makefile | 1 + backport/compat/backport-4.19.c | 15 +++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 backport/backport-include/linux/bitmap.h create mode 100644 backport/compat/backport-4.19.c diff --git a/backport/backport-include/linux/bitmap.h b/backport/backport-include/linux/bitmap.h new file mode 100644 index 000000000000..d7a0260b6001 --- /dev/null +++ b/backport/backport-include/linux/bitmap.h @@ -0,0 +1,10 @@ +#ifndef __BP_LINUX_BITMAP_H +#define __BP_LINUX_BITMAP_H +#include_next + +#if LINUX_VERSION_IS_LESS(4,19,0) +unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags); +void bitmap_free(const unsigned long *bitmap); +#endif /* < 4.19 */ + +#endif /* __BP_LINUX_BITMAP_H */ diff --git a/backport/compat/Makefile b/backport/compat/Makefile index bb6fb57edc7e..29a9b3d8faa3 100644 --- a/backport/compat/Makefile +++ b/backport/compat/Makefile @@ -8,6 +8,7 @@ compat-y += main.o # Kernel backport compatibility code compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o +compat-$(CPTCFG_KERNEL_4_19) += backport-4.19.o compat-$(CPTCFG_KERNEL_5_2) += backport-5.2.o backport-genetlink.o compat-$(CPTCFG_KERNEL_5_3) += backport-5.3.o compat-$(CPTCFG_KERNEL_5_5) += backport-5.5.o diff --git a/backport/compat/backport-4.19.c b/backport/compat/backport-4.19.c new file mode 100644 index 000000000000..2ea396757ed8 --- /dev/null +++ b/backport/compat/backport-4.19.c @@ -0,0 +1,15 @@ +#include +#include + +unsigned long * +bitmap_zalloc(unsigned int nbits, gfp_t flags) +{ + return kzalloc(BITS_TO_LONGS(nbits) * sizeof(unsigned long), flags); +} +EXPORT_SYMBOL(bitmap_zalloc); + +void bitmap_free(const unsigned long *bitmap) +{ + kfree(bitmap); +} +EXPORT_SYMBOL(bitmap_free); From patchwork Fri May 24 18:11:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 13673438 Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E6433B293 for ; Fri, 24 May 2024 18:11:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716574281; cv=none; b=YHTl0GfwoduwDJkyOj/JsU810ngx21n6AdZMGlsbEvf27cZbBOVcMLaoXAS1qq7UFL8lodDYeZK0x6b8J6ybtvXd7TNEZgdyKc8B1jnFYbIQ8FJolJemtBcenks6FU5y0SjmnfilIi4aRsX5m/DmZCfhKdKcrC+ZI495o7Fz6/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716574281; c=relaxed/simple; bh=HReAuXjsKBkm/DTPVIsfuIMU33zcz/FQH96Z8S97Jh0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bngjbitr3qCMUitbD+cTE0bZrRNfLunNgd3+6kFWQshNE7dLps2GCL7d6JIU4oIFeT5D9SgMQ3aBC4QDWXXCVdA4eXLCPVOQjxbM/Kus6Cp0JNDNqqd23FhGw4EFAtioCBKQ8p6MX6PSdIsJR3bxCX47TxZRC7gES7xRApklQP4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=L3eJ6gsV; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="L3eJ6gsV" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=46Xw+6MAscuRp6cqc5Gj4lIALhS5GftQ2RGvLUPe544=; t=1716574280; x=1717783880; b=L3eJ6gsVBDzMb3P+2rISltv/pxS3EVPHIjQe2EGeiHwBD+R nqH0yVOjJoMC3YO4xI1OgBDmKhvQVzDqLVnpLhZRCgNbxEgw7vK846QkRfkJAli/avz3+aFvd63ZD +26TFVe2OZ6oeG4Q8xPYxU8of79n1kjjTbdbSt21a4vVbeD1YUZoQOn4PIHG3lS5qNQ6QoaVjTo48 qvCaBnkqR/2O9QUXrF6ZXkJ9goJuey46Rrzt3vhvBCrq9yKJglUW7Xv1ME9NeJ3vMSTfAh1HgOzXO PC2Fioz3V2d7Qz2gB+gGXalWO5K92QzdBLH19gV+6yXGwxDXtmx3uIDvZLnBqYew==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sAZNt-00000008bYt-3MYl; Fri, 24 May 2024 20:11:17 +0200 From: Johannes Berg To: backports@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 3/3] patches: fix rtw88/rtw89 include patches Date: Fri, 24 May 2024 20:11:13 +0200 Message-ID: <20240524201112.17eead9a6574.I272714479000f00f2bb83929a29a4690483be157@changeid> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240524201112.bfc1a1eeddfa.I6ae09dfd2061693745358ecdac5f703f96b07e00@changeid> References: <20240524201112.bfc1a1eeddfa.I6ae09dfd2061693745358ecdac5f703f96b07e00@changeid> Precedence: bulk X-Mailing-List: backports@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Johannes Berg Signed-off-by: Johannes Berg --- .../0013-fix-makefile-includes/rtw88.patch | 6 +- .../0013-fix-makefile-includes/rtw89.patch | 72 +++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 patches/0013-fix-makefile-includes/rtw89.patch diff --git a/patches/0013-fix-makefile-includes/rtw88.patch b/patches/0013-fix-makefile-includes/rtw88.patch index 41dea13e103f..d9e87b9d1eb6 100644 --- a/patches/0013-fix-makefile-includes/rtw88.patch +++ b/patches/0013-fix-makefile-includes/rtw88.patch @@ -3,9 +3,9 @@ linux/module.h include needed for kernel 3.18 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -17,6 +17,7 @@ - #include "tx.h" - #include "debug.h" #include "bf.h" + #include "sar.h" + #include "sdio.h" +#include bool rtw_disable_lps_deep_mode; @@ -13,9 +13,9 @@ linux/module.h include needed for kernel 3.18 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -14,6 +14,7 @@ - #include "reg.h" #include "debug.h" #include "bf.h" + #include "regd.h" +#include static const s8 lna_gain_table_0[8] = {22, 8, -6, -22, -31, -40, -46, -52}; diff --git a/patches/0013-fix-makefile-includes/rtw89.patch b/patches/0013-fix-makefile-includes/rtw89.patch new file mode 100644 index 000000000000..2e99d4770781 --- /dev/null +++ b/patches/0013-fix-makefile-includes/rtw89.patch @@ -0,0 +1,72 @@ +diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c +index 0d010548f7d9..4974aed78f91 100644 +--- a/drivers/net/wireless/realtek/rtw89/debug.c ++++ b/drivers/net/wireless/realtek/rtw89/debug.c +@@ -3,6 +3,7 @@ + */ + + #include ++#include + + #include "coex.h" + #include "debug.h" +diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c +index 19001130ad94..51c3fab1408d 100644 +--- a/drivers/net/wireless/realtek/rtw89/pci.c ++++ b/drivers/net/wireless/realtek/rtw89/pci.c +@@ -3,6 +3,7 @@ + */ + + #include ++#include + + #include "mac.h" + #include "pci.h" +diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b.c b/drivers/net/wireless/realtek/rtw89/rtw8851b.c +index 51d3e61eaa1d..09d2d2859d14 100644 +--- a/drivers/net/wireless/realtek/rtw89/rtw8851b.c ++++ b/drivers/net/wireless/realtek/rtw89/rtw8851b.c +@@ -2,6 +2,7 @@ + /* Copyright(c) 2022-2023 Realtek Corporation + */ + ++#include + #include "coex.h" + #include "efuse.h" + #include "fw.h" +diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852a.c b/drivers/net/wireless/realtek/rtw89/rtw8852a.c +index 2deadec715cf..be2fac9ad72d 100644 +--- a/drivers/net/wireless/realtek/rtw89/rtw8852a.c ++++ b/drivers/net/wireless/realtek/rtw89/rtw8852a.c +@@ -2,6 +2,7 @@ + /* Copyright(c) 2019-2020 Realtek Corporation + */ + ++#include + #include "coex.h" + #include "fw.h" + #include "mac.h" +diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852b.c b/drivers/net/wireless/realtek/rtw89/rtw8852b.c +index d025c4135e1c..856223579b29 100644 +--- a/drivers/net/wireless/realtek/rtw89/rtw8852b.c ++++ b/drivers/net/wireless/realtek/rtw89/rtw8852b.c +@@ -2,6 +2,7 @@ + /* Copyright(c) 2019-2022 Realtek Corporation + */ + ++#include + #include "coex.h" + #include "fw.h" + #include "mac.h" +diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852c.c b/drivers/net/wireless/realtek/rtw89/rtw8852c.c +index 17e6164855fa..c225d3c00d19 100644 +--- a/drivers/net/wireless/realtek/rtw89/rtw8852c.c ++++ b/drivers/net/wireless/realtek/rtw89/rtw8852c.c +@@ -2,6 +2,7 @@ + /* Copyright(c) 2019-2022 Realtek Corporation + */ + ++#include + #include "chan.h" + #include "coex.h" + #include "debug.h"