Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp136997ybl; Tue, 7 Jan 2020 15:45:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxAE1QEHUMds2ZULNL3UX2xHwqlpthxmSVmXfKKe756J5pT+NGe51fv0TYipbg8+p/kbixY X-Received: by 2002:a05:6830:1401:: with SMTP id v1mr2066766otp.360.1578440731566; Tue, 07 Jan 2020 15:45:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578440731; cv=none; d=google.com; s=arc-20160816; b=L9+ukoo283el0V0Zs1TUsWNXQrE0MIciYE6Foa+P75vHwfAV2D+iVSi6P85iXriXz1 HfFKZsaiF6p7nv7Z/iWL7CMH50xdMQpRfbDs/1iCbygPAh9RAf5YyUhe+tY5OP2EnyUM G1Ldt/DZ8pl9OUOMYSnuINoPDW/f2nLO/WQIp8vBAanSX9DtONQ5bHH//5Pi4RJq/gyq cqIMwGiaMQtCxkJ7x5Cw72Y/Y/Pphq7ETFwMABtyiwgxkmwOolHi66tqUEKH/vYXqJsl fUXNAnX5Mn+ajgn6deHOmlSyrKEu5MV7mkfgfI6BaDseRxrGZcs7nTk/wKXTymMQep6p 9EqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:ironport-sdr :dkim-signature; bh=f6Z3Yh5Svpg3B2CNoDg+pE4bEOLYIDxF72khvbH/8BY=; b=KOyM2gTx48ddlhlYcfA/XtRy/ObDZEEJIJz71V3i2o2kd4iNjB4ZlzoKtu8bGuHzsJ eg1GhNjIn/+mfw+u29N7x1MJ2Or6NZkKemeVuW7bc2hmVHXV2FVA3CUw4rOF5qYQdXtY hEPRiU/PsTXxPbxVW2p4EZrjX6x7V5eKfNgC0sA7bTX3sckKprbEkQNB2tJ5NRBAgRoV i/dxPnfHZP0bQzkpo0J2WpKQj/9PL6eF/IcQS1aW6tD4i2ZMvEiyAQUXdbtAHvwc00x5 LaiY0ZXp+7s32lPffI7gNTpWqMcDQCu4opbQtmF3nFoiKHS5DrHLkHuEjwhS4G48maDW QBzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=jPvScGo5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si814047oih.217.2020.01.07.15.45.20; Tue, 07 Jan 2020 15:45:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=jPvScGo5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727742AbgAGXol (ORCPT + 99 others); Tue, 7 Jan 2020 18:44:41 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:49868 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726470AbgAGXol (ORCPT ); Tue, 7 Jan 2020 18:44:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1578440680; x=1609976680; h=date:from:to:cc:subject:message-id:mime-version; bh=f6Z3Yh5Svpg3B2CNoDg+pE4bEOLYIDxF72khvbH/8BY=; b=jPvScGo5QEpUBPzh7LP5nv5KKNgTK80b5wox5ndDK4Cf6qEDfDXjLTko NSBsKxFb/S/CEIC/4C1f+5rw4mB9kJ/BEzX873Qsz3tBeSHoA5L1ZqYv6 /TsV0N/DZoDuN3c+WRNt801wm9CDaNq/RsXHryTP9cCbdCL25VgWE99M+ k=; IronPort-SDR: VN1Xhl+bt3NNnO0zmMcnfsgfdV3B10I31QHUCoO03TuuoIqc3+CWPtyE1hCWoqAapXVMKhX0hf /se6u6x4A+3Q== X-IronPort-AV: E=Sophos;i="5.69,407,1571702400"; d="scan'208";a="11335463" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-119b4f96.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 07 Jan 2020 23:44:39 +0000 Received: from EX13MTAUEB002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-119b4f96.us-west-2.amazon.com (Postfix) with ESMTPS id 8A5F71A0AC3; Tue, 7 Jan 2020 23:44:36 +0000 (UTC) Received: from EX13D08UEB003.ant.amazon.com (10.43.60.11) by EX13MTAUEB002.ant.amazon.com (10.43.60.12) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 7 Jan 2020 23:44:21 +0000 Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D08UEB003.ant.amazon.com (10.43.60.11) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 7 Jan 2020 23:44:21 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 7 Jan 2020 23:44:20 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id CE67040E65; Tue, 7 Jan 2020 23:44:20 +0000 (UTC) Date: Tue, 7 Jan 2020 23:44:20 +0000 From: Anchal Agarwal To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Subject: [RFC PATCH V2 09/11] xen: Clear IRQD_IRQ_STARTED flag during shutdown PIRQs Message-ID: <20200107234420.GA18738@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org shutdown_pirq is invoked during hibernation path and hence PIRQs should be restarted during resume. Before this commit'020db9d3c1dc0a' xen/events: Fix interrupt lost during irq_disable and irq_enable startup_pirq was automatically called during irq_enable however, after this commit pirq's did not get explicitly started once resumed from hibernation. chip->irq_startup is called only if IRQD_IRQ_STARTED is unset during irq_startup on resume. This flag gets cleared by free_irq->irq_shutdown during suspend. free_irq() never gets explicitly called for ioapic-edge and ioapic-level interrupts as respective drivers do nothing during suspend/resume. So we shut them down explicitly in the first place in syscore_suspend path to clear IRQ<>event channel mapping. shutdown_pirq being called explicitly during suspend does not clear this flags, hence .irq_enable is called in irq_startup during resume instead and pirq's never start up. Signed-off-by: Anchal Agarwal --- drivers/xen/events/events_base.c | 1 + include/linux/irq.h | 1 + kernel/irq/chip.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index b893536d8af4..aae7c4997b51 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -1606,6 +1606,7 @@ void xen_shutdown_pirqs(void) continue; shutdown_pirq(irq_get_irq_data(info->irq)); + irq_state_clr_started(irq_to_desc(info->irq)); } } diff --git a/include/linux/irq.h b/include/linux/irq.h index fb301cf29148..1e125cd22cf0 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -745,6 +745,7 @@ extern int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry); extern int irq_set_msi_desc_off(unsigned int irq_base, unsigned int irq_offset, struct msi_desc *entry); extern struct irq_data *irq_get_irq_data(unsigned int irq); +extern void irq_state_clr_started(struct irq_desc *desc); static inline struct irq_chip *irq_get_chip(unsigned int irq) { diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index b76703b2c0af..3e8a36c673d6 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -173,10 +173,11 @@ static void irq_state_clr_masked(struct irq_desc *desc) irqd_clear(&desc->irq_data, IRQD_IRQ_MASKED); } -static void irq_state_clr_started(struct irq_desc *desc) +void irq_state_clr_started(struct irq_desc *desc) { irqd_clear(&desc->irq_data, IRQD_IRQ_STARTED); } +EXPORT_SYMBOL_GPL(irq_state_clr_started); static void irq_state_set_started(struct irq_desc *desc) { -- 2.15.3.AMZN