diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-05-11 23:19:12 -0700 |
---|---|---|
committer | Ryan Eatmon <reatmon@ti.com> | 2023-05-15 08:40:21 -0500 |
commit | 4137bd9b30e6d43a927a37bfeee7e8091e682ed1 (patch) | |
tree | f782b98f59603a2da0262ee16ee54cd0f9a4f84c /meta-ti-bsp/recipes-kernel/linux/linux-bb.org | |
parent | 96c6006bb0d6a900ba480fb8c5065669c0a787da (diff) | |
download | meta-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')
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 @@ | |||
1 | From 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arnd Bergmann <arnd@arndb.de> | ||
3 | Date: Wed, 18 Jan 2023 09:07:01 +0100 | ||
4 | Subject: [PATCH] blk-iocost: avoid 64-bit division in ioc_timer_fn | ||
5 | |||
6 | The behavior of 'enum' types has changed in gcc-13, so now the | ||
7 | UNBUSY_THR_PCT constant is interpreted as a 64-bit number because | ||
8 | it is defined as part of the same enum definition as some other | ||
9 | constants that do not fit within a 32-bit integer. This in turn | ||
10 | leads to some inefficient code on 32-bit architectures as well | ||
11 | as a link error: | ||
12 | |||
13 | arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: block/blk-iocost.o: in function `ioc_timer_fn': | ||
14 | blk-iocost.c:(.text+0x68e8): undefined reference to `__aeabi_uldivmod' | ||
15 | arm-linux-gnueabi-ld: blk-iocost.c:(.text+0x6908): undefined reference to `__aeabi_uldivmod' | ||
16 | |||
17 | Split the enum definition to keep the 64-bit timing constants in | ||
18 | a separate enum type from those constants that can clearly fit | ||
19 | within a smaller type. | ||
20 | |||
21 | Signed-off-by: Arnd Bergmann <arnd@arndb.de> | ||
22 | Acked-by: Tejun Heo <tj@kernel.org> | ||
23 | Link: https://lore.kernel.org/r/20230118080706.3303186-1-arnd@kernel.org | ||
24 | Signed-off-by: Jens Axboe <axboe@kernel.dk> | ||
25 | --- | ||
26 | block/blk-iocost.c | 8 +++++--- | ||
27 | 1 file changed, 5 insertions(+), 3 deletions(-) | ||
28 | |||
29 | diff --git a/block/blk-iocost.c b/block/blk-iocost.c | ||
30 | index 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 | -- | ||
56 | 2.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 @@ | |||
1 | From ff1cc97b1f4c10db224f276d9615b22835b8c424 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> | ||
3 | Date: Tue, 13 Dec 2022 13:08:26 +0100 | ||
4 | Subject: [PATCH] block/blk-iocost (gcc13): keep large values in a new enum | ||
5 | |||
6 | Since gcc13, each member of an enum has the same type as the enum [1]. And | ||
7 | that 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, | ||
12 | the named type is unsigned long. | ||
13 | |||
14 | This 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 | |||
21 | So split the anonymous enum with large values to a separate enum, so | ||
22 | that they don't affect other members. | ||
23 | |||
24 | [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113 | ||
25 | |||
26 | Cc: Martin Liska <mliska@suse.cz> | ||
27 | Cc: Tejun Heo <tj@kernel.org> | ||
28 | Cc: Josef Bacik <josef@toxicpanda.com> | ||
29 | Cc: Jens Axboe <axboe@kernel.dk> | ||
30 | Cc: cgroups@vger.kernel.org | ||
31 | Cc: linux-block@vger.kernel.org | ||
32 | Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> | ||
33 | Link: https://lore.kernel.org/r/20221213120826.17446-1-jirislaby@kernel.org | ||
34 | Signed-off-by: Jens Axboe <axboe@kernel.dk> | ||
35 | --- | ||
36 | block/blk-iocost.c | 2 ++ | ||
37 | 1 file changed, 2 insertions(+) | ||
38 | |||
39 | diff --git a/block/blk-iocost.c b/block/blk-iocost.c | ||
40 | index 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 | -- | ||
54 | 2.40.1 | ||