Received: by 10.223.185.116 with SMTP id b49csp119397wrg; Tue, 13 Feb 2018 17:54:27 -0800 (PST) X-Google-Smtp-Source: AH8x227u6HwKI775RHqqgEgaG8E72gum4rPAaDG7Tss9pglefCAm917wOIECXS6dOCaxuO/pgUAS X-Received: by 2002:a17:902:6a16:: with SMTP id m22-v6mr2963288plk.142.1518573267414; Tue, 13 Feb 2018 17:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518573267; cv=none; d=google.com; s=arc-20160816; b=ErhP/umrTk8b3NsdpMXtlnQYlhkk6QRgwQrK5fmHseWsGUQV+Lx5MK49o4bCfEQvUD dTiOIR/hPZDtRUUpqu8byNsRKcA8LyCu/OyTe60rcFk+AprrgvDG40L1P/QqzmRh1H4+ xSejkSgi+DRnUSLbA5udjPi+zFciDVwVl7l4IoxN718idM9Y1Lwzq92jHJqCr5+NfMC6 Z+x/uxE6KOXz44y5O9qpnZQjm0OCNoCku3jEXR4vG0TyjB3nZUBCb08s/s2Ecp63cLTZ 1uxf1F4D6pfgHcMOTDwJb6L/J5NOXRJrjjkLq1SLY2ST6YXbbmiHKTPzKgllFBk4tv+O bgmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Hy8OWsiuVCaN7xdTcJnJGw2rfi06cp9sSIUnOslarFo=; b=gW9LGGalTTYJ2qK2CsiTzAtSH20pEeznjsWKC5CvanWGwU1iMclhfqKDOay98tiBYh xzQ+JMjvzW8TYiQOXgdzYbDqN6YYhrxrysJDSuvsUKTytAFabKeg65DsxAHy2JVN4tT+ A/i4iZ8ai392lNeiPPat43cZVhDekM3qjjIabQxXYhOQGx6ojqk0uoI0ePrjbHOtCTGP OIOR/X5z11/TN+hYyOSxgX3c+pY7HYfKWUlJ3dY5F5WAceby5ghaskhHsmgfcP6BKGDQ w+dttmIg8//9SqbDXy4TZ/vKp9fVBoiqN/LYeoBVoqU52AkTyU5BGviiCbW5Nsji1IN8 9Bng== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4-v6si2486226plb.648.2018.02.13.17.54.13; Tue, 13 Feb 2018 17:54:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966515AbeBNBwI (ORCPT + 99 others); Tue, 13 Feb 2018 20:52:08 -0500 Received: from mga02.intel.com ([134.134.136.20]:56121 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966458AbeBNBv1 (ORCPT ); Tue, 13 Feb 2018 20:51:27 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.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 Cc: dri-devel@lists.freedesktop.org, dongwon.kim@intel.com, mateuszx.potrola@intel.com, sumit.semwal@linaro.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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.16.1