summaryrefslogtreecommitdiffstats
path: root/meta-ti-bsp/recipes-kernel/linux/linux-bb.org
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-05-11 23:19:12 -0700
committerRyan Eatmon <reatmon@ti.com>2023-05-15 08:40:21 -0500
commit4137bd9b30e6d43a927a37bfeee7e8091e682ed1 (patch)
treef782b98f59603a2da0262ee16ee54cd0f9a4f84c /meta-ti-bsp/recipes-kernel/linux/linux-bb.org
parent96c6006bb0d6a900ba480fb8c5065669c0a787da (diff)
downloadmeta-ti-4137bd9b30e6d43a927a37bfeee7e8091e682ed1.tar.gz
linux-bb.org_git.bb: Fix build with gcc-13
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Diffstat (limited to 'meta-ti-bsp/recipes-kernel/linux/linux-bb.org')
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch56
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-block-blk-iocost-gcc13-keep-large-values-in-a-new-en.patch54
2 files changed, 110 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch
new file mode 100644
index 00000000..a7806c22
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch
@@ -0,0 +1,56 @@
1From 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 Mon Sep 17 00:00:00 2001
2From: Arnd Bergmann <arnd@arndb.de>
3Date: Wed, 18 Jan 2023 09:07:01 +0100
4Subject: [PATCH] blk-iocost: avoid 64-bit division in ioc_timer_fn
5
6The behavior of 'enum' types has changed in gcc-13, so now the
7UNBUSY_THR_PCT constant is interpreted as a 64-bit number because
8it is defined as part of the same enum definition as some other
9constants that do not fit within a 32-bit integer. This in turn
10leads to some inefficient code on 32-bit architectures as well
11as a link error:
12
13arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: block/blk-iocost.o: in function `ioc_timer_fn':
14blk-iocost.c:(.text+0x68e8): undefined reference to `__aeabi_uldivmod'
15arm-linux-gnueabi-ld: blk-iocost.c:(.text+0x6908): undefined reference to `__aeabi_uldivmod'
16
17Split the enum definition to keep the 64-bit timing constants in
18a separate enum type from those constants that can clearly fit
19within a smaller type.
20
21Signed-off-by: Arnd Bergmann <arnd@arndb.de>
22Acked-by: Tejun Heo <tj@kernel.org>
23Link: https://lore.kernel.org/r/20230118080706.3303186-1-arnd@kernel.org
24Signed-off-by: Jens Axboe <axboe@kernel.dk>
25---
26 block/blk-iocost.c | 8 +++++---
27 1 file changed, 5 insertions(+), 3 deletions(-)
28
29diff --git a/block/blk-iocost.c b/block/blk-iocost.c
30index 6955605629e4..b691b6bb498f 100644
31--- a/block/blk-iocost.c
32+++ b/block/blk-iocost.c
33@@ -258,6 +258,11 @@ enum {
34 VRATE_MIN = VTIME_PER_USEC * VRATE_MIN_PPM / MILLION,
35 VRATE_CLAMP_ADJ_PCT = 4,
36
37+ /* switch iff the conditions are met for longer than this */
38+ AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC,
39+};
40+
41+enum {
42 /* if IOs end up waiting for requests, issue less */
43 RQ_WAIT_BUSY_PCT = 5,
44
45@@ -296,9 +301,6 @@ enum {
46 /* don't let cmds which take a very long time pin lagging for too long */
47 MAX_LAGGING_PERIODS = 10,
48
49- /* switch iff the conditions are met for longer than this */
50- AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC,
51-
52 /*
53 * Count IO size in 4k pages. The 12bit shift helps keeping
54 * size-proportional components of cost calculation in closer
55--
562.40.1
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-block-blk-iocost-gcc13-keep-large-values-in-a-new-en.patch b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-block-blk-iocost-gcc13-keep-large-values-in-a-new-en.patch
new file mode 100644
index 00000000..f5d0f476
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-block-blk-iocost-gcc13-keep-large-values-in-a-new-en.patch
@@ -0,0 +1,54 @@
1From ff1cc97b1f4c10db224f276d9615b22835b8c424 Mon Sep 17 00:00:00 2001
2From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
3Date: Tue, 13 Dec 2022 13:08:26 +0100
4Subject: [PATCH] block/blk-iocost (gcc13): keep large values in a new enum
5
6Since gcc13, each member of an enum has the same type as the enum [1]. And
7that is inherited from its members. Provided:
8 VTIME_PER_SEC_SHIFT = 37,
9 VTIME_PER_SEC = 1LLU << VTIME_PER_SEC_SHIFT,
10 ...
11 AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC,
12the named type is unsigned long.
13
14This generates warnings with gcc-13:
15 block/blk-iocost.c: In function 'ioc_weight_prfill':
16 block/blk-iocost.c:3037:37: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int'
17
18 block/blk-iocost.c: In function 'ioc_weight_show':
19 block/blk-iocost.c:3047:34: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int'
20
21So split the anonymous enum with large values to a separate enum, so
22that they don't affect other members.
23
24[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113
25
26Cc: Martin Liska <mliska@suse.cz>
27Cc: Tejun Heo <tj@kernel.org>
28Cc: Josef Bacik <josef@toxicpanda.com>
29Cc: Jens Axboe <axboe@kernel.dk>
30Cc: cgroups@vger.kernel.org
31Cc: linux-block@vger.kernel.org
32Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
33Link: https://lore.kernel.org/r/20221213120826.17446-1-jirislaby@kernel.org
34Signed-off-by: Jens Axboe <axboe@kernel.dk>
35---
36 block/blk-iocost.c | 2 ++
37 1 file changed, 2 insertions(+)
38
39diff --git a/block/blk-iocost.c b/block/blk-iocost.c
40index d1bdc12deaa7..549ddc9e0c6f 100644
41--- a/block/blk-iocost.c
42+++ b/block/blk-iocost.c
43@@ -232,7 +232,9 @@ enum {
44
45 /* 1/64k is granular enough and can easily be handled w/ u32 */
46 WEIGHT_ONE = 1 << 16,
47+};
48
49+enum {
50 /*
51 * As vtime is used to calculate the cost of each IO, it needs to
52 * be fairly high precision. For example, it should be able to
53--
542.40.1