iommu/amd: X2apic mode: mask/unmask interrupts on suspend/resume
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 23 Nov 2021 16:10:37 +0000 (18:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 11:02:07 +0000 (12:02 +0100)
commit54a2b8e31a2bb77bd1e86021ec2bd8615a145c8e
tree326bc7f4342b524661e08fb0d5718e94b0c0052f
parentae648f235f8d1d4949f419f6e7a3ddedbab5e68d
iommu/amd: X2apic mode: mask/unmask interrupts on suspend/resume

[ Upstream commit 1980105e3cfc2215c75b4f6b172661d675c467d1 ]

Use IRQCHIP_MASK_ON_SUSPEND to make the core irq code to
mask the iommu interrupt on suspend and unmask it on the resume.

Since now the unmask function updates the INTX settings,
that will restore them on resume from s3/s4.

Since IRQCHIP_MASK_ON_SUSPEND is only effective for interrupts
which are not wakeup sources, remove IRQCHIP_SKIP_SET_WAKE flag
and instead implement a dummy .irq_set_wake which doesn't allow
the interrupt to become a wakeup source.

Fixes: 66929812955bb ("iommu/amd: Add support for X2APIC IOMMU interrupts")
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20211123161038.48009-5-mlevitsk@redhat.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/amd/init.c