From: Greg Kroah-Hartman Date: Sat, 24 Jun 2023 14:12:13 +0000 (+0200) Subject: 6.3-stable patches X-Git-Tag: v4.14.320~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c13958e7b6a947969bf0f253d6af6cc7ae0bc183;p=thirdparty%2Fkernel%2Fstable-queue.git 6.3-stable patches added patches: arm64-dts-rockchip-fix-rk356x-pcie-register-and-range-mappings.patch block-make-sure-local-irq-is-disabled-when-calling-__blkcg_rstat_flush.patch io_uring-poll-serialize-poll-linked-timer-start-with-poll-removal.patch --- diff --git a/queue-6.3/arm64-dts-rockchip-fix-rk356x-pcie-register-and-range-mappings.patch b/queue-6.3/arm64-dts-rockchip-fix-rk356x-pcie-register-and-range-mappings.patch new file mode 100644 index 00000000000..4626b81cdc7 --- /dev/null +++ b/queue-6.3/arm64-dts-rockchip-fix-rk356x-pcie-register-and-range-mappings.patch @@ -0,0 +1,82 @@ +From 568a67e742dfa90b19a23305317164c5c350b71e Mon Sep 17 00:00:00 2001 +From: Andrew Powers-Holmes +Date: Thu, 1 Jun 2023 15:25:16 +0200 +Subject: arm64: dts: rockchip: Fix rk356x PCIe register and range mappings + +From: Andrew Powers-Holmes + +commit 568a67e742dfa90b19a23305317164c5c350b71e upstream. + +The register and range mappings for the PCIe controller in Rockchip's +RK356x SoCs are incorrect. Replace them with corrected values from the +vendor BSP sources, updated to match current DT schema. + +These values are also used in u-boot. + +Fixes: 66b51ea7d70f ("arm64: dts: rockchip: Add rk3568 PCIe2x1 controller") +Cc: stable@vger.kernel.org +Signed-off-by: Andrew Powers-Holmes +Signed-off-by: Jonas Karlman +Signed-off-by: Nicolas Frattaroli +Tested-by: Diederik de Haas +Link: https://lore.kernel.org/r/20230601132516.153934-1-frattaroli.nicolas@gmail.com +Signed-off-by: Heiko Stuebner +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/boot/dts/rockchip/rk3568.dtsi | 14 ++++++++------ + arch/arm64/boot/dts/rockchip/rk356x.dtsi | 7 ++++--- + 2 files changed, 12 insertions(+), 9 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi +@@ -94,9 +94,10 @@ + power-domains = <&power RK3568_PD_PIPE>; + reg = <0x3 0xc0400000 0x0 0x00400000>, + <0x0 0xfe270000 0x0 0x00010000>, +- <0x3 0x7f000000 0x0 0x01000000>; +- ranges = <0x01000000 0x0 0x3ef00000 0x3 0x7ef00000 0x0 0x00100000>, +- <0x02000000 0x0 0x00000000 0x3 0x40000000 0x0 0x3ef00000>; ++ <0x0 0xf2000000 0x0 0x00100000>; ++ ranges = <0x01000000 0x0 0xf2100000 0x0 0xf2100000 0x0 0x00100000>, ++ <0x02000000 0x0 0xf2200000 0x0 0xf2200000 0x0 0x01e00000>, ++ <0x03000000 0x0 0x40000000 0x3 0x40000000 0x0 0x40000000>; + reg-names = "dbi", "apb", "config"; + resets = <&cru SRST_PCIE30X1_POWERUP>; + reset-names = "pipe"; +@@ -146,9 +147,10 @@ + power-domains = <&power RK3568_PD_PIPE>; + reg = <0x3 0xc0800000 0x0 0x00400000>, + <0x0 0xfe280000 0x0 0x00010000>, +- <0x3 0xbf000000 0x0 0x01000000>; +- ranges = <0x01000000 0x0 0x3ef00000 0x3 0xbef00000 0x0 0x00100000>, +- <0x02000000 0x0 0x00000000 0x3 0x80000000 0x0 0x3ef00000>; ++ <0x0 0xf0000000 0x0 0x00100000>; ++ ranges = <0x01000000 0x0 0xf0100000 0x0 0xf0100000 0x0 0x00100000>, ++ <0x02000000 0x0 0xf0200000 0x0 0xf0200000 0x0 0x01e00000>, ++ <0x03000000 0x0 0x40000000 0x3 0x80000000 0x0 0x40000000>; + reg-names = "dbi", "apb", "config"; + resets = <&cru SRST_PCIE30X2_POWERUP>; + reset-names = "pipe"; +--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi +@@ -952,7 +952,7 @@ + compatible = "rockchip,rk3568-pcie"; + reg = <0x3 0xc0000000 0x0 0x00400000>, + <0x0 0xfe260000 0x0 0x00010000>, +- <0x3 0x3f000000 0x0 0x01000000>; ++ <0x0 0xf4000000 0x0 0x00100000>; + reg-names = "dbi", "apb", "config"; + interrupts = , + , +@@ -982,8 +982,9 @@ + phys = <&combphy2 PHY_TYPE_PCIE>; + phy-names = "pcie-phy"; + power-domains = <&power RK3568_PD_PIPE>; +- ranges = <0x01000000 0x0 0x3ef00000 0x3 0x3ef00000 0x0 0x00100000 +- 0x02000000 0x0 0x00000000 0x3 0x00000000 0x0 0x3ef00000>; ++ ranges = <0x01000000 0x0 0xf4100000 0x0 0xf4100000 0x0 0x00100000>, ++ <0x02000000 0x0 0xf4200000 0x0 0xf4200000 0x0 0x01e00000>, ++ <0x03000000 0x0 0x40000000 0x3 0x00000000 0x0 0x40000000>; + resets = <&cru SRST_PCIE20_POWERUP>; + reset-names = "pipe"; + #address-cells = <3>; diff --git a/queue-6.3/block-make-sure-local-irq-is-disabled-when-calling-__blkcg_rstat_flush.patch b/queue-6.3/block-make-sure-local-irq-is-disabled-when-calling-__blkcg_rstat_flush.patch new file mode 100644 index 00000000000..86db788bd8d --- /dev/null +++ b/queue-6.3/block-make-sure-local-irq-is-disabled-when-calling-__blkcg_rstat_flush.patch @@ -0,0 +1,64 @@ +From 9c39b7a905d84b7da5f59d80f2e455853fea7217 Mon Sep 17 00:00:00 2001 +From: Ming Lei +Date: Thu, 22 Jun 2023 16:42:49 +0800 +Subject: block: make sure local irq is disabled when calling __blkcg_rstat_flush + +From: Ming Lei + +commit 9c39b7a905d84b7da5f59d80f2e455853fea7217 upstream. + +When __blkcg_rstat_flush() is called from cgroup_rstat_flush*() code +path, interrupt is always disabled. + +When we start to flush blkcg per-cpu stats list in __blkg_release() +for avoiding to leak blkcg_gq's reference in commit 20cb1c2fb756 +("blk-cgroup: Flush stats before releasing blkcg_gq"), local irq +isn't disabled yet, then lockdep warning may be triggered because +the dependent cgroup locks may be acquired from irq(soft irq) handler. + +Fix the issue by disabling local irq always. + +Fixes: 20cb1c2fb756 ("blk-cgroup: Flush stats before releasing blkcg_gq") +Reported-by: Shinichiro Kawasaki +Closes: https://lore.kernel.org/linux-block/pz2wzwnmn5tk3pwpskmjhli6g3qly7eoknilb26of376c7kwxy@qydzpvt6zpis/T/#u +Cc: stable@vger.kernel.org +Cc: Jay Shin +Cc: Tejun Heo +Cc: Waiman Long +Signed-off-by: Ming Lei +Reviewed-by: Waiman Long +Link: https://lore.kernel.org/r/20230622084249.1208005-1-ming.lei@redhat.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + block/blk-cgroup.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/block/blk-cgroup.c ++++ b/block/blk-cgroup.c +@@ -907,6 +907,7 @@ static void __blkcg_rstat_flush(struct b + struct llist_head *lhead = per_cpu_ptr(blkcg->lhead, cpu); + struct llist_node *lnode; + struct blkg_iostat_set *bisc, *next_bisc; ++ unsigned long flags; + + rcu_read_lock(); + +@@ -920,7 +921,7 @@ static void __blkcg_rstat_flush(struct b + * When flushing from cgroup, cgroup_rstat_lock is always held, so + * this lock won't cause contention most of time. + */ +- raw_spin_lock(&blkg_stat_lock); ++ raw_spin_lock_irqsave(&blkg_stat_lock, flags); + + /* + * Iterate only the iostat_cpu's queued in the lockless list. +@@ -946,7 +947,7 @@ static void __blkcg_rstat_flush(struct b + blkcg_iostat_update(parent, &blkg->iostat.cur, + &blkg->iostat.last); + } +- raw_spin_unlock(&blkg_stat_lock); ++ raw_spin_unlock_irqrestore(&blkg_stat_lock, flags); + out: + rcu_read_unlock(); + } diff --git a/queue-6.3/io_uring-poll-serialize-poll-linked-timer-start-with-poll-removal.patch b/queue-6.3/io_uring-poll-serialize-poll-linked-timer-start-with-poll-removal.patch new file mode 100644 index 00000000000..257c08eb50b --- /dev/null +++ b/queue-6.3/io_uring-poll-serialize-poll-linked-timer-start-with-poll-removal.patch @@ -0,0 +1,71 @@ +From 6d4684e81a28a9647e263a532281bb3a020282fc Mon Sep 17 00:00:00 2001 +From: Jens Axboe +Date: Sat, 17 Jun 2023 19:50:24 -0600 +Subject: io_uring/poll: serialize poll linked timer start with poll removal + +From: Jens Axboe + +Commit ef7dfac51d8ed961b742218f526bd589f3900a59 upstream. + +We selectively grab the ctx->uring_lock for poll update/removal, but +we really should grab it from the start to fully synchronize with +linked timeouts. Normally this is indeed the case, but if requests +are forced async by the application, we don't fully cover removal +and timer disarm within the uring_lock. + +Make this simpler by having consistent locking state for poll removal. + +Cc: stable@vger.kernel.org # 6.1+ +Reported-by: Querijn Voet +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/poll.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/io_uring/poll.c ++++ b/io_uring/poll.c +@@ -977,8 +977,9 @@ int io_poll_remove(struct io_kiocb *req, + struct io_hash_bucket *bucket; + struct io_kiocb *preq; + int ret2, ret = 0; +- bool locked; ++ bool locked = true; + ++ io_ring_submit_lock(ctx, issue_flags); + preq = io_poll_find(ctx, true, &cd, &ctx->cancel_table, &bucket); + ret2 = io_poll_disarm(preq); + if (bucket) +@@ -990,12 +991,10 @@ int io_poll_remove(struct io_kiocb *req, + goto out; + } + +- io_ring_submit_lock(ctx, issue_flags); + preq = io_poll_find(ctx, true, &cd, &ctx->cancel_table_locked, &bucket); + ret2 = io_poll_disarm(preq); + if (bucket) + spin_unlock(&bucket->lock); +- io_ring_submit_unlock(ctx, issue_flags); + if (ret2) { + ret = ret2; + goto out; +@@ -1019,7 +1018,7 @@ found: + if (poll_update->update_user_data) + preq->cqe.user_data = poll_update->new_user_data; + +- ret2 = io_poll_add(preq, issue_flags); ++ ret2 = io_poll_add(preq, issue_flags & ~IO_URING_F_UNLOCKED); + /* successfully updated, don't complete poll request */ + if (!ret2 || ret2 == -EIOCBQUEUED) + goto out; +@@ -1027,9 +1026,9 @@ found: + + req_set_fail(preq); + io_req_set_res(preq, -ECANCELED, 0); +- locked = !(issue_flags & IO_URING_F_UNLOCKED); + io_req_task_complete(preq, &locked); + out: ++ io_ring_submit_unlock(ctx, issue_flags); + if (ret < 0) { + req_set_fail(req); + return ret; diff --git a/queue-6.3/series b/queue-6.3/series index 6bd52126487..4d72f0db121 100644 --- a/queue-6.3/series +++ b/queue-6.3/series @@ -92,3 +92,6 @@ ksmbd-remove-internal.h-include.patch fs-introduce-lock_rename_child-helper.patch ksmbd-fix-racy-issue-from-using-d_parent-and-d_name.patch ksmbd-add-mnt_want_write-to-ksmbd-vfs-functions.patch +arm64-dts-rockchip-fix-rk356x-pcie-register-and-range-mappings.patch +block-make-sure-local-irq-is-disabled-when-calling-__blkcg_rstat_flush.patch +io_uring-poll-serialize-poll-linked-timer-start-with-poll-removal.patch