From: Greg Kroah-Hartman Date: Mon, 23 Dec 2024 12:51:13 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v6.1.122~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=65f465c98ff69aa1d1afa034a5aed1d3ebe1f2ee;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: dt-bindings-net-fec-add-pps-channel-property.patch epoll-add-synchronous-wakeup-support-for-ep_poll_callback.patch io_uring-rw-avoid-punting-to-io-wq-directly.patch io_uring-rw-split-io_read-into-a-helper.patch io_uring-rw-treat-eopnotsupp-for-iocb_nowait-like-eagain.patch --- diff --git a/queue-6.1/dt-bindings-net-fec-add-pps-channel-property.patch b/queue-6.1/dt-bindings-net-fec-add-pps-channel-property.patch new file mode 100644 index 00000000000..e3b8cb6795b --- /dev/null +++ b/queue-6.1/dt-bindings-net-fec-add-pps-channel-property.patch @@ -0,0 +1,39 @@ +From 1aa772be0444a2bd06957f6d31865e80e6ae4244 Mon Sep 17 00:00:00 2001 +From: Francesco Dolcini +Date: Fri, 4 Oct 2024 17:24:17 +0200 +Subject: dt-bindings: net: fec: add pps channel property + +From: Francesco Dolcini + +commit 1aa772be0444a2bd06957f6d31865e80e6ae4244 upstream. + +Add fsl,pps-channel property to select where to connect the PPS signal. +This depends on the internal SoC routing and on the board, for example +on the i.MX8 SoC it can be connected to an external pin (using channel 1) +or to internal eDMA as DMA request (channel 0). + +Signed-off-by: Francesco Dolcini +Acked-by: Conor Dooley +Signed-off-by: Paolo Abeni +Signed-off-by: Csókás, Bence +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/devicetree/bindings/net/fsl,fec.yaml | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/Documentation/devicetree/bindings/net/fsl,fec.yaml ++++ b/Documentation/devicetree/bindings/net/fsl,fec.yaml +@@ -176,6 +176,13 @@ properties: + description: + Register bits of stop mode control, the format is <&gpr req_gpr req_bit>. + ++ fsl,pps-channel: ++ $ref: /schemas/types.yaml#/definitions/uint32 ++ default: 0 ++ description: ++ Specifies to which timer instance the PPS signal is routed. ++ enum: [0, 1, 2, 3] ++ + mdio: + $ref: mdio.yaml# + unevaluatedProperties: false diff --git a/queue-6.1/epoll-add-synchronous-wakeup-support-for-ep_poll_callback.patch b/queue-6.1/epoll-add-synchronous-wakeup-support-for-ep_poll_callback.patch new file mode 100644 index 00000000000..c84698a3a14 --- /dev/null +++ b/queue-6.1/epoll-add-synchronous-wakeup-support-for-ep_poll_callback.patch @@ -0,0 +1,55 @@ +From 900bbaae67e980945dec74d36f8afe0de7556d5a Mon Sep 17 00:00:00 2001 +From: Xuewen Yan +Date: Fri, 26 Apr 2024 16:05:48 +0800 +Subject: epoll: Add synchronous wakeup support for ep_poll_callback + +From: Xuewen Yan + +commit 900bbaae67e980945dec74d36f8afe0de7556d5a upstream. + +Now, the epoll only use wake_up() interface to wake up task. +However, sometimes, there are epoll users which want to use +the synchronous wakeup flag to hint the scheduler, such as +Android binder driver. +So add a wake_up_sync() define, and use the wake_up_sync() +when the sync is true in ep_poll_callback(). + +Co-developed-by: Jing Xia +Signed-off-by: Jing Xia +Signed-off-by: Xuewen Yan +Link: https://lore.kernel.org/r/20240426080548.8203-1-xuewen.yan@unisoc.com +Tested-by: Brian Geffon +Reviewed-by: Brian Geffon +Reported-by: Benoit Lize +Signed-off-by: Christian Brauner +Cc: Brian Geffon +Signed-off-by: Greg Kroah-Hartman +--- + fs/eventpoll.c | 5 ++++- + include/linux/wait.h | 1 + + 2 files changed, 5 insertions(+), 1 deletion(-) + +--- a/fs/eventpoll.c ++++ b/fs/eventpoll.c +@@ -1237,7 +1237,10 @@ static int ep_poll_callback(wait_queue_e + break; + } + } +- wake_up(&ep->wq); ++ if (sync) ++ wake_up_sync(&ep->wq); ++ else ++ wake_up(&ep->wq); + } + if (waitqueue_active(&ep->poll_wait)) + pwake++; +--- a/include/linux/wait.h ++++ b/include/linux/wait.h +@@ -224,6 +224,7 @@ void __wake_up_pollfree(struct wait_queu + #define wake_up_all(x) __wake_up(x, TASK_NORMAL, 0, NULL) + #define wake_up_locked(x) __wake_up_locked((x), TASK_NORMAL, 1) + #define wake_up_all_locked(x) __wake_up_locked((x), TASK_NORMAL, 0) ++#define wake_up_sync(x) __wake_up_sync(x, TASK_NORMAL) + + #define wake_up_interruptible(x) __wake_up(x, TASK_INTERRUPTIBLE, 1, NULL) + #define wake_up_interruptible_nr(x, nr) __wake_up(x, TASK_INTERRUPTIBLE, nr, NULL) diff --git a/queue-6.1/io_uring-rw-avoid-punting-to-io-wq-directly.patch b/queue-6.1/io_uring-rw-avoid-punting-to-io-wq-directly.patch new file mode 100644 index 00000000000..a72bdf39a44 --- /dev/null +++ b/queue-6.1/io_uring-rw-avoid-punting-to-io-wq-directly.patch @@ -0,0 +1,88 @@ +From e02bfb2e81e4213b52bf47adb8b348b2c2fb007c Mon Sep 17 00:00:00 2001 +From: Pavel Begunkov +Date: Mon, 18 Mar 2024 22:00:28 +0000 +Subject: io_uring/rw: avoid punting to io-wq directly + +From: Pavel Begunkov + +Commit 6e6b8c62120a22acd8cb759304e4cd2e3215d488 upstream. + +kiocb_done() should care to specifically redirecting requests to io-wq. +Remove the hopping to tw to then queue an io-wq, return -EAGAIN and let +the core code io_uring handle offloading. + +Signed-off-by: Pavel Begunkov +Tested-by: Ming Lei +Link: https://lore.kernel.org/r/413564e550fe23744a970e1783dfa566291b0e6f.1710799188.git.asml.silence@gmail.com +Signed-off-by: Jens Axboe +(cherry picked from commit 6e6b8c62120a22acd8cb759304e4cd2e3215d488) +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/io_uring.c | 6 +++--- + io_uring/io_uring.h | 1 - + io_uring/rw.c | 8 +------- + 3 files changed, 4 insertions(+), 11 deletions(-) + +--- a/io_uring/io_uring.c ++++ b/io_uring/io_uring.c +@@ -434,7 +434,7 @@ static void io_prep_async_link(struct io + } + } + +-void io_queue_iowq(struct io_kiocb *req, bool *dont_use) ++static void io_queue_iowq(struct io_kiocb *req) + { + struct io_kiocb *link = io_prep_linked_timeout(req); + struct io_uring_task *tctx = req->task->io_uring; +@@ -1913,7 +1913,7 @@ static void io_queue_async(struct io_kio + break; + case IO_APOLL_ABORTED: + io_kbuf_recycle(req, 0); +- io_queue_iowq(req, NULL); ++ io_queue_iowq(req); + break; + case IO_APOLL_OK: + break; +@@ -1962,7 +1962,7 @@ static void io_queue_sqe_fallback(struct + if (unlikely(req->ctx->drain_active)) + io_drain_req(req); + else +- io_queue_iowq(req, NULL); ++ io_queue_iowq(req); + } + } + +--- a/io_uring/io_uring.h ++++ b/io_uring/io_uring.h +@@ -54,7 +54,6 @@ static inline bool io_req_ffs_set(struct + void __io_req_task_work_add(struct io_kiocb *req, bool allow_local); + bool io_alloc_async_data(struct io_kiocb *req); + void io_req_task_queue(struct io_kiocb *req); +-void io_queue_iowq(struct io_kiocb *req, bool *dont_use); + void io_req_task_complete(struct io_kiocb *req, bool *locked); + void io_req_task_queue_fail(struct io_kiocb *req, int ret); + void io_req_task_submit(struct io_kiocb *req, bool *locked); +--- a/io_uring/rw.c ++++ b/io_uring/rw.c +@@ -167,12 +167,6 @@ static inline loff_t *io_kiocb_update_po + return NULL; + } + +-static void io_req_task_queue_reissue(struct io_kiocb *req) +-{ +- req->io_task_work.func = io_queue_iowq; +- io_req_task_work_add(req); +-} +- + #ifdef CONFIG_BLOCK + static bool io_resubmit_prep(struct io_kiocb *req) + { +@@ -341,7 +335,7 @@ static int kiocb_done(struct io_kiocb *r + if (req->flags & REQ_F_REISSUE) { + req->flags &= ~REQ_F_REISSUE; + if (io_resubmit_prep(req)) +- io_req_task_queue_reissue(req); ++ return -EAGAIN; + else + io_req_task_queue_fail(req, final_ret); + } diff --git a/queue-6.1/io_uring-rw-split-io_read-into-a-helper.patch b/queue-6.1/io_uring-rw-split-io_read-into-a-helper.patch new file mode 100644 index 00000000000..a0d43cd7b02 --- /dev/null +++ b/queue-6.1/io_uring-rw-split-io_read-into-a-helper.patch @@ -0,0 +1,51 @@ +From 42bc98ef0358060772fbd344a74285b04e1a5c54 Mon Sep 17 00:00:00 2001 +From: Jens Axboe +Date: Mon, 11 Sep 2023 13:31:56 -0600 +Subject: io_uring/rw: split io_read() into a helper + +From: Jens Axboe + +Commit a08d195b586a217d76b42062f88f375a3eedda4d upstream. + +Add __io_read() which does the grunt of the work, leaving the completion +side to the new io_read(). No functional changes in this patch. + +Reviewed-by: Gabriel Krisman Bertazi +Signed-off-by: Jens Axboe +(cherry picked from commit a08d195b586a217d76b42062f88f375a3eedda4d) +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/rw.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +--- a/io_uring/rw.c ++++ b/io_uring/rw.c +@@ -691,7 +691,7 @@ static int io_rw_init_file(struct io_kio + return 0; + } + +-int io_read(struct io_kiocb *req, unsigned int issue_flags) ++static int __io_read(struct io_kiocb *req, unsigned int issue_flags) + { + struct io_rw *rw = io_kiocb_to_cmd(req, struct io_rw); + struct io_rw_state __s, *s = &__s; +@@ -836,7 +836,18 @@ done: + /* it's faster to check here then delegate to kfree */ + if (iovec) + kfree(iovec); +- return kiocb_done(req, ret, issue_flags); ++ return ret; ++} ++ ++int io_read(struct io_kiocb *req, unsigned int issue_flags) ++{ ++ int ret; ++ ++ ret = __io_read(req, issue_flags); ++ if (ret >= 0) ++ return kiocb_done(req, ret, issue_flags); ++ ++ return ret; + } + + static bool io_kiocb_start_write(struct io_kiocb *req, struct kiocb *kiocb) diff --git a/queue-6.1/io_uring-rw-treat-eopnotsupp-for-iocb_nowait-like-eagain.patch b/queue-6.1/io_uring-rw-treat-eopnotsupp-for-iocb_nowait-like-eagain.patch new file mode 100644 index 00000000000..ea46bf96b2c --- /dev/null +++ b/queue-6.1/io_uring-rw-treat-eopnotsupp-for-iocb_nowait-like-eagain.patch @@ -0,0 +1,46 @@ +From e3d07ed3146b38d0b3fb952e33ce89a98b74cf4f Mon Sep 17 00:00:00 2001 +From: Jens Axboe +Date: Tue, 10 Sep 2024 08:30:57 -0600 +Subject: io_uring/rw: treat -EOPNOTSUPP for IOCB_NOWAIT like -EAGAIN + +From: Jens Axboe + +Commit c0a9d496e0fece67db777bd48550376cf2960c47 upstream. + +Some file systems, ocfs2 in this case, will return -EOPNOTSUPP for +an IOCB_NOWAIT read/write attempt. While this can be argued to be +correct, the usual return value for something that requires blocking +issue is -EAGAIN. + +A refactoring io_uring commit dropped calling kiocb_done() for +negative return values, which is otherwise where we already do that +transformation. To ensure we catch it in both spots, check it in +__io_read() itself as well. + +Reported-by: Robert Sander +Link: https://fosstodon.org/@gurubert@mastodon.gurubert.de/113112431889638440 +Cc: stable@vger.kernel.org +Fixes: a08d195b586a ("io_uring/rw: split io_read() into a helper") +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/rw.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/io_uring/rw.c ++++ b/io_uring/rw.c +@@ -757,6 +757,14 @@ static int __io_read(struct io_kiocb *re + + ret = io_iter_do_read(rw, &s->iter); + ++ /* ++ * Some file systems like to return -EOPNOTSUPP for an IOCB_NOWAIT ++ * issue, even though they should be returning -EAGAIN. To be safe, ++ * retry from blocking context for either. ++ */ ++ if (ret == -EOPNOTSUPP && force_nonblock) ++ ret = -EAGAIN; ++ + if (ret == -EAGAIN || (req->flags & REQ_F_REISSUE)) { + req->flags &= ~REQ_F_REISSUE; + /* if we can poll, just do that */ diff --git a/queue-6.1/series b/queue-6.1/series index 03313fd4731..5c5a696bb50 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -75,3 +75,8 @@ of-fix-error-path-in-of_parse_phandle_with_args_map.patch of-fix-refcount-leakage-for-of-node-returned-by-__of_get_dma_parent.patch ceph-validate-snapdirname-option-length-when-mounting.patch udf-fix-directory-iteration-for-longer-tail-extents.patch +epoll-add-synchronous-wakeup-support-for-ep_poll_callback.patch +io_uring-rw-split-io_read-into-a-helper.patch +io_uring-rw-treat-eopnotsupp-for-iocb_nowait-like-eagain.patch +io_uring-rw-avoid-punting-to-io-wq-directly.patch +dt-bindings-net-fec-add-pps-channel-property.patch