From patchwork Thu Jun 5 09:53:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 4304251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1B1E99F1D6 for ; Thu, 5 Jun 2014 09:56:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BDC12034C for ; Thu, 5 Jun 2014 09:56:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1D3F2017A for ; Thu, 5 Jun 2014 09:56:32 +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 1WsUMw-0001Gp-DQ; Thu, 05 Jun 2014 09:53:58 +0000 Received: from mail-we0-f180.google.com ([74.125.82.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WsUMn-0001DT-FN for linux-arm-kernel@lists.infradead.org; Thu, 05 Jun 2014 09:53:50 +0000 Received: by mail-we0-f180.google.com with SMTP id q58so791275wes.39 for ; Thu, 05 Jun 2014 02:53:27 -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=8h/Upvj65qySrDqLxwU+QiR/itDnQr7dohgWsj203n8=; b=gVyn4tUcggyxwjkQZ2F3vl041z1U8VO3QrKzj9NKs7RKFzHCSfLYla2c0GeblykvoB SGLZxF5KZJsSsII3oQkTwTAeVOfRB66QU+C7QWM1r+duvWa+3dfZPPqNVL+hLWQcMrA3 nN1SLTNDkhLbXmEUckmtuwTEtcp8kydJioFvxeBS7b0vKybda7ofkHF+7zAchAMLvrBZ YoPIKN8OAkz7aR5nU7tmr2MaK2y6X3RjdIT9BL0z6OcQFXFZVJlbfNNmq5j/FzCQhtOS ftyULeHLJJ570K51qnTls6IMW1QDQyTvFMqTDjvkWpV3S1UdMrIh2mHX4XYotoHsTH8Y rtww== X-Gm-Message-State: ALoCoQnW5UAyuwuTi9De9KLxz8uzMUOuKHQNAN1PC0XKWYOM1qwfoamK/u3ecEV8bmPJC4/zIaAw X-Received: by 10.194.189.116 with SMTP id gh20mr79837307wjc.41.1401962006974; Thu, 05 Jun 2014 02:53:26 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id s3sm7337863wje.36.2014.06.05.02.53.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jun 2014 02:53:25 -0700 (PDT) From: Daniel Thompson To: Jason Wessel Subject: [RFC v3 2/9] arm: fiq: Allow EOI to be communicated to the intc Date: Thu, 5 Jun 2014 10:53:07 +0100 Message-Id: <1401961994-18033-3-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1401961994-18033-1-git-send-email-daniel.thompson@linaro.org> References: <1400853478-5824-1-git-send-email-daniel.thompson@linaro.org> <1401961994-18033-1-git-send-email-daniel.thompson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140605_025349_667566_D85DD247 X-CRM114-Status: GOOD ( 13.10 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , kernel@stlinux.com, kgdb-bugreport@lists.sourceforge.net, Linus Walleij , Jiri Slaby , Daniel Thompson , Dirk Behme , Russell King , Nicolas Pitre , Fabio Estevam , Ian Campbell , Anton Vorontsov , "David A. Long" , linux-serial@vger.kernel.org, Catalin Marinas , kernel-team@android.com, devicetree@vger.kernel.org, linaro-kernel@lists.linaro.org, Pawel Moll , patches@linaro.org, Kumar Gala , Rob Herring , John Stultz , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Colin Cross , Frederic Weisbecker , Christoffer Dall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,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 Modern ARM systems require an EOI to be sent to the interrupt controller on completion of both IRQ and FIQ. The FIQ code currently does not provide any API to perform this. This patch provides this API, implemented by hooking into main irq driver in a similar way to the existing enable_fiq()/disable_fiq(). All existing in-kernel callers of init_FIQ() and fiq_add_mapping() have been reviewed to check they meet the documented restriction. Signed-off-by: Daniel Thompson Cc: Russell King Cc: Fabio Estevam Cc: Nicolas Pitre --- arch/arm/include/asm/fiq.h | 2 ++ arch/arm/kernel/fiq.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arch/arm/include/asm/fiq.h b/arch/arm/include/asm/fiq.h index 75d98c6..10d22eb 100644 --- a/arch/arm/include/asm/fiq.h +++ b/arch/arm/include/asm/fiq.h @@ -39,6 +39,8 @@ extern void set_fiq_handler(void *start, unsigned int length); extern struct irq_data *lookup_fiq_irq_data(int fiq); extern void enable_fiq(int fiq); extern void disable_fiq(int fiq); +extern void eoi_fiq_with_irq_data(struct irq_data *d); +extern void eoi_fiq(int fiq); extern void fiq_add_mapping(int irq, int fiq_virq, unsigned int length); /* helpers defined in fiqasm.S: */ diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index 177939c..ed01162 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c @@ -164,6 +164,25 @@ void disable_fiq(int fiq) disable_irq(d->irq); } +/* This call ends a FIQ and does not perform radix tree lookups. Use this + * if the FIQ interrupt rate is expected to be extremely high. + */ +void eoi_fiq_with_irq_data(struct irq_data *irq_data) +{ + struct irq_chip *chip = irq_data_get_irq_chip(irq_data); + if (chip->irq_eoi) + chip->irq_eoi(irq_data); +} +EXPORT_SYMBOL(eoi_fiq_with_irq_data); + +void eoi_fiq(int fiq) +{ + struct irq_data *d = lookup_fiq_irq_data(fiq); + BUG_ON(!d); + eoi_fiq_with_irq_data(d); +} +EXPORT_SYMBOL(eoi_fiq); + EXPORT_SYMBOL(set_fiq_handler); EXPORT_SYMBOL(__set_fiq_regs); /* defined in fiqasm.S */ EXPORT_SYMBOL(__get_fiq_regs); /* defined in fiqasm.S */ @@ -175,6 +194,9 @@ EXPORT_SYMBOL(disable_fiq); /* * Add a mapping between a normal IRQ and a FIQ shadow. + * + * By providing a mapping the interrupt controller is guaranteeing not + * to use spin locks from .irq_eoi */ void fiq_add_mapping(int irq, int fiq_virq, unsigned int length) { @@ -194,6 +216,12 @@ void fiq_add_mapping(int irq, int fiq_virq, unsigned int length) mutex_unlock(&fiq_virq_mutex); } +/* + * Set the offset between normal IRQs and their FIQ shadows. + * + * By providing an offset the interrupt controller is guaranteeing not + * to use spin locks from .irq_eoi + */ void __init init_FIQ(int start) { fiq_start = start;