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: 6723921 Return-Path: X-Original-To: patchwork-kvm@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 D18CAC05AC for ; Mon, 6 Jul 2015 13:27:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F34AF205F3 for ; Mon, 6 Jul 2015 13:27:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E56C205EB for ; Mon, 6 Jul 2015 13:27:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755909AbbGFNZ0 (ORCPT ); Mon, 6 Jul 2015 09:25:26 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:35013 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755094AbbGFNZV (ORCPT ); Mon, 6 Jul 2015 09:25:21 -0400 Received: by wiga1 with SMTP id a1so228809673wig.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=P/pTaVI/jFbAxTnVffb6wI0/wFL1vW/0XjS6cLR/Croj5WxRBCWim1Rg0S3zD32aeP S9v5Yfrh4F/R0+Mgv5NbC4E/gpnKnJ2FNaliTqjvNxdcBTfPzX80RDShcsJzgtlz3sLq gomfhNk6MFumpPk9Wi3B7ci69A1oiwKjeRfKp2CNdQyJgGkbR711IjAIiNlwFlHZM6zx /OrK+FXpgVIRGk9558ayWBdM2oI/YEZ943OLHMR0A5woRkpVbdVXY0pBPCnSd9ubwNPC 8oS0vqWL+3P7yvLTPMd7BR0RyChVsMff+++dmSdtqIv1qOiUB2hVGf+oTVe/M822WzMZ 3B0w== X-Gm-Message-State: ALoCoQm4fiGeTxD4eOdS2EtQ8lWv7Dsikyb1bWLJDL8sJabKc3cP6nGVlfaxZiFBLDBvkB3DhUmu 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 *,