--- /dev/null
+From 46930b7cc7727271c9c27aac1fdc97a8645e2d00 Mon Sep 17 00:00:00 2001
+From: Anuj Gupta <anuj20.g@samsung.com>
+Date: Tue, 23 May 2023 16:47:09 +0530
+Subject: block: fix bio-cache for passthru IO
+
+From: Anuj Gupta <anuj20.g@samsung.com>
+
+commit 46930b7cc7727271c9c27aac1fdc97a8645e2d00 upstream.
+
+commit <8af870aa5b847> ("block: enable bio caching use for passthru IO")
+introduced bio-cache for passthru IO. In case when nr_vecs are greater
+than BIO_INLINE_VECS, bio and bvecs are allocated from mempool (instead
+of percpu cache) and REQ_ALLOC_CACHE is cleared. This causes the side
+effect of not freeing bio/bvecs into mempool on completion.
+
+This patch lets the passthru IO fallback to allocation using bio_kmalloc
+when nr_vecs are greater than BIO_INLINE_VECS. The corresponding bio
+is freed during call to blk_mq_map_bio_put during completion.
+
+Cc: stable@vger.kernel.org # 6.1
+fixes <8af870aa5b847> ("block: enable bio caching use for passthru IO")
+
+Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
+Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
+Link: https://lore.kernel.org/r/20230523111709.145676-1-anuj20.g@samsung.com
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-map.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/block/blk-map.c
++++ b/block/blk-map.c
+@@ -247,7 +247,7 @@ static struct bio *blk_rq_map_bio_alloc(
+ {
+ struct bio *bio;
+
+- if (rq->cmd_flags & REQ_ALLOC_CACHE) {
++ if (rq->cmd_flags & REQ_ALLOC_CACHE && (nr_vecs <= BIO_INLINE_VECS)) {
+ bio = bio_alloc_bioset(NULL, nr_vecs, rq->cmd_flags, gfp_mask,
+ &fs_bio_set);
+ if (!bio)
--- /dev/null
+From 597441b3436a43011f31ce71dc0a6c0bf5ce958a Mon Sep 17 00:00:00 2001
+From: Josef Bacik <josef@toxicpanda.com>
+Date: Thu, 11 May 2023 12:45:59 -0400
+Subject: btrfs: use nofs when cleaning up aborted transactions
+
+From: Josef Bacik <josef@toxicpanda.com>
+
+commit 597441b3436a43011f31ce71dc0a6c0bf5ce958a upstream.
+
+Our CI system caught a lockdep splat:
+
+ ======================================================
+ WARNING: possible circular locking dependency detected
+ 6.3.0-rc7+ #1167 Not tainted
+ ------------------------------------------------------
+ kswapd0/46 is trying to acquire lock:
+ ffff8c6543abd650 (sb_internal#2){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
+
+ but task is already holding lock:
+ ffffffffabe61b40 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x4aa/0x7a0
+
+ which lock already depends on the new lock.
+
+ the existing dependency chain (in reverse order) is:
+
+ -> #1 (fs_reclaim){+.+.}-{0:0}:
+ fs_reclaim_acquire+0xa5/0xe0
+ kmem_cache_alloc+0x31/0x2c0
+ alloc_extent_state+0x1d/0xd0
+ __clear_extent_bit+0x2e0/0x4f0
+ try_release_extent_mapping+0x216/0x280
+ btrfs_release_folio+0x2e/0x90
+ invalidate_inode_pages2_range+0x397/0x470
+ btrfs_cleanup_dirty_bgs+0x9e/0x210
+ btrfs_cleanup_one_transaction+0x22/0x760
+ btrfs_commit_transaction+0x3b7/0x13a0
+ create_subvol+0x59b/0x970
+ btrfs_mksubvol+0x435/0x4f0
+ __btrfs_ioctl_snap_create+0x11e/0x1b0
+ btrfs_ioctl_snap_create_v2+0xbf/0x140
+ btrfs_ioctl+0xa45/0x28f0
+ __x64_sys_ioctl+0x88/0xc0
+ do_syscall_64+0x38/0x90
+ entry_SYSCALL_64_after_hwframe+0x72/0xdc
+
+ -> #0 (sb_internal#2){++++}-{0:0}:
+ __lock_acquire+0x1435/0x21a0
+ lock_acquire+0xc2/0x2b0
+ start_transaction+0x401/0x730
+ btrfs_commit_inode_delayed_inode+0x5f/0x120
+ btrfs_evict_inode+0x292/0x3d0
+ evict+0xcc/0x1d0
+ inode_lru_isolate+0x14d/0x1e0
+ __list_lru_walk_one+0xbe/0x1c0
+ list_lru_walk_one+0x58/0x80
+ prune_icache_sb+0x39/0x60
+ super_cache_scan+0x161/0x1f0
+ do_shrink_slab+0x163/0x340
+ shrink_slab+0x1d3/0x290
+ shrink_node+0x300/0x720
+ balance_pgdat+0x35c/0x7a0
+ kswapd+0x205/0x410
+ kthread+0xf0/0x120
+ ret_from_fork+0x29/0x50
+
+ other info that might help us debug this:
+
+ Possible unsafe locking scenario:
+
+ CPU0 CPU1
+ ---- ----
+ lock(fs_reclaim);
+ lock(sb_internal#2);
+ lock(fs_reclaim);
+ lock(sb_internal#2);
+
+ *** DEADLOCK ***
+
+ 3 locks held by kswapd0/46:
+ #0: ffffffffabe61b40 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x4aa/0x7a0
+ #1: ffffffffabe50270 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x113/0x290
+ #2: ffff8c6543abd0e0 (&type->s_umount_key#44){++++}-{3:3}, at: super_cache_scan+0x38/0x1f0
+
+ stack backtrace:
+ CPU: 0 PID: 46 Comm: kswapd0 Not tainted 6.3.0-rc7+ #1167
+ Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
+ Call Trace:
+ <TASK>
+ dump_stack_lvl+0x58/0x90
+ check_noncircular+0xd6/0x100
+ ? save_trace+0x3f/0x310
+ ? add_lock_to_list+0x97/0x120
+ __lock_acquire+0x1435/0x21a0
+ lock_acquire+0xc2/0x2b0
+ ? btrfs_commit_inode_delayed_inode+0x5f/0x120
+ start_transaction+0x401/0x730
+ ? btrfs_commit_inode_delayed_inode+0x5f/0x120
+ btrfs_commit_inode_delayed_inode+0x5f/0x120
+ btrfs_evict_inode+0x292/0x3d0
+ ? lock_release+0x134/0x270
+ ? __pfx_wake_bit_function+0x10/0x10
+ evict+0xcc/0x1d0
+ inode_lru_isolate+0x14d/0x1e0
+ __list_lru_walk_one+0xbe/0x1c0
+ ? __pfx_inode_lru_isolate+0x10/0x10
+ ? __pfx_inode_lru_isolate+0x10/0x10
+ list_lru_walk_one+0x58/0x80
+ prune_icache_sb+0x39/0x60
+ super_cache_scan+0x161/0x1f0
+ do_shrink_slab+0x163/0x340
+ shrink_slab+0x1d3/0x290
+ shrink_node+0x300/0x720
+ balance_pgdat+0x35c/0x7a0
+ kswapd+0x205/0x410
+ ? __pfx_autoremove_wake_function+0x10/0x10
+ ? __pfx_kswapd+0x10/0x10
+ kthread+0xf0/0x120
+ ? __pfx_kthread+0x10/0x10
+ ret_from_fork+0x29/0x50
+ </TASK>
+
+This happens because when we abort the transaction in the transaction
+commit path we call invalidate_inode_pages2_range on our block group
+cache inodes (if we have space cache v1) and any delalloc inodes we may
+have. The plain invalidate_inode_pages2_range() call passes through
+GFP_KERNEL, which makes sense in most cases, but not here. Wrap these
+two invalidate callees with memalloc_nofs_save/memalloc_nofs_restore to
+make sure we don't end up with the fs reclaim dependency under the
+transaction dependency.
+
+CC: stable@vger.kernel.org # 4.14+
+Signed-off-by: Josef Bacik <josef@toxicpanda.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/btrfs/disk-io.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/fs/btrfs/disk-io.c
++++ b/fs/btrfs/disk-io.c
+@@ -4951,7 +4951,11 @@ static void btrfs_destroy_delalloc_inode
+ */
+ inode = igrab(&btrfs_inode->vfs_inode);
+ if (inode) {
++ unsigned int nofs_flag;
++
++ nofs_flag = memalloc_nofs_save();
+ invalidate_inode_pages2(inode->i_mapping);
++ memalloc_nofs_restore(nofs_flag);
+ iput(inode);
+ }
+ spin_lock(&root->delalloc_lock);
+@@ -5057,7 +5061,12 @@ static void btrfs_cleanup_bg_io(struct b
+
+ inode = cache->io_ctl.inode;
+ if (inode) {
++ unsigned int nofs_flag;
++
++ nofs_flag = memalloc_nofs_save();
+ invalidate_inode_pages2(inode->i_mapping);
++ memalloc_nofs_restore(nofs_flag);
++
+ BTRFS_I(inode)->generation = 0;
+ cache->io_ctl.inode = NULL;
+ iput(inode);
--- /dev/null
+From eb0764b822b9b26880b28ccb9100b2983e01bc17 Mon Sep 17 00:00:00 2001
+From: Dan Williams <dan.j.williams@intel.com>
+Date: Wed, 17 May 2023 20:19:43 -0700
+Subject: cxl/port: Enable the HDM decoder capability for switch ports
+
+From: Dan Williams <dan.j.williams@intel.com>
+
+commit eb0764b822b9b26880b28ccb9100b2983e01bc17 upstream.
+
+Derick noticed, when testing hot plug, that hot-add behaves nominally
+after a removal. However, if the hot-add is done without a prior
+removal, CXL.mem accesses fail. It turns out that the original
+implementation of the port driver and region programming wrongly assumed
+that platform-firmware always enables the host-bridge HDM decoder
+capability. Add support turning on switch-level HDM decoders in the case
+where platform-firmware has not.
+
+The implementation is careful to only arrange for the enable to be
+undone if the current instance of the driver was the one that did the
+enable. This is to interoperate with platform-firmware that may expect
+CXL.mem to remain active after the driver is shutdown. This comes at the
+cost of potentially not shutting down the enable on kexec flows, but it
+is mitigated by the fact that the related HDM decoders still need to be
+enabled on an individual basis.
+
+Cc: <stable@vger.kernel.org>
+Reported-by: Derick Marks <derick.w.marks@intel.com>
+Fixes: 54cdbf845cf7 ("cxl/port: Add a driver for 'struct cxl_port' objects")
+Reviewed-by: Ira Weiny <ira.weiny@intel.com>
+Link: https://lore.kernel.org/r/168437998331.403037.15719879757678389217.stgit@dwillia2-xfh.jf.intel.com
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/cxl/core/pci.c | 27 +++++++++++++++++++++++----
+ drivers/cxl/cxl.h | 1 +
+ drivers/cxl/port.c | 14 +++++++++-----
+ tools/testing/cxl/Kbuild | 1 +
+ tools/testing/cxl/test/mock.c | 15 +++++++++++++++
+ 5 files changed, 49 insertions(+), 9 deletions(-)
+
+--- a/drivers/cxl/core/pci.c
++++ b/drivers/cxl/core/pci.c
+@@ -241,17 +241,36 @@ static void disable_hdm(void *_cxlhdm)
+ hdm + CXL_HDM_DECODER_CTRL_OFFSET);
+ }
+
+-static int devm_cxl_enable_hdm(struct device *host, struct cxl_hdm *cxlhdm)
++int devm_cxl_enable_hdm(struct cxl_port *port, struct cxl_hdm *cxlhdm)
+ {
+- void __iomem *hdm = cxlhdm->regs.hdm_decoder;
++ void __iomem *hdm;
+ u32 global_ctrl;
+
++ /*
++ * If the hdm capability was not mapped there is nothing to enable and
++ * the caller is responsible for what happens next. For example,
++ * emulate a passthrough decoder.
++ */
++ if (IS_ERR(cxlhdm))
++ return 0;
++
++ hdm = cxlhdm->regs.hdm_decoder;
+ global_ctrl = readl(hdm + CXL_HDM_DECODER_CTRL_OFFSET);
++
++ /*
++ * If the HDM decoder capability was enabled on entry, skip
++ * registering disable_hdm() since this decode capability may be
++ * owned by platform firmware.
++ */
++ if (global_ctrl & CXL_HDM_DECODER_ENABLE)
++ return 0;
++
+ writel(global_ctrl | CXL_HDM_DECODER_ENABLE,
+ hdm + CXL_HDM_DECODER_CTRL_OFFSET);
+
+- return devm_add_action_or_reset(host, disable_hdm, cxlhdm);
++ return devm_add_action_or_reset(&port->dev, disable_hdm, cxlhdm);
+ }
++EXPORT_SYMBOL_NS_GPL(devm_cxl_enable_hdm, CXL);
+
+ int cxl_dvsec_rr_decode(struct device *dev, int d,
+ struct cxl_endpoint_dvsec_info *info)
+@@ -425,7 +444,7 @@ int cxl_hdm_decode_init(struct cxl_dev_s
+ if (info->mem_enabled)
+ return 0;
+
+- rc = devm_cxl_enable_hdm(&port->dev, cxlhdm);
++ rc = devm_cxl_enable_hdm(port, cxlhdm);
+ if (rc)
+ return rc;
+
+--- a/drivers/cxl/cxl.h
++++ b/drivers/cxl/cxl.h
+@@ -710,6 +710,7 @@ struct cxl_endpoint_dvsec_info {
+ struct cxl_hdm;
+ struct cxl_hdm *devm_cxl_setup_hdm(struct cxl_port *port,
+ struct cxl_endpoint_dvsec_info *info);
++int devm_cxl_enable_hdm(struct cxl_port *port, struct cxl_hdm *cxlhdm);
+ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
+ struct cxl_endpoint_dvsec_info *info);
+ int devm_cxl_add_passthrough_decoder(struct cxl_port *port);
+--- a/drivers/cxl/port.c
++++ b/drivers/cxl/port.c
+@@ -60,13 +60,17 @@ static int discover_region(struct device
+ static int cxl_switch_port_probe(struct cxl_port *port)
+ {
+ struct cxl_hdm *cxlhdm;
+- int rc;
++ int rc, nr_dports;
+
+- rc = devm_cxl_port_enumerate_dports(port);
+- if (rc < 0)
+- return rc;
++ nr_dports = devm_cxl_port_enumerate_dports(port);
++ if (nr_dports < 0)
++ return nr_dports;
+
+ cxlhdm = devm_cxl_setup_hdm(port, NULL);
++ rc = devm_cxl_enable_hdm(port, cxlhdm);
++ if (rc)
++ return rc;
++
+ if (!IS_ERR(cxlhdm))
+ return devm_cxl_enumerate_decoders(cxlhdm, NULL);
+
+@@ -75,7 +79,7 @@ static int cxl_switch_port_probe(struct
+ return PTR_ERR(cxlhdm);
+ }
+
+- if (rc == 1) {
++ if (nr_dports == 1) {
+ dev_dbg(&port->dev, "Fallback to passthrough decoder\n");
+ return devm_cxl_add_passthrough_decoder(port);
+ }
+--- a/tools/testing/cxl/Kbuild
++++ b/tools/testing/cxl/Kbuild
+@@ -6,6 +6,7 @@ ldflags-y += --wrap=acpi_pci_find_root
+ ldflags-y += --wrap=nvdimm_bus_register
+ ldflags-y += --wrap=devm_cxl_port_enumerate_dports
+ ldflags-y += --wrap=devm_cxl_setup_hdm
++ldflags-y += --wrap=devm_cxl_enable_hdm
+ ldflags-y += --wrap=devm_cxl_add_passthrough_decoder
+ ldflags-y += --wrap=devm_cxl_enumerate_decoders
+ ldflags-y += --wrap=cxl_await_media_ready
+--- a/tools/testing/cxl/test/mock.c
++++ b/tools/testing/cxl/test/mock.c
+@@ -149,6 +149,21 @@ struct cxl_hdm *__wrap_devm_cxl_setup_hd
+ }
+ EXPORT_SYMBOL_NS_GPL(__wrap_devm_cxl_setup_hdm, CXL);
+
++int __wrap_devm_cxl_enable_hdm(struct cxl_port *port, struct cxl_hdm *cxlhdm)
++{
++ int index, rc;
++ struct cxl_mock_ops *ops = get_cxl_mock_ops(&index);
++
++ if (ops && ops->is_mock_port(port->uport))
++ rc = 0;
++ else
++ rc = devm_cxl_enable_hdm(port, cxlhdm);
++ put_cxl_mock_ops(index);
++
++ return rc;
++}
++EXPORT_SYMBOL_NS_GPL(__wrap_devm_cxl_enable_hdm, CXL);
++
+ int __wrap_devm_cxl_add_passthrough_decoder(struct cxl_port *port)
+ {
+ int rc, index;
--- /dev/null
+From 482e6ad9adde69d9da08864b4ccf4dfd53edb2f0 Mon Sep 17 00:00:00 2001
+From: Fangzhi Zuo <jerry.zuo@amd.com>
+Date: Wed, 10 May 2023 16:43:30 -0400
+Subject: drm/amd/display: Have Payload Properly Created After Resume
+
+From: Fangzhi Zuo <jerry.zuo@amd.com>
+
+commit 482e6ad9adde69d9da08864b4ccf4dfd53edb2f0 upstream.
+
+At drm suspend sequence, MST dc_sink is removed. When commit cached
+MST stream back in drm resume sequence, the MST stream payload is not
+properly created and added into the payload table. After resume, topology
+change is reprobed by removing existing streams first. That leads to
+no payload is found in the existing payload table as below error
+"[drm] ERROR No payload for [MST PORT:] found in mst state"
+
+1. In encoder .atomic_check routine, remove check existance of dc_sink
+2. Bypass MST by checking existence of MST root port. dc_link_type cannot
+differentiate MST port before topology is rediscovered.
+
+Reviewed-by: Wayne Lin <wayne.lin@amd.com>
+Acked-by: Tom Chung <chiahsuan.chung@amd.com>
+Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -2813,7 +2813,7 @@ static int dm_resume(void *handle)
+ * this is the case when traversing through already created
+ * MST connectors, should be skipped
+ */
+- if (aconnector->dc_link->type == dc_connection_mst_branch)
++ if (aconnector && aconnector->mst_root)
+ continue;
+
+ mutex_lock(&aconnector->hpd_lock);
+@@ -6717,7 +6717,7 @@ static int dm_encoder_helper_atomic_chec
+ int clock, bpp = 0;
+ bool is_y420 = false;
+
+- if (!aconnector->mst_output_port || !aconnector->dc_sink)
++ if (!aconnector->mst_output_port)
+ return 0;
+
+ mst_port = aconnector->mst_output_port;
--- /dev/null
+From 0d2dd02d74e6377268f56b90261de0fae8f0d2cb Mon Sep 17 00:00:00 2001
+From: Evan Quan <evan.quan@amd.com>
+Date: Fri, 19 May 2023 14:20:17 +0800
+Subject: drm/amd/pm: add missing NotifyPowerSource message mapping for SMU13.0.7
+
+From: Evan Quan <evan.quan@amd.com>
+
+commit 0d2dd02d74e6377268f56b90261de0fae8f0d2cb upstream.
+
+Otherwise, the power source switching will fail due to message
+unavailable.
+
+Fixes: bf4823267a81 ("drm/amd/pm: fix possible power mode mismatch between driver and PMFW")
+Signed-off-by: Evan Quan <evan.quan@amd.com>
+Reviewed-by: Guchun Chen <guchun.chen@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
++++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
+@@ -125,6 +125,7 @@ static struct cmn2asic_msg_mapping smu_v
+ MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0),
+ MSG_MAP(AllowGpo, PPSMC_MSG_SetGpoAllow, 0),
+ MSG_MAP(GetPptLimit, PPSMC_MSG_GetPptLimit, 0),
++ MSG_MAP(NotifyPowerSource, PPSMC_MSG_NotifyPowerSource, 0),
+ };
+
+ static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = {
--- /dev/null
+From 40baba5693b9af586dc1063af603d05a79e57a6b Mon Sep 17 00:00:00 2001
+From: Jonatas Esteves <jntesteves@gmail.com>
+Date: Sat, 20 May 2023 10:39:52 -0300
+Subject: drm/amd/pm: Fix output of pp_od_clk_voltage
+
+From: Jonatas Esteves <jntesteves@gmail.com>
+
+commit 40baba5693b9af586dc1063af603d05a79e57a6b upstream.
+
+Printing the other clock types should not be conditioned on being able
+to print OD_SCLK. Some GPUs currently have limited capability of only
+printing a subset of these.
+
+Since this condition was introduced in v5.18-rc1, reading from
+`pp_od_clk_voltage` has been returning empty on the Asus ROG Strix G15
+(2021).
+
+Fixes: 79c65f3fcbb1 ("drm/amd/pm: do not expose power implementation details to amdgpu_pm.c")
+Reviewed-by: Evan Quan <evan.quan@amd.com>
+Signed-off-by: Jonatas Esteves <jntesteves@gmail.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/pm/amdgpu_pm.c | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
++++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+@@ -869,13 +869,11 @@ static ssize_t amdgpu_get_pp_od_clk_volt
+ }
+ if (ret == -ENOENT) {
+ size = amdgpu_dpm_print_clock_levels(adev, OD_SCLK, buf);
+- if (size > 0) {
+- size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size);
+- size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size);
+- size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size);
+- size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size);
+- size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size);
+- }
++ size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size);
++ size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size);
++ size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size);
++ size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size);
++ size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size);
+ }
+
+ if (size == 0)
--- /dev/null
+From 7fc602dbfd548045862df096910b7d21e6d300bf Mon Sep 17 00:00:00 2001
+From: Jesse Zhang <jesse.zhang@amd.com>
+Date: Thu, 18 May 2023 09:46:22 +0800
+Subject: drm/amdgpu: don't enable secure display on incompatible platforms
+
+From: Jesse Zhang <jesse.zhang@amd.com>
+
+commit 7fc602dbfd548045862df096910b7d21e6d300bf upstream.
+
+[why]
+[drm] psp gfx command LOAD_TA(0x1) failed and response status is (0x7)
+[drm] psp gfx command INVOKE_CMD(0x3) failed and response status is (0x4)
+amdgpu 0000:04:00.0: amdgpu: Secure display: Generic Failure.
+
+[how]
+don't enable secure display on incompatible platforms
+
+Suggested-by: Aaron Liu <aaron.liu@amd.com>
+Signed-off-by: Jesse zhang <jesse.zhang@amd.com>
+Reviewed-by: Aaron Liu <aaron.liu@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdgpu/psp_v10_0.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c
+@@ -57,7 +57,13 @@ static int psp_v10_0_init_microcode(stru
+ if (err)
+ return err;
+
+- return psp_init_ta_microcode(psp, ucode_prefix);
++ err = psp_init_ta_microcode(psp, ucode_prefix);
++ if ((adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 1, 0)) &&
++ (adev->pdev->revision == 0xa1) &&
++ (psp->securedisplay_context.context.bin_desc.fw_version >= 0x27000008)) {
++ adev->psp.securedisplay_context.context.bin_desc.size_bytes = 0;
++ }
++ return err;
+ }
+
+ static int psp_v10_0_ring_create(struct psp_context *psp,
--- /dev/null
+From ad81e23426a651eb89a4b306e1c4169e6308c124 Mon Sep 17 00:00:00 2001
+From: Jocelyn Falempe <jfalempe@redhat.com>
+Date: Wed, 10 May 2023 15:10:34 +0200
+Subject: drm/mgag200: Fix gamma lut not initialized.
+
+From: Jocelyn Falempe <jfalempe@redhat.com>
+
+commit ad81e23426a651eb89a4b306e1c4169e6308c124 upstream.
+
+When mgag200 switched from simple KMS to regular atomic helpers,
+the initialization of the gamma settings was lost.
+This leads to a black screen, if the bios/uefi doesn't use the same
+pixel color depth.
+
+v2: rebase on top of drm-misc-fixes, and add Cc stable tag.
+
+Link: https://bugzilla.redhat.com/show_bug.cgi?id=2171155
+Fixes: 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers")
+Cc: <stable@vger.kernel.org>
+Tested-by: Phil Oester <kernel@linuxace.com>
+Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
+Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20230510131034.284078-1-jfalempe@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/mgag200/mgag200_mode.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
++++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
+@@ -640,6 +640,11 @@ void mgag200_crtc_helper_atomic_enable(s
+ if (funcs->pixpllc_atomic_update)
+ funcs->pixpllc_atomic_update(crtc, old_state);
+
++ if (crtc_state->gamma_lut)
++ mgag200_crtc_set_gamma(mdev, format, crtc_state->gamma_lut->data);
++ else
++ mgag200_crtc_set_gamma_linear(mdev, format);
++
+ mgag200_enable_display(mdev);
+
+ if (funcs->enable_vidrst)
--- /dev/null
+From a34fc1bcd2c4d8b09dcfc0b95ac65bca1e579bd7 Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Thu, 18 May 2023 12:38:22 -0400
+Subject: drm/radeon: reintroduce radeon_dp_work_func content
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit a34fc1bcd2c4d8b09dcfc0b95ac65bca1e579bd7 upstream.
+
+Put back the radeon_dp_work_func logic. It seems that
+handling DP RX interrupts is necessary to make some
+panels work. This was removed with the MST support,
+but it regresses some systems so add it back. While
+we are here, add the proper mutex locking.
+
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2567
+Fixes: 01ad1d9c2888 ("drm/radeon: Drop legacy MST support")
+Reviewed-by: Lyude Paul <lyude@redhat.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: Lyude Paul <lyude@redhat.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/radeon/radeon_irq_kms.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
++++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
+@@ -99,6 +99,16 @@ static void radeon_hotplug_work_func(str
+
+ static void radeon_dp_work_func(struct work_struct *work)
+ {
++ struct radeon_device *rdev = container_of(work, struct radeon_device,
++ dp_work);
++ struct drm_device *dev = rdev->ddev;
++ struct drm_mode_config *mode_config = &dev->mode_config;
++ struct drm_connector *connector;
++
++ mutex_lock(&mode_config->mutex);
++ list_for_each_entry(connector, &mode_config->connector_list, head)
++ radeon_connector_hotplug(connector);
++ mutex_unlock(&mode_config->mutex);
+ }
+
+ /**
--- /dev/null
+From 50a1726b148ff30778cb8a6cf3736130b07c93fd Mon Sep 17 00:00:00 2001
+From: Frank Li <Frank.Li@nxp.com>
+Date: Mon, 15 May 2023 12:20:52 -0400
+Subject: dt-binding: cdns,usb3: Fix cdns,on-chip-buff-size type
+
+From: Frank Li <Frank.Li@nxp.com>
+
+commit 50a1726b148ff30778cb8a6cf3736130b07c93fd upstream.
+
+In cdns3-gadget.c, 'cdns,on-chip-buff-size' was read using
+device_property_read_u16(). It resulted in 0 if a 32bit value was used
+in dts. This commit fixes the dt binding doc to declare it as u16.
+
+Cc: stable@vger.kernel.org
+Fixes: 68989fe1c39d ("dt-bindings: usb: Convert cdns-usb3.txt to YAML schema")
+Signed-off-by: Frank Li <Frank.Li@nxp.com>
+Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/devicetree/bindings/usb/cdns,usb3.yaml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
++++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
+@@ -64,7 +64,7 @@ properties:
+ description:
+ size of memory intended as internal memory for endpoints
+ buffers expressed in KB
+- $ref: /schemas/types.yaml#/definitions/uint32
++ $ref: /schemas/types.yaml#/definitions/uint16
+
+ cdns,phyrst-a-enable:
+ description: Enable resetting of PHY if Rx fail is detected
--- /dev/null
+From 0a1bb16e0fe6650c3841e611de374bfd5578ad70 Mon Sep 17 00:00:00 2001
+From: Zev Weiss <zev@bewilderbeest.net>
+Date: Tue, 16 May 2023 22:47:56 -0700
+Subject: gpio: mockup: Fix mode of debugfs files
+
+From: Zev Weiss <zev@bewilderbeest.net>
+
+commit 0a1bb16e0fe6650c3841e611de374bfd5578ad70 upstream.
+
+This driver's debugfs files have had a read operation since commit
+2a9e27408e12 ("gpio: mockup: rework debugfs interface"), but were
+still being created with write-only mode bits. Update them to
+indicate that the files can also be read.
+
+Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
+Fixes: 2a9e27408e12 ("gpio: mockup: rework debugfs interface")
+Cc: stable@kernel.org # v5.1+
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpio/gpio-mockup.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpio/gpio-mockup.c
++++ b/drivers/gpio/gpio-mockup.c
+@@ -369,7 +369,7 @@ static void gpio_mockup_debugfs_setup(st
+ priv->offset = i;
+ priv->desc = gpiochip_get_desc(gc, i);
+
+- debugfs_create_file(name, 0200, chip->dbg_dir, priv,
++ debugfs_create_file(name, 0600, chip->dbg_dir, priv,
+ &gpio_mockup_debugfs_ops);
+ }
+ }
parisc-enable-lockdep-support.patch
parisc-handle-kprobes-breakpoints-only-in-kernel-context.patch
xfs-fix-livelock-in-delayed-allocation-at-enospc.patch
+cxl-port-enable-the-hdm-decoder-capability-for-switch-ports.patch
+gpio-mockup-fix-mode-of-debugfs-files.patch
+btrfs-use-nofs-when-cleaning-up-aborted-transactions.patch
+thermal-intel-int340x-add-new-line-for-uuid-display.patch
+block-fix-bio-cache-for-passthru-io.patch
+dt-binding-cdns-usb3-fix-cdns-on-chip-buff-size-type.patch
+drm-amd-display-have-payload-properly-created-after-resume.patch
+drm-mgag200-fix-gamma-lut-not-initialized.patch
+drm-radeon-reintroduce-radeon_dp_work_func-content.patch
+drm-amdgpu-don-t-enable-secure-display-on-incompatible-platforms.patch
+drm-amd-pm-add-missing-notifypowersource-message-mapping-for-smu13.0.7.patch
+drm-amd-pm-fix-output-of-pp_od_clk_voltage.patch
--- /dev/null
+From 5f7fdb0f255756b594cc45c2c08b0140bc4a1761 Mon Sep 17 00:00:00 2001
+From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Date: Mon, 22 May 2023 15:38:44 -0700
+Subject: thermal: intel: int340x: Add new line for UUID display
+
+From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+
+commit 5f7fdb0f255756b594cc45c2c08b0140bc4a1761 upstream.
+
+Prior to the commit "763bd29fd3d1 ("thermal: int340x_thermal: Use
+sysfs_emit_at() instead of scnprintf()", there was a new line after each
+UUID string.
+
+With the newline removed, existing user space like "thermald" fails to
+compare each supported UUID as it is using getline() to read UUID and
+apply correct thermal table.
+
+To avoid breaking existing user space, add newline after each UUID string.
+
+Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Fixes: 763bd29fd3d1 ("thermal: int340x_thermal: Use sysfs_emit_at() instead of scnprintf()")
+Cc: 6.3+ <stable@vger.kernel.org> # 6.3+
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+index 810231b59dcd..5e1164226ada 100644
+--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
++++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+@@ -131,7 +131,7 @@ static ssize_t available_uuids_show(struct device *dev,
+
+ for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {
+ if (priv->uuid_bitmap & (1 << i))
+- length += sysfs_emit_at(buf, length, int3400_thermal_uuids[i]);
++ length += sysfs_emit_at(buf, length, "%s\n", int3400_thermal_uuids[i]);
+ }
+
+ return length;
+@@ -149,7 +149,7 @@ static ssize_t current_uuid_show(struct device *dev,
+
+ for (i = 0; i <= INT3400_THERMAL_CRITICAL; i++) {
+ if (priv->os_uuid_mask & BIT(i))
+- length += sysfs_emit_at(buf, length, int3400_thermal_uuids[i]);
++ length += sysfs_emit_at(buf, length, "%s\n", int3400_thermal_uuids[i]);
+ }
+
+ if (length)
+--
+2.40.1
+