From patchwork Wed Aug 17 08:51:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerald Yang X-Patchwork-Id: 1667167 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=J1BNX6mS; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4M71yP4fDYz1ygF for ; Wed, 17 Aug 2022 18:53:33 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oOEnk-0003Dn-22; Wed, 17 Aug 2022 08:53:24 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oOEmk-0000hd-Ou for kernel-team@lists.ubuntu.com; Wed, 17 Aug 2022 08:52:22 +0000 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id E11423F46E for ; Wed, 17 Aug 2022 08:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1660726340; bh=l/kx0lSfJD9eMwwj4yc80tN7ysNfdky4bMaajWn2qPw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=J1BNX6mSwWPnXTkj9xOR54EXWEyBQ25dfZjNeLuQZKdWIzn3IsIlSycB2coMfnihJ Y7HT2TKMEPkRk/8y9MTaWPffPO25R7sP4MbuqXHTYDWHAHvt/TnVILW7FgQVFBrXAl 4pe8O0Qv0LW3kJ1070tXc2Xk3uoNHV5mygy3RTQsMNPupst0dnM9QMKhseRhsFKE66 hQsVSxfpTOSFbKAfmEGkuuBRFN6+YAAUniGus6H3ZpWSbeutzEwcNBx4zvCKBpnKni +gE2btVwK8DLzv0J266mUExmITIp4tPJ940Z7BWaTREpuS3lwKB5BlCLfuThRF1ZNn bP3vkaGZL1X2A== Received: by mail-pj1-f71.google.com with SMTP id t10-20020a17090a4e4a00b001fab2c791dcso646442pjl.5 for ; Wed, 17 Aug 2022 01:52:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=l/kx0lSfJD9eMwwj4yc80tN7ysNfdky4bMaajWn2qPw=; b=Iuc4BvCUaG/gnbQQnFQPl7byd28LntYbPPpNAwU6V3ZA+QG4NnO4NjEVSnvnRcKDcS anlxa9d9MSt5Y17JvYelTZDRtNl8ii+cb+OMMtWSjKLRuiMFHcYCZPf1IHJYx25mPwXr zS3JuDPF+8qGcrT/X5T+StB8QI4IXQQGJ6nt0fGSODZsKzhi2nfwJR8hBxujt4Rbh0uG MGwftD+q4olym4aZuxfhVI1r0ur+GMFiJgc1J3MsN9J4Im757lZsbdLanezqpVBwQA5x EjygE3GD1x39jGiLe6GSWuvifwM359v1bEaLegTIOJHv08x1klCL5SCD4LaMQygopu4x 5TeQ== X-Gm-Message-State: ACgBeo2Cf26VoKb1qMmz07Y0AdzUiO+Iu1l3qJoDfI87EFbB7aAjFu8F nsCLRmTrLbw4DmN+swZXoFAGtsOKAlWUTzn5lhdisT0pl/M1BeTsY71Rg1vuQPAKC3L0wCbmC7T Cez3bNTFt9eIfBSlN2TQSmFFoctensyY4ecTZ8it00A== X-Received: by 2002:a17:90a:f411:b0:1f7:620c:4a83 with SMTP id ch17-20020a17090af41100b001f7620c4a83mr2743213pjb.43.1660726339316; Wed, 17 Aug 2022 01:52:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR5KqUn2ZjySIKYKbSrG0ifObTAxdvh4YVeSRJXM6ezaoMH18mWYnISMV+3miS9UV5rfX7StDQ== X-Received: by 2002:a17:90a:f411:b0:1f7:620c:4a83 with SMTP id ch17-20020a17090af41100b001f7620c4a83mr2743199pjb.43.1660726339005; Wed, 17 Aug 2022 01:52:19 -0700 (PDT) Received: from localhost.localdomain (220-135-31-21.hinet-ip.hinet.net. [220.135.31.21]) by smtp.gmail.com with ESMTPSA id s90-20020a17090a69e300b001f522180d46sm1001033pjj.8.2022.08.17.01.52.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 01:52:18 -0700 (PDT) From: Gerald Yang To: kernel-team@lists.ubuntu.com Subject: [SRU][jammy/linux-aws][kinetic/linux-aws][PATCH 17/20] UBUNTU: SAUCE: xen: restore pirqs on resume from hibernation. Date: Wed, 17 Aug 2022 16:51:47 +0800 Message-Id: <20220817085150.2078055-22-gerald.yang@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220817085150.2078055-1-gerald.yang@canonical.com> References: <20220817085150.2078055-1-gerald.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Frank van der Linden BugLink: https://bugs.launchpad.net/bugs/1968062 The hibernation code unlinks event channels from these (legacy) IRQs, so they must be reinitialized on wakeup, much like in the Xen suspend/resume case. Signed-off-by: Frank van der Linden Reviewed-by: Cristian Gafton Reviewed-by: Anchal Agarwal Reviewed-by: Alakesh Haloi CR: https://code.amazon.com/reviews/CR-3702953/ (cherry picked from commit 5ac2dbdedcf419c726f323cd4c2f93ff652b46b4 amazon-5.15.y/mainline) Signed-off-by: Gerald Yang Signed-off-by: Matthew Ruffell --- arch/x86/xen/suspend.c | 2 ++ drivers/xen/events/events_base.c | 5 +++++ include/xen/events.h | 1 + 3 files changed, 8 insertions(+) diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c index affa63d4b6bd..39644923b623 100644 --- a/arch/x86/xen/suspend.c +++ b/arch/x86/xen/suspend.c @@ -132,6 +132,8 @@ static void xen_syscore_resume(void) xen_restore_steal_clock(smp_processor_id()); gnttab_resume(); + + xen_restore_pirqs(); } /* diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 5883320002d0..0249e34104ac 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -2145,6 +2145,11 @@ void xen_shutdown_pirqs(void) } } +void xen_restore_pirqs(void) +{ + restore_pirqs(); +} + static struct irq_chip xen_dynamic_chip __read_mostly = { .name = "xen-dyn", diff --git a/include/xen/events.h b/include/xen/events.h index 7f30459489d7..72fb0167eb2e 100644 --- a/include/xen/events.h +++ b/include/xen/events.h @@ -87,6 +87,7 @@ void notify_remote_via_irq(int irq); void xen_irq_resume(void); void xen_shutdown_pirqs(void); +void xen_restore_pirqs(void); /* Clear an irq's pending state, in preparation for polling on it */ void xen_clear_irq_pending(int irq);