From patchwork Tue Aug 19 16:45:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 35626 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3D960202DD for ; Tue, 19 Aug 2014 16:46:37 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf43747253obc.4 for ; Tue, 19 Aug 2014 09:46:36 -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=FKeIzR68qAfQ8Ybr5Y3uO9qNjqSpIlANKmKgWHxBEhI=; b=auvuQm9vmNmi23qY92e2/fOUUL4hg2DYZEgX64t+iT2MEE4zrF9uwEZpymPTIehzKW qfabYFRAPnFLi0M7BiPWstKxx/AQMIfAlyuVX0LUKm3NDCwbC15pk/g7Vu9kD5glyHKP 89sXyU59cnF8/0yTHiPXCOoMR/0j/axh7NgrMfkz5tZ1/XzOePnP5TgNlK4UwGSGq9ti PBWSRd8idATirxvoUpFbAJYn/qNIPRAJBywAj0LtQaCoDLoz7HboeGkukitqkYxI08Q6 QP3bVDmAH8DNK6fIFX+I6Ipg07kiMvEVDx0QjogmZrRcJiwIo6AIZoh2s94IGKfBr7Yv n83Q== X-Gm-Message-State: ALoCoQn3ibdYEu26q04YEwp4U9gDA9Fpk5S02IC2HJ/3atavxyv+uIams51DG6myK24fzmkje/JY X-Received: by 10.50.57.111 with SMTP id h15mr3684704igq.3.1408466796822; Tue, 19 Aug 2014 09:46:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.119 with SMTP id e110ls2905865qge.43.gmail; Tue, 19 Aug 2014 09:46:36 -0700 (PDT) X-Received: by 10.220.166.207 with SMTP id n15mr628001vcy.75.1408466796581; Tue, 19 Aug 2014 09:46:36 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id fg10si8420311vdc.26.2014.08.19.09.46.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 09:46:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hy4so7613314vcb.41 for ; Tue, 19 Aug 2014 09:46:36 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr1532753vcb.48.1408466796490; Tue, 19 Aug 2014 09:46:36 -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.221.37.5 with SMTP id tc5csp254327vcb; Tue, 19 Aug 2014 09:46:35 -0700 (PDT) X-Received: by 10.180.20.40 with SMTP id k8mr8337574wie.54.1408466795309; Tue, 19 Aug 2014 09:46:35 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id s1si20342wif.8.2014.08.19.09.46.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 09:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.178 as permitted sender) client-ip=209.85.212.178; Received: by mail-wi0-f178.google.com with SMTP id hi2so5614426wib.5 for ; Tue, 19 Aug 2014 09:46:34 -0700 (PDT) X-Received: by 10.180.96.33 with SMTP id dp1mr8143950wib.20.1408466794797; Tue, 19 Aug 2014 09:46:34 -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 gc8sm36225wic.3.2014.08.19.09.46.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Aug 2014 09:46:33 -0700 (PDT) From: Daniel Thompson To: Russell King Cc: Daniel Thompson , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kgdb-bugreport@lists.sourceforge.net, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Anton Vorontsov , Colin Cross , kernel-team@android.com, Rob Herring , Linus Walleij , Ben Dooks , Catalin Marinas , Dave Martin , Fabio Estevam , Frederic Weisbecker , Nicolas Pitre Subject: [PATCH v10 02/19] arm: fiq: Allow ACK and EOI to be passed to the intc Date: Tue, 19 Aug 2014 17:45:52 +0100 Message-Id: <1408466769-20004-3-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1408466769-20004-1-git-send-email-daniel.thompson@linaro.org> References: <1408369264-14242-1-git-send-email-daniel.thompson@linaro.org> <1408466769-20004-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@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.220.182 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: , Modern ARM interrupt controllers require an ACK as interrupts are taken and an EOI on completion. The FIQ code currently does not provide any API to perform this. This patch provides this API, implemented by adding two callbacks to the fiq_chip structure. Signed-off-by: Daniel Thompson Acked-by: Nicolas Pitre Cc: Russell King Cc: Fabio Estevam --- arch/arm/include/asm/fiq.h | 9 +++++++++ arch/arm/kernel/fiq.c | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/arch/arm/include/asm/fiq.h b/arch/arm/include/asm/fiq.h index ed44528..a25c952 100644 --- a/arch/arm/include/asm/fiq.h +++ b/arch/arm/include/asm/fiq.h @@ -22,6 +22,13 @@ struct fiq_chip { void (*fiq_enable)(struct irq_data *data); void (*fiq_disable)(struct irq_data *data); + + /* .fiq_ack() and .fiq_eoi() will be called from the FIQ + * handler. For this reason they must not use spin locks (or any + * other locks). + */ + int (*fiq_ack)(struct irq_data *data); + void (*fiq_eoi)(struct irq_data *data); }; struct fiq_handler { @@ -44,6 +51,8 @@ extern void release_fiq(struct fiq_handler *f); extern void set_fiq_handler(void *start, unsigned int length); extern void enable_fiq(int fiq); extern void disable_fiq(int fiq); +extern int ack_fiq(int fiq); +extern void eoi_fiq(int fiq); extern bool has_fiq(int fiq); extern void fiq_register_mapping(int irq, struct fiq_chip *chip); diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index 5d831cf..3ccaa8c 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c @@ -183,6 +183,25 @@ void disable_fiq(int fiq) disable_irq(fiq + fiq_start); } +int ack_fiq(int fiq) +{ + struct fiq_data *data = lookup_fiq_data(fiq); + + if (data && data->fiq_chip->fiq_ack) + return data->fiq_chip->fiq_ack(data->irq_data); + + return fiq; +} + +void eoi_fiq(int fiq) +{ + struct fiq_data *data = lookup_fiq_data(fiq); + + if (data && data->fiq_chip->fiq_eoi) + data->fiq_chip->fiq_eoi(data->irq_data); +} +EXPORT_SYMBOL(eoi_fiq); + bool has_fiq(int fiq) { struct fiq_data *data = lookup_fiq_data(fiq);