]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 15:07:40 +0000 (17:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 15:07:40 +0000 (17:07 +0200)
added patches:
blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch
block-blk-iocost-gcc13-keep-large-values-in-a-new-enum.patch
i40iw-fix-build-warning-in-i40iw_manage_apbvt.patch

queue-5.10/blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch [new file with mode: 0644]
queue-5.10/block-blk-iocost-gcc13-keep-large-values-in-a-new-enum.patch [new file with mode: 0644]
queue-5.10/i40iw-fix-build-warning-in-i40iw_manage_apbvt.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch b/queue-5.10/blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch
new file mode 100644 (file)
index 0000000..b6bab5d
--- /dev/null
@@ -0,0 +1,57 @@
+From 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Wed, 18 Jan 2023 09:07:01 +0100
+Subject: blk-iocost: avoid 64-bit division in ioc_timer_fn
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 upstream.
+
+The behavior of 'enum' types has changed in gcc-13, so now the
+UNBUSY_THR_PCT constant is interpreted as a 64-bit number because
+it is defined as part of the same enum definition as some other
+constants that do not fit within a 32-bit integer. This in turn
+leads to some inefficient code on 32-bit architectures as well
+as a link error:
+
+arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: block/blk-iocost.o: in function `ioc_timer_fn':
+blk-iocost.c:(.text+0x68e8): undefined reference to `__aeabi_uldivmod'
+arm-linux-gnueabi-ld: blk-iocost.c:(.text+0x6908): undefined reference to `__aeabi_uldivmod'
+
+Split the enum definition to keep the 64-bit timing constants in
+a separate enum type from those constants that can clearly fit
+within a smaller type.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Tejun Heo <tj@kernel.org>
+Link: https://lore.kernel.org/r/20230118080706.3303186-1-arnd@kernel.org
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-iocost.c |    8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/block/blk-iocost.c
++++ b/block/blk-iocost.c
+@@ -256,6 +256,11 @@ enum {
+       VRATE_MIN               = VTIME_PER_USEC * VRATE_MIN_PPM / MILLION,
+       VRATE_CLAMP_ADJ_PCT     = 4,
++      /* switch iff the conditions are met for longer than this */
++      AUTOP_CYCLE_NSEC        = 10LLU * NSEC_PER_SEC,
++};
++
++enum {
+       /* if IOs end up waiting for requests, issue less */
+       RQ_WAIT_BUSY_PCT        = 5,
+@@ -294,9 +299,6 @@ enum {
+       /* don't let cmds which take a very long time pin lagging for too long */
+       MAX_LAGGING_PERIODS     = 10,
+-      /* switch iff the conditions are met for longer than this */
+-      AUTOP_CYCLE_NSEC        = 10LLU * NSEC_PER_SEC,
+-
+       /*
+        * Count IO size in 4k pages.  The 12bit shift helps keeping
+        * size-proportional components of cost calculation in closer
diff --git a/queue-5.10/block-blk-iocost-gcc13-keep-large-values-in-a-new-enum.patch b/queue-5.10/block-blk-iocost-gcc13-keep-large-values-in-a-new-enum.patch
new file mode 100644 (file)
index 0000000..8bdfae4
--- /dev/null
@@ -0,0 +1,55 @@
+From ff1cc97b1f4c10db224f276d9615b22835b8c424 Mon Sep 17 00:00:00 2001
+From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
+Date: Tue, 13 Dec 2022 13:08:26 +0100
+Subject: block/blk-iocost (gcc13): keep large values in a new enum
+
+From: Jiri Slaby (SUSE) <jirislaby@kernel.org>
+
+commit ff1cc97b1f4c10db224f276d9615b22835b8c424 upstream.
+
+Since gcc13, each member of an enum has the same type as the enum [1]. And
+that is inherited from its members. Provided:
+  VTIME_PER_SEC_SHIFT     = 37,
+  VTIME_PER_SEC           = 1LLU << VTIME_PER_SEC_SHIFT,
+  ...
+  AUTOP_CYCLE_NSEC        = 10LLU * NSEC_PER_SEC,
+the named type is unsigned long.
+
+This generates warnings with gcc-13:
+  block/blk-iocost.c: In function 'ioc_weight_prfill':
+  block/blk-iocost.c:3037:37: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int'
+
+  block/blk-iocost.c: In function 'ioc_weight_show':
+  block/blk-iocost.c:3047:34: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int'
+
+So split the anonymous enum with large values to a separate enum, so
+that they don't affect other members.
+
+[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113
+
+Cc: Martin Liska <mliska@suse.cz>
+Cc: Tejun Heo <tj@kernel.org>
+Cc: Josef Bacik <josef@toxicpanda.com>
+Cc: Jens Axboe <axboe@kernel.dk>
+Cc: cgroups@vger.kernel.org
+Cc: linux-block@vger.kernel.org
+Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
+Link: https://lore.kernel.org/r/20221213120826.17446-1-jirislaby@kernel.org
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-iocost.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/block/blk-iocost.c
++++ b/block/blk-iocost.c
+@@ -232,7 +232,9 @@ enum {
+       /* 1/64k is granular enough and can easily be handled w/ u32 */
+       WEIGHT_ONE              = 1 << 16,
++};
++enum {
+       /*
+        * As vtime is used to calculate the cost of each IO, it needs to
+        * be fairly high precision.  For example, it should be able to
diff --git a/queue-5.10/i40iw-fix-build-warning-in-i40iw_manage_apbvt.patch b/queue-5.10/i40iw-fix-build-warning-in-i40iw_manage_apbvt.patch
new file mode 100644 (file)
index 0000000..af245bb
--- /dev/null
@@ -0,0 +1,31 @@
+From foo@baz Fri Jun  9 04:58:27 PM CEST 2023
+Date: Fri, 09 Jun 2023 16:58:27 +0200
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: i40iw: fix build warning in i40iw_manage_apbvt()
+
+Not upstream as this function is no longer around anymore.
+
+The function i40iw_manage_apbvt() has the wrong prototype match from the
+.h file to the .c declaration, so fix it up, otherwise gcc-13 complains
+(rightfully) that the type is incorrect.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/infiniband/hw/i40iw/i40iw.h |    5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/drivers/infiniband/hw/i40iw/i40iw.h
++++ b/drivers/infiniband/hw/i40iw/i40iw.h
+@@ -422,9 +422,8 @@ void i40iw_manage_arp_cache(struct i40iw
+                           bool ipv4,
+                           u32 action);
+-int i40iw_manage_apbvt(struct i40iw_device *iwdev,
+-                     u16 accel_local_port,
+-                     bool add_port);
++enum i40iw_status_code i40iw_manage_apbvt(struct i40iw_device *iwdev,
++                                        u16 accel_local_port, bool add_port);
+ struct i40iw_cqp_request *i40iw_get_cqp_request(struct i40iw_cqp *cqp, bool wait);
+ void i40iw_free_cqp_request(struct i40iw_cqp *cqp, struct i40iw_cqp_request *cqp_request);
index 5ff85dc71d29093c96790d61f4c9473efaedddbb..77ff832f007d49b071d7dc615d6592a07a4586f9 100644 (file)
@@ -4,3 +4,6 @@ sfc-gcc13-synchronize-ef100_enqueue_skb-s-return-type.patch
 remove-the-sx8-block-driver.patch
 bonding-gcc13-synchronize-bond_-a-t-lb_xmit-types.patch
 f2fs-fix-iostat-lock-protection.patch
+blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch
+block-blk-iocost-gcc13-keep-large-values-in-a-new-enum.patch
+i40iw-fix-build-warning-in-i40iw_manage_apbvt.patch