From patchwork Wed Feb 14 01:50:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kim, Dongwon" X-Patchwork-Id: 10217915 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 054E66055C for ; Wed, 14 Feb 2018 01:51:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E908028F0E for ; Wed, 14 Feb 2018 01:51:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD3D528F32; Wed, 14 Feb 2018 01:51:30 +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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9F19C28F0E for ; Wed, 14 Feb 2018 01:51:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0638E6E32D; Wed, 14 Feb 2018 01:51:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7B98F6E056 for ; Wed, 14 Feb 2018 01:51:25 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2018 17:51:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,510,1511856000"; d="scan'208";a="34498964" Received: from downor-z87x-ud5h.fm.intel.com ([10.1.122.107]) by orsmga002.jf.intel.com with ESMTP; 13 Feb 2018 17:51:24 -0800 From: Dongwon Kim To: linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, xen-devel@lists.xenproject.org Subject: [RFC PATCH v2 9/9] hyper_dmabuf: threaded interrupt in Xen-backend Date: Tue, 13 Feb 2018 17:50:08 -0800 Message-Id: <20180214015008.9513-10-dongwon.kim@intel.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180214015008.9513-1-dongwon.kim@intel.com> References: <20180214015008.9513-1-dongwon.kim@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dongwon.kim@intel.com, dri-devel@lists.freedesktop.org, mateuszx.potrola@intel.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use threaded interrupt intead of regular one because most part of ISR is time-critical and possibly sleeps Signed-off-by: Dongwon Kim --- .../hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm.c b/drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm.c index 30bc4b6304ac..65af5ddfb2d7 100644 --- a/drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm.c +++ b/drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm.c @@ -332,11 +332,14 @@ int xen_be_init_tx_rbuf(int domid) } /* setting up interrupt */ - ret = bind_evtchn_to_irqhandler(alloc_unbound.port, - front_ring_isr, 0, - NULL, (void *) ring_info); + ring_info->irq = bind_evtchn_to_irq(alloc_unbound.port); - if (ret < 0) { + ret = request_threaded_irq(ring_info->irq, + NULL, + front_ring_isr, + IRQF_ONESHOT, NULL, ring_info); + + if (ret != 0) { dev_err(hy_drv_priv->dev, "Failed to setup event channel\n"); close.port = alloc_unbound.port; @@ -348,7 +351,6 @@ int xen_be_init_tx_rbuf(int domid) } ring_info->rdomain = domid; - ring_info->irq = ret; ring_info->port = alloc_unbound.port; mutex_init(&ring_info->lock); @@ -535,9 +537,10 @@ int xen_be_init_rx_rbuf(int domid) if (!xen_comm_find_tx_ring(domid)) ret = xen_be_init_tx_rbuf(domid); - ret = request_irq(ring_info->irq, - back_ring_isr, 0, - NULL, (void *)ring_info); + ret = request_threaded_irq(ring_info->irq, + NULL, + back_ring_isr, IRQF_ONESHOT, + NULL, (void *)ring_info); return ret;