From: Greg Kroah-Hartman Date: Sun, 9 Jun 2024 11:30:28 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v6.1.93~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5272cd27812c8156be64b757b207f4f82cbbc71e;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: drm-msm-dpu-make-error-messages-at-dpu_core_irq_register_callback-more-sensible.patch f2fs-use-f2fs_-err-info-_ratelimited-for-cleanup.patch f2fs-write-missing-last-sum-blk-of-file-pinning-section.patch media-vsp1-remove-unbalanced-.s_stream-0-calls.patch nouveau-report-byte-usage-in-vram-usage.patch perf-sched-timehist-fix-g-call-graph-option-failure.patch rdma-bnxt_re-fix-the-sparse-warnings.patch riscv-fix-enabling-cbo.zero-when-running-in-m-mode.patch riscv-save-restore-envcfg-csr-during-cpu-suspend.patch --- diff --git a/queue-6.6/drm-msm-dpu-make-error-messages-at-dpu_core_irq_register_callback-more-sensible.patch b/queue-6.6/drm-msm-dpu-make-error-messages-at-dpu_core_irq_register_callback-more-sensible.patch new file mode 100644 index 00000000000..bfc3529db6a --- /dev/null +++ b/queue-6.6/drm-msm-dpu-make-error-messages-at-dpu_core_irq_register_callback-more-sensible.patch @@ -0,0 +1,47 @@ +From 8844f467d6a58dc915f241e81c46e0c126f8c070 Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov +Date: Sat, 30 Mar 2024 05:53:22 +0200 +Subject: drm/msm/dpu: make error messages at dpu_core_irq_register_callback() more sensible + +From: Dmitry Baryshkov + +commit 8844f467d6a58dc915f241e81c46e0c126f8c070 upstream. + +There is little point in using %ps to print a value known to be NULL. On +the other hand it makes sense to print the callback symbol in the +'invalid IRQ' message. Correct those two error messages to make more +sense. + +Fixes: 6893199183f8 ("drm/msm/dpu: stop using raw IRQ indices in the kernel output") +Signed-off-by: Dmitry Baryshkov +Reviewed-by: Marijn Suijten +Reviewed-by: Abhinav Kumar +Patchwork: https://patchwork.freedesktop.org/patch/585565/ +Link: https://lore.kernel.org/r/20240330-dpu-irq-messages-v1-1-9ce782ae35f9@linaro.org +Signed-off-by: Abhinav Kumar +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c ++++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c +@@ -525,14 +525,14 @@ int dpu_core_irq_register_callback(struc + int ret; + + if (!irq_cb) { +- DPU_ERROR("invalid IRQ=[%d, %d] irq_cb:%ps\n", +- DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx), irq_cb); ++ DPU_ERROR("IRQ=[%d, %d] NULL callback\n", ++ DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx)); + return -EINVAL; + } + + if (!dpu_core_irq_is_valid(irq_idx)) { +- DPU_ERROR("invalid IRQ=[%d, %d]\n", +- DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx)); ++ DPU_ERROR("invalid IRQ=[%d, %d] irq_cb:%ps\n", ++ DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx), irq_cb); + return -EINVAL; + } + diff --git a/queue-6.6/f2fs-use-f2fs_-err-info-_ratelimited-for-cleanup.patch b/queue-6.6/f2fs-use-f2fs_-err-info-_ratelimited-for-cleanup.patch new file mode 100644 index 00000000000..5cdce6002da --- /dev/null +++ b/queue-6.6/f2fs-use-f2fs_-err-info-_ratelimited-for-cleanup.patch @@ -0,0 +1,158 @@ +From a78118406d52dde495311c0c4917613868b53169 Mon Sep 17 00:00:00 2001 +From: Chao Yu +Date: Mon, 6 May 2024 18:47:42 +0800 +Subject: f2fs: use f2fs_{err,info}_ratelimited() for cleanup + +From: Chao Yu + +commit a78118406d52dde495311c0c4917613868b53169 upstream. + +Commit b1c9d3f833ba ("f2fs: support printk_ratelimited() in f2fs_printk()") +missed some cases, cover all remains for cleanup. + +Signed-off-by: Chao Yu +Signed-off-by: Jaegeuk Kim +Signed-off-by: Greg Kroah-Hartman +--- + fs/f2fs/compress.c | 54 +++++++++++++++++++++++------------------------------ + fs/f2fs/segment.c | 5 +--- + 2 files changed, 26 insertions(+), 33 deletions(-) + +--- a/fs/f2fs/compress.c ++++ b/fs/f2fs/compress.c +@@ -198,8 +198,8 @@ static int lzo_compress_pages(struct com + ret = lzo1x_1_compress(cc->rbuf, cc->rlen, cc->cbuf->cdata, + &cc->clen, cc->private); + if (ret != LZO_E_OK) { +- printk_ratelimited("%sF2FS-fs (%s): lzo compress failed, ret:%d\n", +- KERN_ERR, F2FS_I_SB(cc->inode)->sb->s_id, ret); ++ f2fs_err_ratelimited(F2FS_I_SB(cc->inode), ++ "lzo compress failed, ret:%d", ret); + return -EIO; + } + return 0; +@@ -212,17 +212,15 @@ static int lzo_decompress_pages(struct d + ret = lzo1x_decompress_safe(dic->cbuf->cdata, dic->clen, + dic->rbuf, &dic->rlen); + if (ret != LZO_E_OK) { +- printk_ratelimited("%sF2FS-fs (%s): lzo decompress failed, ret:%d\n", +- KERN_ERR, F2FS_I_SB(dic->inode)->sb->s_id, ret); ++ f2fs_err_ratelimited(F2FS_I_SB(dic->inode), ++ "lzo decompress failed, ret:%d", ret); + return -EIO; + } + + if (dic->rlen != PAGE_SIZE << dic->log_cluster_size) { +- printk_ratelimited("%sF2FS-fs (%s): lzo invalid rlen:%zu, " +- "expected:%lu\n", KERN_ERR, +- F2FS_I_SB(dic->inode)->sb->s_id, +- dic->rlen, +- PAGE_SIZE << dic->log_cluster_size); ++ f2fs_err_ratelimited(F2FS_I_SB(dic->inode), ++ "lzo invalid rlen:%zu, expected:%lu", ++ dic->rlen, PAGE_SIZE << dic->log_cluster_size); + return -EIO; + } + return 0; +@@ -294,16 +292,15 @@ static int lz4_decompress_pages(struct d + ret = LZ4_decompress_safe(dic->cbuf->cdata, dic->rbuf, + dic->clen, dic->rlen); + if (ret < 0) { +- printk_ratelimited("%sF2FS-fs (%s): lz4 decompress failed, ret:%d\n", +- KERN_ERR, F2FS_I_SB(dic->inode)->sb->s_id, ret); ++ f2fs_err_ratelimited(F2FS_I_SB(dic->inode), ++ "lz4 decompress failed, ret:%d", ret); + return -EIO; + } + + if (ret != PAGE_SIZE << dic->log_cluster_size) { +- printk_ratelimited("%sF2FS-fs (%s): lz4 invalid ret:%d, " +- "expected:%lu\n", KERN_ERR, +- F2FS_I_SB(dic->inode)->sb->s_id, ret, +- PAGE_SIZE << dic->log_cluster_size); ++ f2fs_err_ratelimited(F2FS_I_SB(dic->inode), ++ "lz4 invalid ret:%d, expected:%lu", ++ ret, PAGE_SIZE << dic->log_cluster_size); + return -EIO; + } + return 0; +@@ -350,9 +347,8 @@ static int zstd_init_compress_ctx(struct + + stream = zstd_init_cstream(¶ms, 0, workspace, workspace_size); + if (!stream) { +- printk_ratelimited("%sF2FS-fs (%s): %s zstd_init_cstream failed\n", +- KERN_ERR, F2FS_I_SB(cc->inode)->sb->s_id, +- __func__); ++ f2fs_err_ratelimited(F2FS_I_SB(cc->inode), ++ "%s zstd_init_cstream failed", __func__); + kvfree(workspace); + return -EIO; + } +@@ -390,16 +386,16 @@ static int zstd_compress_pages(struct co + + ret = zstd_compress_stream(stream, &outbuf, &inbuf); + if (zstd_is_error(ret)) { +- printk_ratelimited("%sF2FS-fs (%s): %s zstd_compress_stream failed, ret: %d\n", +- KERN_ERR, F2FS_I_SB(cc->inode)->sb->s_id, ++ f2fs_err_ratelimited(F2FS_I_SB(cc->inode), ++ "%s zstd_compress_stream failed, ret: %d", + __func__, zstd_get_error_code(ret)); + return -EIO; + } + + ret = zstd_end_stream(stream, &outbuf); + if (zstd_is_error(ret)) { +- printk_ratelimited("%sF2FS-fs (%s): %s zstd_end_stream returned %d\n", +- KERN_ERR, F2FS_I_SB(cc->inode)->sb->s_id, ++ f2fs_err_ratelimited(F2FS_I_SB(cc->inode), ++ "%s zstd_end_stream returned %d", + __func__, zstd_get_error_code(ret)); + return -EIO; + } +@@ -432,9 +428,8 @@ static int zstd_init_decompress_ctx(stru + + stream = zstd_init_dstream(max_window_size, workspace, workspace_size); + if (!stream) { +- printk_ratelimited("%sF2FS-fs (%s): %s zstd_init_dstream failed\n", +- KERN_ERR, F2FS_I_SB(dic->inode)->sb->s_id, +- __func__); ++ f2fs_err_ratelimited(F2FS_I_SB(dic->inode), ++ "%s zstd_init_dstream failed", __func__); + kvfree(workspace); + return -EIO; + } +@@ -469,16 +464,15 @@ static int zstd_decompress_pages(struct + + ret = zstd_decompress_stream(stream, &outbuf, &inbuf); + if (zstd_is_error(ret)) { +- printk_ratelimited("%sF2FS-fs (%s): %s zstd_decompress_stream failed, ret: %d\n", +- KERN_ERR, F2FS_I_SB(dic->inode)->sb->s_id, ++ f2fs_err_ratelimited(F2FS_I_SB(dic->inode), ++ "%s zstd_decompress_stream failed, ret: %d", + __func__, zstd_get_error_code(ret)); + return -EIO; + } + + if (dic->rlen != outbuf.pos) { +- printk_ratelimited("%sF2FS-fs (%s): %s ZSTD invalid rlen:%zu, " +- "expected:%lu\n", KERN_ERR, +- F2FS_I_SB(dic->inode)->sb->s_id, ++ f2fs_err_ratelimited(F2FS_I_SB(dic->inode), ++ "%s ZSTD invalid rlen:%zu, expected:%lu", + __func__, dic->rlen, + PAGE_SIZE << dic->log_cluster_size); + return -EIO; +--- a/fs/f2fs/segment.c ++++ b/fs/f2fs/segment.c +@@ -1103,9 +1103,8 @@ static void __remove_discard_cmd(struct + dc->error = 0; + + if (dc->error) +- printk_ratelimited( +- "%sF2FS-fs (%s): Issue discard(%u, %u, %u) failed, ret: %d", +- KERN_INFO, sbi->sb->s_id, ++ f2fs_info_ratelimited(sbi, ++ "Issue discard(%u, %u, %u) failed, ret: %d", + dc->di.lstart, dc->di.start, dc->di.len, dc->error); + __detach_discard_cmd(dcc, dc); + } diff --git a/queue-6.6/f2fs-write-missing-last-sum-blk-of-file-pinning-section.patch b/queue-6.6/f2fs-write-missing-last-sum-blk-of-file-pinning-section.patch new file mode 100644 index 00000000000..ad434ab2ed9 --- /dev/null +++ b/queue-6.6/f2fs-write-missing-last-sum-blk-of-file-pinning-section.patch @@ -0,0 +1,37 @@ +From b084403cfc3295b59a1b6bcc94efaf870fc3c2c9 Mon Sep 17 00:00:00 2001 +From: Daeho Jeong +Date: Tue, 9 Apr 2024 16:34:11 -0700 +Subject: f2fs: write missing last sum blk of file pinning section + +From: Daeho Jeong + +commit b084403cfc3295b59a1b6bcc94efaf870fc3c2c9 upstream. + +While do not allocating a new section in advance for file pinning area, I +missed that we should write the sum block for the last segment of a file +pinning section. + +Fixes: 9703d69d9d15 ("f2fs: support file pinning for zoned devices") +Signed-off-by: Daeho Jeong +Reviewed-by: Chao Yu +Signed-off-by: Jaegeuk Kim +Signed-off-by: Greg Kroah-Hartman +--- + fs/f2fs/segment.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/fs/f2fs/segment.c ++++ b/fs/f2fs/segment.c +@@ -3479,8 +3479,11 @@ void f2fs_allocate_data_block(struct f2f + */ + if (segment_full) { + if (type == CURSEG_COLD_DATA_PINNED && +- !((curseg->segno + 1) % sbi->segs_per_sec)) ++ !((curseg->segno + 1) % sbi->segs_per_sec)) { ++ write_sum_page(sbi, curseg->sum_blk, ++ GET_SUM_BLOCK(sbi, curseg->segno)); + goto skip_new_segment; ++ } + + if (from_gc) { + get_atssr_segment(sbi, type, se->type, diff --git a/queue-6.6/media-vsp1-remove-unbalanced-.s_stream-0-calls.patch b/queue-6.6/media-vsp1-remove-unbalanced-.s_stream-0-calls.patch new file mode 100644 index 00000000000..ebd774c0e86 --- /dev/null +++ b/queue-6.6/media-vsp1-remove-unbalanced-.s_stream-0-calls.patch @@ -0,0 +1,175 @@ +From 42d62b7e47d58273c64fc1540e5d81ccfdb60f77 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Tue, 24 Oct 2023 17:18:17 +0300 +Subject: media: vsp1: Remove unbalanced .s_stream(0) calls + +From: Laurent Pinchart + +commit 42d62b7e47d58273c64fc1540e5d81ccfdb60f77 upstream. + +The VSP1 driver uses the subdev .s_stream() operation to stop WPF +instances, without a corresponding call to start them. The V4L2 subdev +core started warning about unbalanced .s_stream() calls in commit +009905ec5043 ("media: v4l2-subdev: Document and enforce .s_stream() +requirements"), causing a regression with this driver. + +Fix the problem by replacing the .s_stream() operation with an explicit +function call for WPF instances. This allows sharing an additional data +structure between RPF and WPF instances. + +Fixes: 009905ec5043 ("media: v4l2-subdev: Document and enforce .s_stream() requirements") +Reported-by: Geert Uytterhoeven +Closes: https://lore.kernel.org/linux-media/2221395-6a9b-9527-d697-e76aebc6af@linux-m68k.org/ +Signed-off-by: Laurent Pinchart +Tested-by: Geert Uytterhoeven +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/renesas/vsp1/vsp1_pipe.c | 2 - + drivers/media/platform/renesas/vsp1/vsp1_rpf.c | 10 -------- + drivers/media/platform/renesas/vsp1/vsp1_rwpf.c | 8 ++++-- + drivers/media/platform/renesas/vsp1/vsp1_rwpf.h | 4 ++- + drivers/media/platform/renesas/vsp1/vsp1_wpf.c | 29 ++---------------------- + 5 files changed, 14 insertions(+), 39 deletions(-) + +--- a/drivers/media/platform/renesas/vsp1/vsp1_pipe.c ++++ b/drivers/media/platform/renesas/vsp1/vsp1_pipe.c +@@ -373,7 +373,7 @@ int vsp1_pipeline_stop(struct vsp1_pipel + (7 << VI6_DPR_SMPPT_TGW_SHIFT) | + (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT)); + +- v4l2_subdev_call(&pipe->output->entity.subdev, video, s_stream, 0); ++ vsp1_wpf_stop(pipe->output); + + return ret; + } +--- a/drivers/media/platform/renesas/vsp1/vsp1_rpf.c ++++ b/drivers/media/platform/renesas/vsp1/vsp1_rpf.c +@@ -44,14 +44,6 @@ static inline void vsp1_rpf_write(struct + } + + /* ----------------------------------------------------------------------------- +- * V4L2 Subdevice Operations +- */ +- +-static const struct v4l2_subdev_ops rpf_ops = { +- .pad = &vsp1_rwpf_pad_ops, +-}; +- +-/* ----------------------------------------------------------------------------- + * VSP1 Entity Operations + */ + +@@ -411,7 +403,7 @@ struct vsp1_rwpf *vsp1_rpf_create(struct + rpf->entity.index = index; + + sprintf(name, "rpf.%u", index); +- ret = vsp1_entity_init(vsp1, &rpf->entity, name, 2, &rpf_ops, ++ ret = vsp1_entity_init(vsp1, &rpf->entity, name, 2, &vsp1_rwpf_subdev_ops, + MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER); + if (ret < 0) + return ERR_PTR(ret); +--- a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c ++++ b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c +@@ -24,7 +24,7 @@ struct v4l2_rect *vsp1_rwpf_get_crop(str + } + + /* ----------------------------------------------------------------------------- +- * V4L2 Subdevice Pad Operations ++ * V4L2 Subdevice Operations + */ + + static int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev, +@@ -243,7 +243,7 @@ done: + return ret; + } + +-const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = { ++static const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = { + .init_cfg = vsp1_entity_init_cfg, + .enum_mbus_code = vsp1_rwpf_enum_mbus_code, + .enum_frame_size = vsp1_rwpf_enum_frame_size, +@@ -253,6 +253,10 @@ const struct v4l2_subdev_pad_ops vsp1_rw + .set_selection = vsp1_rwpf_set_selection, + }; + ++const struct v4l2_subdev_ops vsp1_rwpf_subdev_ops = { ++ .pad = &vsp1_rwpf_pad_ops, ++}; ++ + /* ----------------------------------------------------------------------------- + * Controls + */ +--- a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.h ++++ b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.h +@@ -79,9 +79,11 @@ static inline struct vsp1_rwpf *entity_t + struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index); + struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index); + ++void vsp1_wpf_stop(struct vsp1_rwpf *wpf); ++ + int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf, unsigned int ncontrols); + +-extern const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops; ++extern const struct v4l2_subdev_ops vsp1_rwpf_subdev_ops; + + struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf, + struct v4l2_subdev_state *sd_state); +--- a/drivers/media/platform/renesas/vsp1/vsp1_wpf.c ++++ b/drivers/media/platform/renesas/vsp1/vsp1_wpf.c +@@ -186,17 +186,13 @@ static int wpf_init_controls(struct vsp1 + } + + /* ----------------------------------------------------------------------------- +- * V4L2 Subdevice Core Operations ++ * VSP1 Entity Operations + */ + +-static int wpf_s_stream(struct v4l2_subdev *subdev, int enable) ++void vsp1_wpf_stop(struct vsp1_rwpf *wpf) + { +- struct vsp1_rwpf *wpf = to_rwpf(subdev); + struct vsp1_device *vsp1 = wpf->entity.vsp1; + +- if (enable) +- return 0; +- + /* + * Write to registers directly when stopping the stream as there will be + * no pipeline run to apply the display list. +@@ -204,27 +200,8 @@ static int wpf_s_stream(struct v4l2_subd + vsp1_write(vsp1, VI6_WPF_IRQ_ENB(wpf->entity.index), 0); + vsp1_write(vsp1, wpf->entity.index * VI6_WPF_OFFSET + + VI6_WPF_SRCRPF, 0); +- +- return 0; + } + +-/* ----------------------------------------------------------------------------- +- * V4L2 Subdevice Operations +- */ +- +-static const struct v4l2_subdev_video_ops wpf_video_ops = { +- .s_stream = wpf_s_stream, +-}; +- +-static const struct v4l2_subdev_ops wpf_ops = { +- .video = &wpf_video_ops, +- .pad = &vsp1_rwpf_pad_ops, +-}; +- +-/* ----------------------------------------------------------------------------- +- * VSP1 Entity Operations +- */ +- + static void vsp1_wpf_destroy(struct vsp1_entity *entity) + { + struct vsp1_rwpf *wpf = entity_to_rwpf(entity); +@@ -583,7 +560,7 @@ struct vsp1_rwpf *vsp1_wpf_create(struct + wpf->entity.index = index; + + sprintf(name, "wpf.%u", index); +- ret = vsp1_entity_init(vsp1, &wpf->entity, name, 2, &wpf_ops, ++ ret = vsp1_entity_init(vsp1, &wpf->entity, name, 2, &vsp1_rwpf_subdev_ops, + MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER); + if (ret < 0) + return ERR_PTR(ret); diff --git a/queue-6.6/nouveau-report-byte-usage-in-vram-usage.patch b/queue-6.6/nouveau-report-byte-usage-in-vram-usage.patch new file mode 100644 index 00000000000..be633cb0717 --- /dev/null +++ b/queue-6.6/nouveau-report-byte-usage-in-vram-usage.patch @@ -0,0 +1,29 @@ +From f7916c47f66d778817068d86e5c9b5e511e23c86 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Mon, 26 Feb 2024 17:16:10 +1000 +Subject: nouveau: report byte usage in VRAM usage. + +From: Dave Airlie + +commit f7916c47f66d778817068d86e5c9b5e511e23c86 upstream. + +Turns out usage is always in bytes not shifted. + +Fixes: 72fa02fdf833 ("nouveau: add an ioctl to report vram usage") +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/nouveau/nouveau_abi16.c ++++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c +@@ -274,7 +274,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL + break; + case NOUVEAU_GETPARAM_VRAM_USED: { + struct ttm_resource_manager *vram_mgr = ttm_manager_type(&drm->ttm.bdev, TTM_PL_VRAM); +- getparam->value = (u64)ttm_resource_manager_usage(vram_mgr) << PAGE_SHIFT; ++ getparam->value = (u64)ttm_resource_manager_usage(vram_mgr); + break; + } + case NOUVEAU_GETPARAM_HAS_VMA_TILEMODE: diff --git a/queue-6.6/perf-sched-timehist-fix-g-call-graph-option-failure.patch b/queue-6.6/perf-sched-timehist-fix-g-call-graph-option-failure.patch new file mode 100644 index 00000000000..0920e0a8018 --- /dev/null +++ b/queue-6.6/perf-sched-timehist-fix-g-call-graph-option-failure.patch @@ -0,0 +1,84 @@ +From 6e4b398770d5023eb6383da9360a23bd537c155b Mon Sep 17 00:00:00 2001 +From: Yang Jihong +Date: Mon, 1 Apr 2024 14:27:23 +0800 +Subject: perf sched timehist: Fix -g/--call-graph option failure + +From: Yang Jihong + +commit 6e4b398770d5023eb6383da9360a23bd537c155b upstream. + +When 'perf sched' enables the call-graph recording, sample_type of dummy +event does not have PERF_SAMPLE_CALLCHAIN, timehist_check_attr() checks +that the evsel does not have a callchain, and set show_callchain to 0. + +Currently 'perf sched timehist' only saves callchain when processing the +'sched:sched_switch event', timehist_check_attr() only needs to determine +whether the event has PERF_SAMPLE_CALLCHAIN. + +Before: + + # perf sched record -g true + [ perf record: Woken up 0 times to write data ] + [ perf record: Captured and wrote 4.153 MB perf.data (7536 samples) ] + # perf sched timehist + Samples do not have callchains. + time cpu task name wait time sch delay run time + [tid/pid] (msec) (msec) (msec) + --------------- ------ ------------------------------ --------- --------- --------- + 147851.826019 [0000] perf[285035] 0.000 0.000 0.000 + 147851.826029 [0000] migration/0[15] 0.000 0.003 0.009 + 147851.826063 [0001] perf[285035] 0.000 0.000 0.000 + 147851.826069 [0001] migration/1[21] 0.000 0.003 0.006 + + +After: + + # perf sched record -g true + [ perf record: Woken up 1 times to write data ] + [ perf record: Captured and wrote 2.572 MB perf.data (822 samples) ] + # perf sched timehist + time cpu task name waittime sch delay runtime + [tid/pid] (msec) (msec) (msec) + ----------- --- --------------- -------- -------- ----- + 4193.035164 [0] perf[277062] 0.000 0.000 0.000 __traceiter_sched_switch <- __traceiter_sched_switch <- __sched_text_start <- preempt_schedule_common <- __cond_resched <- __wait_for_common <- wait_for_completion + 4193.035174 [0] migration/0[15] 0.000 0.003 0.009 __traceiter_sched_switch <- __traceiter_sched_switch <- __sched_text_start <- smpboot_thread_fn <- kthread <- ret_from_fork + 4193.035207 [1] perf[277062] 0.000 0.000 0.000 __traceiter_sched_switch <- __traceiter_sched_switch <- __sched_text_start <- preempt_schedule_common <- __cond_resched <- __wait_for_common <- wait_for_completion + 4193.035214 [1] migration/1[21] 0.000 0.003 0.007 __traceiter_sched_switch <- __traceiter_sched_switch <- __sched_text_start <- smpboot_thread_fn <- kthread <- ret_from_fork + + +Fixes: 9c95e4ef06572349 ("perf evlist: Add evlist__findnew_tracking_event() helper") +Reviewed-by: Ian Rogers +Signed-off-by: Yang Jihong +Cc: Adrian Hunter +Cc: Alexander Shishkin +Cc: Ingo Molnar +Cc: James Clark +Cc: Jiri Olsa +Cc: Kan Liang +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Yang Jihong +Link: https://lore.kernel.org/r/20240401062724.1006010-2-yangjihong@bytedance.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/builtin-sched.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/tools/perf/builtin-sched.c ++++ b/tools/perf/builtin-sched.c +@@ -3000,8 +3000,11 @@ static int timehist_check_attr(struct pe + return -1; + } + +- if (sched->show_callchain && !evsel__has_callchain(evsel)) { +- pr_info("Samples do not have callchains.\n"); ++ /* only need to save callchain related to sched_switch event */ ++ if (sched->show_callchain && ++ evsel__name_is(evsel, "sched:sched_switch") && ++ !evsel__has_callchain(evsel)) { ++ pr_info("Samples of sched_switch event do not have callchains.\n"); + sched->show_callchain = 0; + symbol_conf.use_callchain = 0; + } diff --git a/queue-6.6/rdma-bnxt_re-fix-the-sparse-warnings.patch b/queue-6.6/rdma-bnxt_re-fix-the-sparse-warnings.patch new file mode 100644 index 00000000000..786e1fe2e1d --- /dev/null +++ b/queue-6.6/rdma-bnxt_re-fix-the-sparse-warnings.patch @@ -0,0 +1,53 @@ +From 82a8903a9f9f3ff31027b9a0b92f7505f981f09c Mon Sep 17 00:00:00 2001 +From: Selvin Xavier +Date: Tue, 19 Dec 2023 20:31:57 -0800 +Subject: RDMA/bnxt_re: Fix the sparse warnings + +From: Selvin Xavier + +commit 82a8903a9f9f3ff31027b9a0b92f7505f981f09c upstream. + +Fix the following warnings reported + +drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:909:27: warning: invalid assignment: |= +drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:909:27: left side has type restricted __le16 +drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:909:27: right side has type unsigned long +... +drivers/infiniband/hw/bnxt_re/qplib_fp.c:1620:44: warning: invalid assignment: |= +drivers/infiniband/hw/bnxt_re/qplib_fp.c:1620:44: left side has type restricted __le64 +drivers/infiniband/hw/bnxt_re/qplib_fp.c:1620:44: right side has type unsigned long long + +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202312200537.HoNqPL5L-lkp@intel.com/ +Fixes: 07f830ae4913 ("RDMA/bnxt_re: Adds MSN table capability for Gen P7 adapters") +Signed-off-by: Selvin Xavier +Link: https://lore.kernel.org/r/1703046717-8914-1-git-send-email-selvin.xavier@broadcom.com +Signed-off-by: Leon Romanovsky +Signed-off-by: Greg Kroah-Hartman +--- + drivers/infiniband/hw/bnxt_re/qplib_fp.h | 2 +- + drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.h ++++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.h +@@ -631,7 +631,7 @@ static inline u16 bnxt_qplib_calc_ilsize + } + + /* MSN table update inlin */ +-static inline uint64_t bnxt_re_update_msn_tbl(u32 st_idx, u32 npsn, u32 start_psn) ++static inline __le64 bnxt_re_update_msn_tbl(u32 st_idx, u32 npsn, u32 start_psn) + { + return cpu_to_le64((((u64)(st_idx) << SQ_MSN_SEARCH_START_IDX_SFT) & + SQ_MSN_SEARCH_START_IDX_MASK) | +--- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c ++++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +@@ -906,7 +906,7 @@ config_vf_res: + + skip_ctx_setup: + if (BNXT_RE_HW_RETX(rcfw->res->dattr->dev_cap_flags)) +- req.flags |= CMDQ_INITIALIZE_FW_FLAGS_HW_REQUESTER_RETX_SUPPORTED; ++ req.flags |= cpu_to_le16(CMDQ_INITIALIZE_FW_FLAGS_HW_REQUESTER_RETX_SUPPORTED); + req.stat_ctx_id = cpu_to_le32(ctx->stats.fw_id); + bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), sizeof(resp), 0); + rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); diff --git a/queue-6.6/riscv-fix-enabling-cbo.zero-when-running-in-m-mode.patch b/queue-6.6/riscv-fix-enabling-cbo.zero-when-running-in-m-mode.patch new file mode 100644 index 00000000000..bc77f8f376c --- /dev/null +++ b/queue-6.6/riscv-fix-enabling-cbo.zero-when-running-in-m-mode.patch @@ -0,0 +1,54 @@ +From 3fb3f7164edc467450e650dca51dbe4823315a56 Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Tue, 27 Feb 2024 22:55:33 -0800 +Subject: riscv: Fix enabling cbo.zero when running in M-mode + +From: Samuel Holland + +commit 3fb3f7164edc467450e650dca51dbe4823315a56 upstream. + +When the kernel is running in M-mode, the CBZE bit must be set in the +menvcfg CSR, not in senvcfg. + +Cc: +Fixes: 43c16d51a19b ("RISC-V: Enable cbo.zero in usermode") +Reviewed-by: Andrew Jones +Signed-off-by: Samuel Holland +Reviewed-by: Conor Dooley +Link: https://lore.kernel.org/r/20240228065559.3434837-2-samuel.holland@sifive.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/include/asm/csr.h | 2 ++ + arch/riscv/kernel/cpufeature.c | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/arch/riscv/include/asm/csr.h ++++ b/arch/riscv/include/asm/csr.h +@@ -398,6 +398,7 @@ + # define CSR_STATUS CSR_MSTATUS + # define CSR_IE CSR_MIE + # define CSR_TVEC CSR_MTVEC ++# define CSR_ENVCFG CSR_MENVCFG + # define CSR_SCRATCH CSR_MSCRATCH + # define CSR_EPC CSR_MEPC + # define CSR_CAUSE CSR_MCAUSE +@@ -422,6 +423,7 @@ + # define CSR_STATUS CSR_SSTATUS + # define CSR_IE CSR_SIE + # define CSR_TVEC CSR_STVEC ++# define CSR_ENVCFG CSR_SENVCFG + # define CSR_SCRATCH CSR_SSCRATCH + # define CSR_EPC CSR_SEPC + # define CSR_CAUSE CSR_SCAUSE +--- a/arch/riscv/kernel/cpufeature.c ++++ b/arch/riscv/kernel/cpufeature.c +@@ -679,7 +679,7 @@ arch_initcall(check_unaligned_access_boo + void riscv_user_isa_enable(void) + { + if (riscv_cpu_has_extension_unlikely(smp_processor_id(), RISCV_ISA_EXT_ZICBOZ)) +- csr_set(CSR_SENVCFG, ENVCFG_CBZE); ++ csr_set(CSR_ENVCFG, ENVCFG_CBZE); + } + + #ifdef CONFIG_RISCV_ALTERNATIVE diff --git a/queue-6.6/riscv-save-restore-envcfg-csr-during-cpu-suspend.patch b/queue-6.6/riscv-save-restore-envcfg-csr-during-cpu-suspend.patch new file mode 100644 index 00000000000..ff362163615 --- /dev/null +++ b/queue-6.6/riscv-save-restore-envcfg-csr-during-cpu-suspend.patch @@ -0,0 +1,55 @@ +From 05ab803d1ad8ac505ade77c6bd3f86b1b4ea0dc4 Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Tue, 27 Feb 2024 22:55:35 -0800 +Subject: riscv: Save/restore envcfg CSR during CPU suspend + +From: Samuel Holland + +commit 05ab803d1ad8ac505ade77c6bd3f86b1b4ea0dc4 upstream. + +The value of the [ms]envcfg CSR is lost when entering a nonretentive +idle state, so the CSR must be rewritten when resuming the CPU. + +Cc: # v6.7+ +Fixes: 43c16d51a19b ("RISC-V: Enable cbo.zero in usermode") +Signed-off-by: Samuel Holland +Reviewed-by: Conor Dooley +Reviewed-by: Andrew Jones +Link: https://lore.kernel.org/r/20240228065559.3434837-4-samuel.holland@sifive.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/include/asm/suspend.h | 1 + + arch/riscv/kernel/suspend.c | 4 ++++ + 2 files changed, 5 insertions(+) + +--- a/arch/riscv/include/asm/suspend.h ++++ b/arch/riscv/include/asm/suspend.h +@@ -14,6 +14,7 @@ struct suspend_context { + struct pt_regs regs; + /* Saved and restored by high-level functions */ + unsigned long scratch; ++ unsigned long envcfg; + unsigned long tvec; + unsigned long ie; + #ifdef CONFIG_MMU +--- a/arch/riscv/kernel/suspend.c ++++ b/arch/riscv/kernel/suspend.c +@@ -11,6 +11,8 @@ + void suspend_save_csrs(struct suspend_context *context) + { + context->scratch = csr_read(CSR_SCRATCH); ++ if (riscv_cpu_has_extension_unlikely(smp_processor_id(), RISCV_ISA_EXT_XLINUXENVCFG)) ++ context->envcfg = csr_read(CSR_ENVCFG); + context->tvec = csr_read(CSR_TVEC); + context->ie = csr_read(CSR_IE); + +@@ -32,6 +34,8 @@ void suspend_save_csrs(struct suspend_co + void suspend_restore_csrs(struct suspend_context *context) + { + csr_write(CSR_SCRATCH, context->scratch); ++ if (riscv_cpu_has_extension_unlikely(smp_processor_id(), RISCV_ISA_EXT_XLINUXENVCFG)) ++ csr_write(CSR_ENVCFG, context->envcfg); + csr_write(CSR_TVEC, context->tvec); + csr_write(CSR_IE, context->ie); + diff --git a/queue-6.6/series b/queue-6.6/series index a2ae4554647..0ad5147ca29 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -730,3 +730,12 @@ platform-x86-intel-tpmi-handle-error-from-tpmi_process_info.patch platform-x86-intel-uncore-freq-don-t-present-root-domain-on-error.patch perf-util-add-a-function-for-replacing-characters-in-a-string.patch perf-evlist-add-perf_evlist__go_system_wide-helper.patch +rdma-bnxt_re-fix-the-sparse-warnings.patch +nouveau-report-byte-usage-in-vram-usage.patch +media-vsp1-remove-unbalanced-.s_stream-0-calls.patch +riscv-fix-enabling-cbo.zero-when-running-in-m-mode.patch +riscv-save-restore-envcfg-csr-during-cpu-suspend.patch +drm-msm-dpu-make-error-messages-at-dpu_core_irq_register_callback-more-sensible.patch +perf-sched-timehist-fix-g-call-graph-option-failure.patch +f2fs-write-missing-last-sum-blk-of-file-pinning-section.patch +f2fs-use-f2fs_-err-info-_ratelimited-for-cleanup.patch