From patchwork Sat Jul 29 16:59:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shuo X-Patchwork-Id: 9870061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8987C6035E for ; Sat, 29 Jul 2017 17:07:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6385D2875B for ; Sat, 29 Jul 2017 17:07:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 463112880D; Sat, 29 Jul 2017 17:07:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C25B12875B for ; Sat, 29 Jul 2017 17:07:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbV9y-0000tI-HR; Sat, 29 Jul 2017 17:04:14 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbV9y-0000tC-2Z for xen-devel@lists.xenproject.org; Sat, 29 Jul 2017 17:04:14 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 4E/5D-01731-D00CC795; Sat, 29 Jul 2017 17:04:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRWlGSWpSXmKPExsVywNwkVpfnQE2 kwfS7Shbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8arm9+ZC3o5K97O+8HewPiUvYuRi0NIYBqj xNZrz1m6GDk5JAR4JY4sm8EKYftLLGhqZ4MoamOU2H9hPxNIgk1AVWLm4odgtoiAgsTm3mesI EXMAqeYJRZe3gs0loNDWCBQYtMETZAaFqD6f2172EBsXgEXif9njkEtkJO4evAn+wRG7gWMDK sYNYpTi8pSi3QNzfSSijLTM0pyEzNzdA0NTPVyU4uLE9NTcxKTivWS83M3MQI9zAAEOxjPn/Y 8xCjJwaQkyvtkVk2kEF9SfkplRmJxRnxRaU5q8SFGGQ4OJQneqn1AOcGi1PTUirTMHGCowaQl OHiURHhf7AVK8xYXJOYWZ6ZDpE4xGnNsWL3+CxPHqwn/vzEJseTl56VKifMGgkwSACnNKM2DG wSLgUuMslLCvIxApwnxFKQW5WaWoMq/YhTnYFQS5v0IMoUnM68Ebt8roFOYgE6Z2FQJckpJIk JKqoExN7bpRdDyZY6PTi7POXW9dhGP7+M1mZKGB632anCaNMa3sO92SBT39s5QNNniuufiC+N nP2rLbsfZ8e6ft+iJfvjGx98rs2/N6Nq+vzYqMdXr2tI3v9ud7wasuTVLQ2z+1+uPXjNvu/xo u8geZ5c9D31v2bT+kpyawMnDtvi8pvUv5nNeam+qlFiKMxINtZiLihMBKJEQ83wCAAA= X-Env-Sender: shuo.a.liu@intel.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1501347850!103360362!1 X-Originating-IP: [192.55.52.93] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDMyNDY2NQ==\n X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 45859 invoked from network); 29 Jul 2017 17:04:12 -0000 Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by server-5.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 29 Jul 2017 17:04:12 -0000 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2017 10:04:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,431,1496127600"; d="scan'208";a="113394547" Received: from shuo.sh.intel.com (HELO localhost) ([10.239.12.235]) by orsmga004.jf.intel.com with ESMTP; 29 Jul 2017 10:04:05 -0700 From: Liu Shuo To: linux-kernel@vger.kernel.org Date: Sun, 30 Jul 2017 00:59:57 +0800 Message-Id: <1501347598-15084-1-git-send-email-shuo.a.liu@intel.com> X-Mailer: git-send-email 1.9.4 Cc: Juergen Gross , Len Brown , KarimAllah Ahmed , Anoob Soman , Vitaly Kuznetsov , Thomas Gleixner , David Vrabel , Liu Shuo , "moderated list:XEN HYPERVISOR INTERFACE" , Boris Ostrovsky , Ingo Molnar Subject: [Xen-devel] [PATCH] xen/events: Fix interrupt lost during irq_disable and irq_enable X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Here is a device has xen-pirq-MSI interrupt. Dom0 might lost interrupt during driver irq_disable/irq_enable. Here is the scenario, 1. irq_disable -> disable_dynirq -> mask_evtchn(irq channel) 2. dev interrupt raised by HW and Xen mark its evtchn as pending 3. irq_enable -> startup_pirq -> eoi_pirq -> clear_evtchn(channel of irq) -> clear pending status 4. consume_one_event process the irq event without pending bit assert which result in interrupt lost once 5. No HW interrupt raising anymore. Now use enable_dynirq for enable_pirq of xen_pirq_chip to remove eoi_pirq when irq_enable. Signed-off-by: Liu Shuo Reviewed-by: Boris Ostrovsky --- drivers/xen/events/events_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index bae1f5d3..2d43118 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -574,7 +574,7 @@ static void shutdown_pirq(struct irq_data *data) static void enable_pirq(struct irq_data *data) { - startup_pirq(data); + enable_dynirq(data); } static void disable_pirq(struct irq_data *data)