From patchwork Tue Nov 11 15:47:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 40593 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 163E8241C9 for ; Tue, 11 Nov 2014 15:50:47 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id f15sf5630384lbj.7 for ; Tue, 11 Nov 2014 07:50:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=pCaq92xOLcHoCQDmRriCN1Frs1han24xZlmrCICz9DM=; b=mYJ8R11kRu48ApVzZX/+rxlmPRO1wM6o6HmO2XseJSXaBhCM65lTi12/cdR455yRgz bpZtD9vWQVuc3uvi+yoCowrhG/HoiYCd3wn/Oxo6O1/Y4azYubRctbTfhxdsoWTYLk4E GNVJpnTWQixgBPHpbP9dEgJ7wFDISPrcxdXaWpXkZGRwNK7CjkyiU4UMkBTblkOF2tsE NtR8gRdqTy6y5AyfTUySZ08JVtQR1Ap2LdZpQTKuneHINCiNdcttM0mnqzFdO+GvIvi8 qB2eJm44n5tQVVFl2toSCxF5/yvlvcXBO7mi+EBZInJi2KrXB+WlH4syIY9LP3JNLkL9 I5/g== X-Gm-Message-State: ALoCoQkJFNR7i8zG225jLvgTmf/aWWAZ6u6vbTXWN9Wn6vbQUQmt6YWNt/PCWKwWzl+gh++k7+z1 X-Received: by 10.194.239.200 with SMTP id vu8mr960488wjc.3.1415721045968; Tue, 11 Nov 2014 07:50:45 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.4 with SMTP id x4ls319642lag.70.gmail; Tue, 11 Nov 2014 07:50:45 -0800 (PST) X-Received: by 10.152.9.225 with SMTP id d1mr11127545lab.38.1415721045813; Tue, 11 Nov 2014 07:50:45 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id wh3si31751733lbb.118.2014.11.11.07.50.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Nov 2014 07:50:45 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id gf13so9873888lab.3 for ; Tue, 11 Nov 2014 07:50:45 -0800 (PST) X-Received: by 10.112.235.196 with SMTP id uo4mr27406222lbc.66.1415721045717; Tue, 11 Nov 2014 07:50:45 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp277490lbc; Tue, 11 Nov 2014 07:50:44 -0800 (PST) X-Received: by 10.68.180.130 with SMTP id do2mr41043464pbc.28.1415721044149; Tue, 11 Nov 2014 07:50:44 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id rp1si20217359pbc.214.2014.11.11.07.50.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Nov 2014 07:50:44 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1XoDh2-00010R-V4; Tue, 11 Nov 2014 15:49:20 +0000 Received: from foss-mx-na.foss.arm.com ([217.140.108.86]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XoDgS-0000h2-KT for linux-arm-kernel@lists.infradead.org; Tue, 11 Nov 2014 15:48:45 +0000 Received: from foss-smtp-na-1.foss.arm.com (unknown [10.80.61.8]) by foss-mx-na.foss.arm.com (Postfix) with ESMTP id 1FD9117A; Tue, 11 Nov 2014 09:48:19 -0600 (CST) Received: from collaborate-mta1.arm.com (highbank-bc01-b06.austin.arm.com [10.112.81.134]) by foss-smtp-na-1.foss.arm.com (Postfix) with ESMTP id CDA5B5FAD8; Tue, 11 Nov 2014 09:48:16 -0600 (CST) Received: from e102391-lin.cambridge.arm.com (e102391-lin.cambridge.arm.com [10.1.209.143]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 7B54513F78C; Tue, 11 Nov 2014 09:48:15 -0600 (CST) From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiang Liu , Thomas Gleixner Subject: [PATCH 01/15] genirq: Add a few more helper funtions to support stacked irq_chip Date: Tue, 11 Nov 2014 15:47:59 +0000 Message-Id: <1415720893-13371-2-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1415720893-13371-1-git-send-email-marc.zyngier@arm.com> References: <1415720893-13371-1-git-send-email-marc.zyngier@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141111_074844_739267_B24548B3 X-CRM114-Status: UNSURE ( 8.47 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.5 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Bjorn Helgaas , Yingjoe Chen , Mark Rutland , Will Deacon , Catalin marinas X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: marc.zyngier@arm.com 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.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 To follow-up on 9e310a9 (genirq: Introduce helper functions to support stacked irq_chip), add a few additional helpers to deal with mask/unmask and eoi. This is required to support the standard ARM interrupt controllers (GIC/GICv3). Signed-off-by: Marc Zyngier --- include/linux/irq.h | 6 ++++++ kernel/irq/chip.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/include/linux/irq.h b/include/linux/irq.h index 041edd6..aec2145 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -454,6 +454,12 @@ extern void handle_nested_irq(unsigned int irq); extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg); #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY extern void irq_chip_ack_parent(struct irq_data *data); +extern void irq_chip_mask_parent(struct irq_data *data); +extern void irq_chip_unmask_parent(struct irq_data *data); +extern void irq_chip_eoi_parent(struct irq_data *data); +extern int irq_chip_set_affinity_parent(struct irq_data *data, + const struct cpumask *mask_val, + bool force); extern int irq_chip_retrigger_hierarchy(struct irq_data *data); #endif diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 8f362db..d028b34 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -858,6 +858,37 @@ void irq_chip_ack_parent(struct irq_data *data) data->chip->irq_ack(data); } +void irq_chip_mask_parent(struct irq_data *data) +{ + data = data->parent_data; + if (data && data->chip && data->chip->irq_mask) + data->chip->irq_mask(data); +} + +void irq_chip_unmask_parent(struct irq_data *data) +{ + data = data->parent_data; + if (data && data->chip && data->chip->irq_unmask) + data->chip->irq_unmask(data); +} + +void irq_chip_eoi_parent(struct irq_data *data) +{ + data = data->parent_data; + if (data && data->chip && data->chip->irq_eoi) + data->chip->irq_eoi(data); +} + +int irq_chip_set_affinity_parent(struct irq_data *data, + const struct cpumask *mask_val, bool force) +{ + data = data->parent_data; + if (data && data->chip && data->chip->irq_set_affinity) + return data->chip->irq_set_affinity(data, mask_val, force); + + return -EINVAL; +} + int irq_chip_retrigger_hierarchy(struct irq_data *data) { for (data = data->parent_data; data; data = data->parent_data)