From patchwork Mon Jul 6 13:24:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 50758 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 61A1D229FC for ; Mon, 6 Jul 2015 13:25:30 +0000 (UTC) Received: by wgjx7 with SMTP id x7sf49832958wgj.3 for ; Mon, 06 Jul 2015 06:25:29 -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=MBhXgQJVd5nmuDdeH5sdl66DJ5/IpJ+06B644/RFNx8=; b=EOrjnL8/bUhrNoCSlSP6C0HsDO+ogyPzzqR/BFRq9Is0yd75Qf6k8r+KzxVR2th12f VjL9zAJuScYLxKodg03aMlWk7ofZwr9Um4t+VGrb/l6I5M3M4RDVrduzaVwt0/uFWd3w Abece4YiXQKYenSkPBzu6xadS2aWEe1Cisrh+Aj2KNmwpMXmXuzyGrce6dvPMcUbDJRf Lp87EuDzpTu6AaoId6q/ufwazGEoX2g9o+oYt7q1wNM/qQ0JPEEmje7BR3IneJSDRycH 8b+wwa6B+alLulLy/x+BIaCkxAA3ObirNKBcuuquGw9fXW+WOAOFZs9hwBm7zrU7lvgY MkLA== X-Gm-Message-State: ALoCoQnB+uBAreQIZAOwM9SSq2ktkYfDZi3BusOVjY0q3LpdCBJPbh8C77ufeaLzPAwwKquF2nMs X-Received: by 10.194.5.229 with SMTP id v5mr13814438wjv.0.1436189129626; Mon, 06 Jul 2015 06:25:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.71 with SMTP id h7ls154478laa.55.gmail; Mon, 06 Jul 2015 06:25:29 -0700 (PDT) X-Received: by 10.112.221.9 with SMTP id qa9mr8548093lbc.23.1436189129341; Mon, 06 Jul 2015 06:25:29 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id r1si15283928lar.2.2015.07.06.06.25.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 06:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by labgy5 with SMTP id gy5so2204830lab.2 for ; Mon, 06 Jul 2015 06:25:28 -0700 (PDT) X-Received: by 10.152.5.197 with SMTP id u5mr10218721lau.76.1436189128647; Mon, 06 Jul 2015 06:25:28 -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 hn6csp1725288lbb; Mon, 6 Jul 2015 06:25:28 -0700 (PDT) X-Received: by 10.180.91.107 with SMTP id cd11mr49917270wib.51.1436189121002; Mon, 06 Jul 2015 06:25:21 -0700 (PDT) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com. [209.85.212.176]) by mx.google.com with ESMTPS id ju2si52174203wid.33.2015.07.06.06.25.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 06:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.176 as permitted sender) client-ip=209.85.212.176; Received: by wiwl6 with SMTP id l6so284728099wiw.0 for ; Mon, 06 Jul 2015 06:25:20 -0700 (PDT) X-Received: by 10.194.121.100 with SMTP id lj4mr47335352wjb.104.1436189120704; Mon, 06 Jul 2015 06:25:20 -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.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 06:25:18 -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 6/9] irq: bypass: add active field on producer side Date: Mon, 6 Jul 2015 15:24:40 +0200 Message-Id: <1436189083-32527-7-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.52 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: , An active boolean is introduced on producer side: it reflects whether the source is active (at interrupt controller level or at VFIO level - automasked -). This is a temporary hack for ARM IRQ forwarding with vfio platform. I think the connect and disconnect should become callbacks too. This would make possible to handle error in the process. Typically active could be returned by producer->stop and analyzed before going further. in that case the list_add only if connect returns 0. Signed-off-by: Eric Auger --- include/linux/irqbypass.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/irqbypass.h b/include/linux/irqbypass.h index 8f62235..c89c3a8 100644 --- a/include/linux/irqbypass.h +++ b/include/linux/irqbypass.h @@ -9,6 +9,8 @@ struct irq_bypass_producer { struct list_head node; void *token; int irq; /* linux irq */ + /* is irq active at irqchip or VFIO masked? */ + bool active; void (*stop)(struct irq_bypass_producer *); void (*resume)(struct irq_bypass_producer *); void (*add_consumer)(struct irq_bypass_producer *,