forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generic: 6.1, 6.6: replace Airoha EN8811H PHY driver with upstream
Backport driver from upcoming Linux 6.10 and put a pending fix on top to make sure the netdev trigger offloading behaves as expected. Signed-off-by: Daniel Golle <[email protected]>
- Loading branch information
Showing
12 changed files
with
1,411 additions
and
641 deletions.
There are no files selected for viewing
161 changes: 161 additions & 0 deletions
161
target/linux/generic/backport-6.1/301-v6.9-kernel.h-removed-REPEAT_BYTE-from-kernel.h.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
From 66a5c40f60f5d88ad8d47ba6a4ba05892853fa1f Mon Sep 17 00:00:00 2001 | ||
From: Tanzir Hasan <[email protected]> | ||
Date: Tue, 26 Dec 2023 18:00:00 +0000 | ||
Subject: [PATCH] kernel.h: removed REPEAT_BYTE from kernel.h | ||
|
||
This patch creates wordpart.h and includes it in asm/word-at-a-time.h | ||
for all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h | ||
because of REPEAT_BYTE. Moving this to another header and including it | ||
where necessary allows us to not include the bloated kernel.h. Making | ||
this implicit dependency on REPEAT_BYTE explicit allows for later | ||
improvements in the lib/string.c inclusion list. | ||
|
||
Suggested-by: Al Viro <[email protected]> | ||
Suggested-by: Andy Shevchenko <[email protected]> | ||
Signed-off-by: Tanzir Hasan <[email protected]> | ||
Reviewed-by: Andy Shevchenko <[email protected]> | ||
Link: https://lore.kernel.org/r/[email protected] | ||
Signed-off-by: Kees Cook <[email protected]> | ||
--- | ||
arch/arm/include/asm/word-at-a-time.h | 3 ++- | ||
arch/arm64/include/asm/word-at-a-time.h | 3 ++- | ||
arch/powerpc/include/asm/word-at-a-time.h | 4 ++-- | ||
arch/riscv/include/asm/word-at-a-time.h | 3 ++- | ||
arch/s390/include/asm/word-at-a-time.h | 3 ++- | ||
arch/sh/include/asm/word-at-a-time.h | 2 ++ | ||
arch/x86/include/asm/word-at-a-time.h | 3 ++- | ||
arch/x86/kvm/mmu/mmu.c | 1 + | ||
fs/namei.c | 2 +- | ||
include/asm-generic/word-at-a-time.h | 3 ++- | ||
include/linux/kernel.h | 8 -------- | ||
include/linux/wordpart.h | 13 +++++++++++++ | ||
12 files changed, 31 insertions(+), 17 deletions(-) | ||
create mode 100644 include/linux/wordpart.h | ||
|
||
--- a/arch/arm/include/asm/word-at-a-time.h | ||
+++ b/arch/arm/include/asm/word-at-a-time.h | ||
@@ -8,7 +8,8 @@ | ||
* Little-endian word-at-a-time zero byte handling. | ||
* Heavily based on the x86 algorithm. | ||
*/ | ||
-#include <linux/kernel.h> | ||
+#include <linux/bitops.h> | ||
+#include <linux/wordpart.h> | ||
|
||
struct word_at_a_time { | ||
const unsigned long one_bits, high_bits; | ||
--- a/arch/arm64/include/asm/word-at-a-time.h | ||
+++ b/arch/arm64/include/asm/word-at-a-time.h | ||
@@ -9,7 +9,8 @@ | ||
|
||
#ifndef __AARCH64EB__ | ||
|
||
-#include <linux/kernel.h> | ||
+#include <linux/bitops.h> | ||
+#include <linux/wordpart.h> | ||
|
||
struct word_at_a_time { | ||
const unsigned long one_bits, high_bits; | ||
--- a/arch/powerpc/include/asm/word-at-a-time.h | ||
+++ b/arch/powerpc/include/asm/word-at-a-time.h | ||
@@ -4,8 +4,8 @@ | ||
/* | ||
* Word-at-a-time interfaces for PowerPC. | ||
*/ | ||
- | ||
-#include <linux/kernel.h> | ||
+#include <linux/bitops.h> | ||
+#include <linux/wordpart.h> | ||
#include <asm/asm-compat.h> | ||
#include <asm/extable.h> | ||
|
||
--- a/arch/sh/include/asm/word-at-a-time.h | ||
+++ b/arch/sh/include/asm/word-at-a-time.h | ||
@@ -5,6 +5,8 @@ | ||
#ifdef CONFIG_CPU_BIG_ENDIAN | ||
# include <asm-generic/word-at-a-time.h> | ||
#else | ||
+#include <linux/bitops.h> | ||
+#include <linux/wordpart.h> | ||
/* | ||
* Little-endian version cribbed from x86. | ||
*/ | ||
--- a/arch/x86/include/asm/word-at-a-time.h | ||
+++ b/arch/x86/include/asm/word-at-a-time.h | ||
@@ -2,7 +2,8 @@ | ||
#ifndef _ASM_WORD_AT_A_TIME_H | ||
#define _ASM_WORD_AT_A_TIME_H | ||
|
||
-#include <linux/kernel.h> | ||
+#include <linux/bitops.h> | ||
+#include <linux/wordpart.h> | ||
|
||
/* | ||
* This is largely generic for little-endian machines, but the | ||
--- a/arch/x86/kvm/mmu/mmu.c | ||
+++ b/arch/x86/kvm/mmu/mmu.c | ||
@@ -44,6 +44,7 @@ | ||
#include <linux/kern_levels.h> | ||
#include <linux/kstrtox.h> | ||
#include <linux/kthread.h> | ||
+#include <linux/wordpart.h> | ||
|
||
#include <asm/page.h> | ||
#include <asm/memtype.h> | ||
--- a/fs/namei.c | ||
+++ b/fs/namei.c | ||
@@ -17,8 +17,8 @@ | ||
|
||
#include <linux/init.h> | ||
#include <linux/export.h> | ||
-#include <linux/kernel.h> | ||
#include <linux/slab.h> | ||
+#include <linux/wordpart.h> | ||
#include <linux/fs.h> | ||
#include <linux/namei.h> | ||
#include <linux/pagemap.h> | ||
--- a/include/asm-generic/word-at-a-time.h | ||
+++ b/include/asm-generic/word-at-a-time.h | ||
@@ -2,7 +2,8 @@ | ||
#ifndef _ASM_WORD_AT_A_TIME_H | ||
#define _ASM_WORD_AT_A_TIME_H | ||
|
||
-#include <linux/kernel.h> | ||
+#include <linux/bitops.h> | ||
+#include <linux/wordpart.h> | ||
#include <asm/byteorder.h> | ||
|
||
#ifdef __BIG_ENDIAN | ||
--- a/include/linux/kernel.h | ||
+++ b/include/linux/kernel.h | ||
@@ -36,14 +36,6 @@ | ||
|
||
#define STACK_MAGIC 0xdeadbeef | ||
|
||
-/** | ||
- * REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value | ||
- * @x: value to repeat | ||
- * | ||
- * NOTE: @x is not checked for > 0xff; larger values produce odd results. | ||
- */ | ||
-#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) | ||
- | ||
/* generic data direction definitions */ | ||
#define READ 0 | ||
#define WRITE 1 | ||
--- /dev/null | ||
+++ b/include/linux/wordpart.h | ||
@@ -0,0 +1,13 @@ | ||
+/* SPDX-License-Identifier: GPL-2.0 */ | ||
+ | ||
+#ifndef _LINUX_WORDPART_H | ||
+#define _LINUX_WORDPART_H | ||
+/** | ||
+ * REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value | ||
+ * @x: value to repeat | ||
+ * | ||
+ * NOTE: @x is not checked for > 0xff; larger values produce odd results. | ||
+ */ | ||
+#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) | ||
+ | ||
+#endif // _LINUX_WORDPART_H |
107 changes: 107 additions & 0 deletions
107
.../generic/backport-6.1/302-v6.9-kernel.h-Move-upper_-_bits-and-lower_-_bits-to-wordp.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
From adeb04362d74188c1e22ccb824b15a0a7b3de2f4 Mon Sep 17 00:00:00 2001 | ||
From: Andy Shevchenko <[email protected]> | ||
Date: Wed, 14 Feb 2024 19:26:32 +0200 | ||
Subject: [PATCH] kernel.h: Move upper_*_bits() and lower_*_bits() to | ||
wordpart.h | ||
|
||
The wordpart.h header is collecting APIs related to the handling | ||
parts of the word (usually in byte granularity). The upper_*_bits() | ||
and lower_*_bits() are good candidates to be moved to there. | ||
|
||
This helps to clean up header dependency hell with regard to kernel.h | ||
as the latter gathers completely unrelated stuff together and slows | ||
down compilation (especially when it's included into other header). | ||
|
||
Signed-off-by: Andy Shevchenko <[email protected]> | ||
Link: https://lore.kernel.org/r/[email protected] | ||
Reviewed-by: Randy Dunlap <[email protected]> | ||
Signed-off-by: Kees Cook <[email protected]> | ||
--- | ||
include/linux/kernel.h | 30 ++---------------------------- | ||
include/linux/wordpart.h | 29 +++++++++++++++++++++++++++++ | ||
2 files changed, 31 insertions(+), 28 deletions(-) | ||
|
||
--- a/include/linux/kernel.h | ||
+++ b/include/linux/kernel.h | ||
@@ -30,6 +30,8 @@ | ||
#include <linux/build_bug.h> | ||
#include <linux/static_call_types.h> | ||
#include <linux/instruction_pointer.h> | ||
+#include <linux/wordpart.h> | ||
+ | ||
#include <asm/byteorder.h> | ||
|
||
#include <uapi/linux/kernel.h> | ||
@@ -55,34 +57,6 @@ | ||
} \ | ||
) | ||
|
||
-/** | ||
- * upper_32_bits - return bits 32-63 of a number | ||
- * @n: the number we're accessing | ||
- * | ||
- * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress | ||
- * the "right shift count >= width of type" warning when that quantity is | ||
- * 32-bits. | ||
- */ | ||
-#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) | ||
- | ||
-/** | ||
- * lower_32_bits - return bits 0-31 of a number | ||
- * @n: the number we're accessing | ||
- */ | ||
-#define lower_32_bits(n) ((u32)((n) & 0xffffffff)) | ||
- | ||
-/** | ||
- * upper_16_bits - return bits 16-31 of a number | ||
- * @n: the number we're accessing | ||
- */ | ||
-#define upper_16_bits(n) ((u16)((n) >> 16)) | ||
- | ||
-/** | ||
- * lower_16_bits - return bits 0-15 of a number | ||
- * @n: the number we're accessing | ||
- */ | ||
-#define lower_16_bits(n) ((u16)((n) & 0xffff)) | ||
- | ||
struct completion; | ||
struct user; | ||
|
||
--- a/include/linux/wordpart.h | ||
+++ b/include/linux/wordpart.h | ||
@@ -2,6 +2,35 @@ | ||
|
||
#ifndef _LINUX_WORDPART_H | ||
#define _LINUX_WORDPART_H | ||
+ | ||
+/** | ||
+ * upper_32_bits - return bits 32-63 of a number | ||
+ * @n: the number we're accessing | ||
+ * | ||
+ * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress | ||
+ * the "right shift count >= width of type" warning when that quantity is | ||
+ * 32-bits. | ||
+ */ | ||
+#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) | ||
+ | ||
+/** | ||
+ * lower_32_bits - return bits 0-31 of a number | ||
+ * @n: the number we're accessing | ||
+ */ | ||
+#define lower_32_bits(n) ((u32)((n) & 0xffffffff)) | ||
+ | ||
+/** | ||
+ * upper_16_bits - return bits 16-31 of a number | ||
+ * @n: the number we're accessing | ||
+ */ | ||
+#define upper_16_bits(n) ((u16)((n) >> 16)) | ||
+ | ||
+/** | ||
+ * lower_16_bits - return bits 0-15 of a number | ||
+ * @n: the number we're accessing | ||
+ */ | ||
+#define lower_16_bits(n) ((u16)((n) & 0xffff)) | ||
+ | ||
/** | ||
* REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value | ||
* @x: value to repeat |
Oops, something went wrong.