--- /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
+@@ -5035,7 +5035,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);
+@@ -5140,7 +5144,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 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(+)
+
+diff --git 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
+index 98a33f8ee209..bba621615abf 100644
+--- 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_v13_0_7_message_map[SMU_MSG_MAX_COUNT] =
+ 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] = {
+--
+2.40.1
+
--- /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 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(+)
+
+diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
+index 0a5aaf78172a..576c4c838a33 100644
+--- 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(struct drm_crtc *crtc, struct drm_atomic_
+ 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)
+--
+2.40.1
+
--- /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
+@@ -100,6 +100,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
+@@ -368,7 +368,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-allow-to-reboot-machine-after-system-halt.patch
parisc-enable-lockdep-support.patch
parisc-handle-kprobes-breakpoints-only-in-kernel-context.patch
+gpio-mockup-fix-mode-of-debugfs-files.patch
+btrfs-use-nofs-when-cleaning-up-aborted-transactions.patch
+dt-binding-cdns-usb3-fix-cdns-on-chip-buff-size-type.patch
+drm-mgag200-fix-gamma-lut-not-initialized.patch
+drm-radeon-reintroduce-radeon_dp_work_func-content.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