From patchwork Tue Jun 12 20:56:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anchal Agarwal X-Patchwork-Id: 928491 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amazon.com header.i=@amazon.com header.b="OELyrn7a"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4152Jj6fLQz9s2t for ; Wed, 13 Jun 2018 06:57:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934619AbeFLU4y (ORCPT ); Tue, 12 Jun 2018 16:56:54 -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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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);