--- /dev/null
+From 2130b87b2273389cafe6765bf09ef564cda01407 Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Fri, 14 Oct 2022 08:21:03 -0700
+Subject: drm/amd/display: Fix build breakage with CONFIG_DEBUG_FS=n
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit 2130b87b2273389cafe6765bf09ef564cda01407 upstream.
+
+After commit 8799c0be89eb ("drm/amd/display: Fix vblank refcount in vrr
+transition"), a build with CONFIG_DEBUG_FS=n is broken due to a
+misplaced brace, along the lines of:
+
+ In file included from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_trace.h:39,
+ from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:41:
+ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: At top level:
+ ./include/drm/drm_atomic.h:864:9: error: expected identifier or ‘(’ before ‘for’
+ 864 | for ((__i) = 0; \
+ | ^~~
+ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8317:9: note: in expansion of macro ‘for_each_new_crtc_in_state’
+ 8317 | for_each_new_crtc_in_state(state, crtc, new_crtc_state, j)
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Move the brace within the #ifdef so that the file can be built with or
+without CONFIG_DEBUG_FS.
+
+Fixes: 8799c0be89eb ("drm/amd/display: Fix vblank refcount in vrr transition")
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -9991,8 +9991,8 @@ static void amdgpu_dm_atomic_commit_tail
+ crtc, dm_new_crtc_state, cur_crc_src))
+ DRM_DEBUG_DRIVER("Failed to configure crc source");
+ }
+-#endif
+ }
++#endif
+ }
+
+ for_each_new_crtc_in_state(state, crtc, new_crtc_state, j)
--- /dev/null
+From a4cb3651a174366cc85a677da9e3681fbe97fdae Mon Sep 17 00:00:00 2001
+From: Nicholas Piggin <npiggin@gmail.com>
+Date: Thu, 13 Oct 2022 16:44:18 +1000
+Subject: powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context
+
+From: Nicholas Piggin <npiggin@gmail.com>
+
+commit a4cb3651a174366cc85a677da9e3681fbe97fdae upstream.
+
+It's possible for an interrupt returning to an irqs-disabled context to
+lose a pending soft-masked irq because it branches to part of the exit
+code for irqs-enabled contexts, which is meant to clear only the
+PACA_IRQS_HARD_DIS flag from PACAIRQHAPPENED by zeroing the byte. This
+just looks like a simple thinko from a recent commit (if there was no
+hard mask pending, there would be no reason to clear it anyway).
+
+This also adds comment to the code that actually does need to clear the
+flag.
+
+Fixes: e485f6c751e0a ("powerpc/64/interrupt: Fix return to masked context after hard-mask irq becomes pending")
+Reported-by: Sachin Sant <sachinp@linux.ibm.com>
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20221013064418.1311104-1-npiggin@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/kernel/interrupt_64.S | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+--- a/arch/powerpc/kernel/interrupt_64.S
++++ b/arch/powerpc/kernel/interrupt_64.S
+@@ -571,7 +571,7 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return_\s
+ beq .Lfast_kernel_interrupt_return_\srr\() // EE already disabled
+ lbz r11,PACAIRQHAPPENED(r13)
+ andi. r10,r11,PACA_IRQ_MUST_HARD_MASK
+- beq 1f // No HARD_MASK pending
++ beq .Lfast_kernel_interrupt_return_\srr\() // No HARD_MASK pending
+
+ /* Must clear MSR_EE from _MSR */
+ #ifdef CONFIG_PPC_BOOK3S
+@@ -588,12 +588,23 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return_\s
+ b .Lfast_kernel_interrupt_return_\srr\()
+
+ .Linterrupt_return_\srr\()_soft_enabled:
++ /*
++ * In the soft-enabled case, need to double-check that we have no
++ * pending interrupts that might have come in before we reached the
++ * restart section of code, and restart the exit so those can be
++ * handled.
++ *
++ * If there are none, it is be possible that the interrupt still
++ * has PACA_IRQ_HARD_DIS set, which needs to be cleared for the
++ * interrupted context. This clear will not clobber a new pending
++ * interrupt coming in, because we're in the restart section, so
++ * such would return to the restart location.
++ */
+ #ifdef CONFIG_PPC_BOOK3S
+ lbz r11,PACAIRQHAPPENED(r13)
+ andi. r11,r11,(~PACA_IRQ_HARD_DIS)@l
+ bne- interrupt_return_\srr\()_kernel_restart
+ #endif
+-1:
+ li r11,0
+ stb r11,PACAIRQHAPPENED(r13) // clear the possible HARD_DIS
+