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: Eric Auger X-Patchwork-Id: 6723971 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C3FBC05AC for ; Mon, 6 Jul 2015 13:27:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C3A1203B1 for ; Mon, 6 Jul 2015 13:27:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86BC620222 for ; Mon, 6 Jul 2015 13:27:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC6PZ-0000u2-FB; Mon, 06 Jul 2015 13:26:17 +0000 Received: from mail-wi0-f173.google.com ([209.85.212.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC6P0-0000Ha-AZ for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2015 13:25:42 +0000 Received: by wiwl6 with SMTP id l6so284728098wiw.0 for ; Mon, 06 Jul 2015 06:25:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MBhXgQJVd5nmuDdeH5sdl66DJ5/IpJ+06B644/RFNx8=; b=DvVz+G/kCfXw9ctCFhf/6dRrW0qYquFj2+RxUJ+0TaewxBXCvRQ8fgUdxJHKWfWB5b +lUBDaQNWu5yA2+16t6Ilv7xyqWfwVv8ZPFguEGtWf4Mt60Iq+OvYfvjmLADbtyrRSOT nkMPvpRrvqjrsjWPkHoKrIPh4zBHyy/hDuk/eMF7wj8nd5080OJdwGcDeU/yMN/zAvIt qyQntIRurysyNxIpFT7Vffw3VCVZSZZIPQVeBX2HCmf6Ts3PwcsLrt1xleKFoVSqVdi7 6m26yglyKBRVSkLYBr5ebMyEMFbMvglxwWvApBPVU7R00srtNi4zgKWUe5XIUGh5Un8q qkwg== X-Gm-Message-State: ALoCoQlJTCMPFvCO+sUE2u13DCd1OYlO8Ttk6CN4h7oKyrUCfibTmKzfzJQqAa7EBwN4PQ57Lc1K 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150706_062542_518170_704AC820 X-CRM114-Status: GOOD ( 13.29 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, alex.williamson@redhat.com, linux-kernel@vger.kernel.org, patches@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 *,