From patchwork Mon Aug 10 13:20:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 52238 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 3C3DB22919 for ; Mon, 10 Aug 2015 13:22:04 +0000 (UTC) Received: by labth1 with SMTP id th1sf61650072lab.2 for ; Mon, 10 Aug 2015 06:22:02 -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=LWPjxtg96frESmXioLbRdGYu9TmTxyKA03NkBYLx7rQ=; b=dQUVGF5+Lgho29OZdwNgrlF/GDcU/LQX02MAiKN5mkNdE5d0lH3SFIxSkwLqzl74zR KbP8Jq1Zsq8REXj/T1+U/2Jw0XQgob3/4ytRZoBvWf1iDj772FUVeDKr66MAppMjotPk ozu15GaX/8Ff1Yv3i79MPo61Myh04y1uEwywJgNoYF7dwG8e/y1hseZdOF+GWzV+zDDe h423L/+R7jT4/U1/J+P8DcgrjKF6PgZRA2uL17TovWnMLSG8Ua6zbeHudk6ch4rxDM6X DJ86+/QH498mhSHrsLxDYk5b2SuWDQuAfLU1YJMOcSjQY4T3xO0RznLQQ0wNH/gX6qQU Pi3g== X-Gm-Message-State: ALoCoQnuPL+8o6F+mgb9FWKi7bMFIt+9/hjoIa740GgSf7iqGEVc8cxYroMqRkFG0Gh6MiA6ZmEA X-Received: by 10.112.160.39 with SMTP id xh7mr6347068lbb.22.1439212922377; Mon, 10 Aug 2015 06:22:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.9 with SMTP id ku9ls675472lac.37.gmail; Mon, 10 Aug 2015 06:22:02 -0700 (PDT) X-Received: by 10.112.25.69 with SMTP id a5mr19666167lbg.16.1439212921979; Mon, 10 Aug 2015 06:22:01 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id lf12si14035706lac.25.2015.08.10.06.22.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbtg9 with SMTP id tg9so57111919lbb.1 for ; Mon, 10 Aug 2015 06:22:01 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr19973988lag.86.1439212921863; Mon, 10 Aug 2015 06:22:01 -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.7.198 with SMTP id l6csp1931721lba; Mon, 10 Aug 2015 06:22:01 -0700 (PDT) X-Received: by 10.180.90.198 with SMTP id by6mr15758411wib.82.1439212918372; Mon, 10 Aug 2015 06:21:58 -0700 (PDT) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com. [209.85.212.179]) by mx.google.com with ESMTPS id o14si16113644wiw.9.2015.08.10.06.21.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.179 as permitted sender) client-ip=209.85.212.179; Received: by wicne3 with SMTP id ne3so21956690wic.0 for ; Mon, 10 Aug 2015 06:21:58 -0700 (PDT) X-Received: by 10.194.238.168 with SMTP id vl8mr45652792wjc.128.1439212917952; Mon, 10 Aug 2015 06:21:57 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id fq15sm29517024wjc.12.2015.08.10.06.21.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:21:57 -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, alex.williamson@redhat.com, feng.wu@intel.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, pbonzini@redhat.com Subject: [PATCH v3 04/10] VFIO: platform: add vfio_platform_set_automasked Date: Mon, 10 Aug 2015 15:20:58 +0200 Message-Id: <1439212864-12954-5-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439212864-12954-1-git-send-email-eric.auger@linaro.org> References: <1439212864-12954-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.217.181 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 --- v1 -> v2: - set forwarded flag --- drivers/vfio/platform/vfio_platform_irq.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c index b31b1f0..a285384 100644 --- a/drivers/vfio/platform/vfio_platform_irq.c +++ b/drivers/vfio/platform/vfio_platform_irq.c @@ -186,6 +186,25 @@ 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->forwarded = true; + irq->flags |= VFIO_IRQ_INFO_AUTOMASKED; + irq->handler = vfio_automasked_irq_handler; + } else { + irq->forwarded = false; + 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) { }