From patchwork Tue Sep 2 13:00:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 36468 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 851E22032B for ; Tue, 2 Sep 2014 13:01:22 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id m1sf38409682oag.3 for ; Tue, 02 Sep 2014 06:01:22 -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=m9q4BT80DynJQYqBh29A9mA1jfpTQc3dkSbc5m18QgEyGMXZ564c5GUoP7w27IFDio 4TJf8kCAIqYOsEb+3kiTBf2cHVySzfsEDz7ZsY5vPrwEN7BGmXPvi+62cwelwAZ2viaC I+5l3vmbDN644OhGqyc2Ucj5qrButHhjJYPVAbr55fb5qbpwws+ACLgCsKx7HbUxJys1 ob85UTYXf4rZop7QcD/lqhl6RiXSftJ89NCV3mcfj+Ek2umuzZ6VOtbZbhOHGWyfmMib YtiMOIGx+NHKYBrn/MqSnUrN0W7azt8FPoNfejhvL/bUhNcpD1IEcFPHMRFlyYzIZpLs Vj5g== X-Gm-Message-State: ALoCoQmn/r8EU34q9VCwNaQhcc6jPa+nZ7VN9zHmZG3qkhNPnF4K589I6oOEJ5o4gaH+ibThd1Xg X-Received: by 10.182.245.134 with SMTP id xo6mr19229954obc.40.1409662882161; Tue, 02 Sep 2014 06:01:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.17 with SMTP id 17ls2360537qgm.63.gmail; Tue, 02 Sep 2014 06:01:22 -0700 (PDT) X-Received: by 10.52.253.39 with SMTP id zx7mr19133326vdc.2.1409662882076; Tue, 02 Sep 2014 06:01:22 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id xe15si2194368vdc.85.2014.09.02.06.01.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Sep 2014 06:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so6896912vcb.19 for ; Tue, 02 Sep 2014 06:01:22 -0700 (PDT) X-Received: by 10.52.147.15 with SMTP id tg15mr123348vdb.53.1409662882006; Tue, 02 Sep 2014 06:01:22 -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.45.67 with SMTP id uj3csp523732vcb; Tue, 2 Sep 2014 06:01:21 -0700 (PDT) X-Received: by 10.194.93.7 with SMTP id cq7mr39989645wjb.58.1409662880805; Tue, 02 Sep 2014 06:01:20 -0700 (PDT) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx.google.com with ESMTPS id h5si15158729wiv.3.2014.09.02.06.01.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Sep 2014 06:01:19 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.52 as permitted sender) client-ip=74.125.82.52; Received: by mail-wg0-f52.google.com with SMTP id m15so6804599wgh.23 for ; Tue, 02 Sep 2014 06:01:19 -0700 (PDT) X-Received: by 10.194.47.208 with SMTP id f16mr2477050wjn.130.1409662879486; Tue, 02 Sep 2014 06:01:19 -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 ec2sm34928892wib.19.2014.09.02.06.01.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Sep 2014 06:01:18 -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 v11 02/19] arm: fiq: Allow ACK and EOI to be passed to the intc Date: Tue, 2 Sep 2014 14:00:36 +0100 Message-Id: <1409662853-29313-3-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1409662853-29313-1-git-send-email-daniel.thompson@linaro.org> References: <1408466769-20004-1-git-send-email-daniel.thompson@linaro.org> <1409662853-29313-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.174 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);