lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 422/846] iommu/amd: X2apic mode: mask/unmask interrupts on suspend/resume
    Date
    From: Maxim Levitsky <mlevitsk@redhat.com>

    [ 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 | 8 +++++++-
    1 file changed, 7 insertions(+), 1 deletion(-)

    diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
    index a826de8c99c45..50e5a728f12a1 100644
    --- a/drivers/iommu/amd/init.c
    +++ b/drivers/iommu/amd/init.c
    @@ -2101,6 +2101,11 @@ static int intcapxt_set_affinity(struct irq_data *irqd,
    return 0;
    }

    +static int intcapxt_set_wake(struct irq_data *irqd, unsigned int on)
    +{
    + return on ? -EOPNOTSUPP : 0;
    +}
    +
    static struct irq_chip intcapxt_controller = {
    .name = "IOMMU-MSI",
    .irq_unmask = intcapxt_unmask_irq,
    @@ -2108,7 +2113,8 @@ static struct irq_chip intcapxt_controller = {
    .irq_ack = irq_chip_ack_parent,
    .irq_retrigger = irq_chip_retrigger_hierarchy,
    .irq_set_affinity = intcapxt_set_affinity,
    - .flags = IRQCHIP_SKIP_SET_WAKE,
    + .irq_set_wake = intcapxt_set_wake,
    + .flags = IRQCHIP_MASK_ON_SUSPEND,
    };

    static const struct irq_domain_ops intcapxt_domain_ops = {
    --
    2.34.1


    \
     
     \ /
      Last update: 2022-01-25 04:09    [W:2.521 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site