From patchwork Mon Jul 6 13:24:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 50756 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D052C229FC for ; Mon, 6 Jul 2015 13:25:22 +0000 (UTC) Received: by wifm2 with SMTP id m2sf10538457wif.1 for ; Mon, 06 Jul 2015 06:25:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=E2D4o/dFHFY1HEwOcBjgFx6+24mLAsfBdjvEh6qqaB8=; b=QApxlINamW9ZZeO1nYkYDLmGMaz38iZsOi2cYRR5SDztW1UkgV5kSSbi24oUQJ/boI eQAfEtQ8X7iPNayrdxZIvwtX9szZK7e5HUJKvNbMJ7mR+ycHaJSFAiKIzZNsudvXFj/y wi3dQSUMsk1JVx2I6tDvdKc6aX3h3X/fbF24fw3M33BAJYpVnqdXI6tU4B+ff1/E0z98 I87Z1SKopt6l4i4xoY56aUOLOFEqNZWW58ek076pNA6BLunj8C/LcoWf41FzJGDRt+yt btdbe/jRgRt8Ycog91yF/6zdIoeDP1c/HiK/N3fSVVmpwwWqBo8c5wUaYJ0WxkzMAyOS 9YlA== X-Gm-Message-State: ALoCoQlFMahKbJ9mWPob58SJzS/68Rr7YtOsEFmJKJhLVpNK9YSHVeRCEBz9eGkTU9vgqnLEsaTx X-Received: by 10.113.11.3 with SMTP id ee3mr30533414lbd.9.1436189122163; Mon, 06 Jul 2015 06:25:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.2 with SMTP id t2ls699811laz.8.gmail; Mon, 06 Jul 2015 06:25:22 -0700 (PDT) X-Received: by 10.112.128.169 with SMTP id np9mr1312288lbb.73.1436189122019; Mon, 06 Jul 2015 06:25:22 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id t18si15240836laz.137.2015.07.06.06.25.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 06:25:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by laar3 with SMTP id r3so155072691laa.0 for ; Mon, 06 Jul 2015 06:25:21 -0700 (PDT) X-Received: by 10.112.93.37 with SMTP id cr5mr49416158lbb.106.1436189121559; Mon, 06 Jul 2015 06:25:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1725222lbb; Mon, 6 Jul 2015 06:25:20 -0700 (PDT) X-Received: by 10.180.94.39 with SMTP id cz7mr86075707wib.66.1436189116034; Mon, 06 Jul 2015 06:25:16 -0700 (PDT) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com. [209.85.212.181]) by mx.google.com with ESMTPS id a19si30214568wjr.138.2015.07.06.06.25.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 06:25:16 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.181 as permitted sender) client-ip=209.85.212.181; Received: by wiwl6 with SMTP id l6so284725803wiw.0 for ; Mon, 06 Jul 2015 06:25:15 -0700 (PDT) X-Received: by 10.180.99.2 with SMTP id em2mr90778447wib.59.1436189115748; Mon, 06 Jul 2015 06:25:15 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by mx.google.com with ESMTPSA id q4sm28148131wju.14.2015.07.06.06.25.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 06:25:14 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, avi.kivity@gmail.com, mtosatti@redhat.com, feng.wu@intel.com, joro@8bytes.org, b.reynal@virtualopensystems.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, alex.williamson@redhat.com, pbonzini@redhat.com Subject: [RFC v2 4/9] VFIO: platform: add vfio_platform_set_automasked Date: Mon, 6 Jul 2015 15:24:38 +0200 Message-Id: <1436189083-32527-5-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436189083-32527-1-git-send-email-eric.auger@linaro.org> References: <1436189083-32527-1-git-send-email-eric.auger@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This function makes possible to change the automasked mode. Signed-off-by: Eric Auger --- --- drivers/vfio/platform/vfio_platform_irq.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c index 7f8d27c..aa540db 100644 --- a/drivers/vfio/platform/vfio_platform_irq.c +++ b/drivers/vfio/platform/vfio_platform_irq.c @@ -186,6 +186,23 @@ static irqreturn_t vfio_handler(int irq, void *dev_id) return ret; } +static int vfio_platform_set_automasked(struct vfio_platform_irq *irq, + bool automasked) +{ + unsigned long flags; + + spin_lock_irqsave(&irq->lock, flags); + if (automasked) { + irq->flags |= VFIO_IRQ_INFO_AUTOMASKED; + irq->handler = vfio_automasked_irq_handler; + } else { + irq->flags &= ~VFIO_IRQ_INFO_AUTOMASKED; + irq->handler = vfio_irq_handler; + } + spin_unlock_irqrestore(&irq->lock, flags); + return 0; +} + static void vfio_platform_irq_bypass_stop(struct irq_bypass_producer *prod) { }