Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5818182imm; Tue, 12 Jun 2018 13:58:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ+C6EbEaRLkJLbh3QsCWr4/oOdAr78iTpeKoiG6NyUrC4xbqwBmd+dZRb3mygTbZpa1WJv X-Received: by 2002:a62:f948:: with SMTP id g8-v6mr1961729pfm.107.1528837113527; Tue, 12 Jun 2018 13:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528837113; cv=none; d=google.com; s=arc-20160816; b=x5nf2kFWSdTYtrflySxR1mSpnECy/qNh6dBwHTko7ShHLWc6nXFj5cNTywpbwnITmX gIPXdMvgtqrX9WhbS/uKliVRvx2vB9VdOZ6emOuiaDG21uYdlG9LmIFrhYjI7rHnSt9i 6D/09g2azrgwbQdr8lL10rZubuw3hCO1RkRiIAmLqVxio0ca7I18h0qQTbiJRd4p4N5q pnWblJa7WbrGeuINJ8o27GCLxJwK7KyOsPUv3dfAh53xD8h6lXzwDimelxMPHgL1fLF7 AH4c2WqaJdoP07lYQ/fvnEGrC77K7vROsO/uWSXic9ysr4SGmGxEHbOKhkyE0BcKrhH4 X3/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Wq/2+Vx2/toTC1g6p4xJBEgO2q4jxfN5wL1oSCQ188U=; b=rYtFeI9og9XWbJFx2xoyraddx+UVXA2KvWWRAaQ07FUaipZufHAeY7mHctTrsfKNl6 9CsufXFwDMcaf1XdNuz+D2XBayKOW1LUFMEqavnHuL9JLAJHHjv8wOaqkOIL7ZLnX4Tx 65ulAdkS0epxeJHExGVsE4KYVJKDMmxPRGxxtlXIsaZf/0ui/KwS7mXl1YFGVuRT4R8z 24AOVVTBli7Umtl5HTQYfrTE9rmXkU0XAIbgsFTJuB0FX4r2FrJsUoO5aKJoEFVPQChs 2C8sgPWtsECQeEWhw6Gdf1UhJGdOfY+HUit2V3AWkLz0DxeSRdUtiCfx7dIct2dFwMD2 JbKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=OELyrn7a; 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 z2-v6si777058pgc.435.2018.06.12.13.58.18; Tue, 12 Jun 2018 13:58:33 -0700 (PDT) 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=OELyrn7a; 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 S934634AbeFLU4z (ORCPT + 99 others); Tue, 12 Jun 2018 16:56:55 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:1586 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934338AbeFLU4o (ORCPT ); Tue, 12 Jun 2018 16:56:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1528837004; x=1560373004; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Wq/2+Vx2/toTC1g6p4xJBEgO2q4jxfN5wL1oSCQ188U=; b=OELyrn7a5C444m/zkra/SzgYH+aJgS/L2LbGoVUcBNHckQq6p65m1GgW sfNT2APLAI1cL57ivt9LdVP1UDD6EUZaRbbUEMqpMoo8XM3AQUe0OhItj 5TPQqRN3SLyv+t5lBJTGXAYvxW/iuInEc+Ptb4p0zR2dTXJ+G9NcHWds5 Q=; X-IronPort-AV: E=Sophos;i="5.51,216,1526342400"; d="scan'208";a="617032514" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-2a-7c3c5f85.us-west-2.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Jun 2018 20:56:43 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2a-7c3c5f85.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w5CKuewb125665 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 12 Jun 2018 20:56:41 GMT Received: from EX13D13UWB004.ant.amazon.com (10.43.161.218) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 12 Jun 2018 20:56:38 +0000 Received: from EX13MTAUEB001.ant.amazon.com (10.43.60.96) by EX13D13UWB004.ant.amazon.com (10.43.161.218) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 12 Jun 2018 20:56:38 +0000 Received: from localhost (10.25.15.63) by mail-relay.amazon.com (10.43.60.129) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 12 Jun 2018 20:56:37 +0000 From: Anchal Agarwal To: , , , CC: , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 10/12] xen/events: add xen_shutdown_pirqs helper function Date: Tue, 12 Jun 2018 20:56:17 +0000 Message-ID: <20180612205619.28156-11-anchalag@amazon.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180612205619.28156-1-anchalag@amazon.com> References: <20180612205619.28156-1-anchalag@amazon.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Munehisa Kamata Add a simple helper function to "shutdown" active PIRQs, which actually closes event channels but keeps related IRQ structures intact. PM suspend/hibernation code will rely on this. Signed-off-by: Munehisa Kamata Signed-off-by: Anchal Agarwal Reviewed-by: Munehisa Kamata Reviewed-by: Eduardo Valentin --- drivers/xen/events/events_base.c | 12 ++++++++++++ include/xen/events.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 762378f..88137c8 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -1581,6 +1581,18 @@ void xen_irq_resume(void) restore_pirqs(); } +void xen_shutdown_pirqs(void) +{ + struct irq_info *info; + + list_for_each_entry(info, &xen_irq_list_head, list) { + if (info->type != IRQT_PIRQ || !VALID_EVTCHN(info->evtchn)) + continue; + + shutdown_pirq(irq_get_irq_data(info->irq)); + } +} + 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 c3e6bc6..e4d5ccb 100644 --- a/include/xen/events.h +++ b/include/xen/events.h @@ -70,6 +70,7 @@ static inline void notify_remote_via_evtchn(int port) void notify_remote_via_irq(int irq); void xen_irq_resume(void); +void xen_shutdown_pirqs(void); /* Clear an irq's pending state, in preparation for polling on it */ void xen_clear_irq_pending(int irq); -- 2.7.4