From patchwork Mon Aug 18 13:40:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 35499 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C08F920676 for ; Mon, 18 Aug 2014 13:41:22 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf46458012pab.1 for ; Mon, 18 Aug 2014 06:41: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=Iy0jJSaFh4pbfAgeSd79O4eDtfjR/rDCVGisBuH2UJfNiJXEvGZXL3uHdtZBy+CC9p SVXWNfBDRsg71vOof67rLlewV+bKCqAiIRzb7oOuXAxPy7zNJvUK2HE3eWeSVAfMNkSu omyrDl0SJBK+QtatJVVT7Cey/saosuD2rKaOgYM+J73HrbSpJSUbsRXJPUO8uw0Q8O10 EFou5wSO4DSgKhZaoV00oRk9qgJ3wpYIBFbJsnDUkiXC/ZvawyXSCkR3eiP+1D4ATMdY pk8K5hdaokX6iGWb6CPLYY9G0TRkjXdUYQW2hLchshXfGZ1Ar421u2y7Hi1bNYE9FVy8 yAjQ== X-Gm-Message-State: ALoCoQkmuq6oNG9rouD/ZsVlPfuEwRZf08VoC/zEoKZAb9jIjN16Yict4NrADNo4cy13+MPQJuny X-Received: by 10.70.103.67 with SMTP id fu3mr18386682pdb.6.1408369282110; Mon, 18 Aug 2014 06:41:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.80 with SMTP id 74ls2377262qgs.63.gmail; Mon, 18 Aug 2014 06:41:21 -0700 (PDT) X-Received: by 10.220.194.130 with SMTP id dy2mr578064vcb.47.1408369281727; Mon, 18 Aug 2014 06:41:21 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id qa10si7125464vcb.103.2014.08.18.06.41.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 06:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so5779664vcb.29 for ; Mon, 18 Aug 2014 06:41:21 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr761909vca.45.1408369281654; Mon, 18 Aug 2014 06:41:21 -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 tc5csp153389vcb; Mon, 18 Aug 2014 06:41:21 -0700 (PDT) X-Received: by 10.180.105.6 with SMTP id gi6mr74545944wib.81.1408369280648; Mon, 18 Aug 2014 06:41:20 -0700 (PDT) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by mx.google.com with ESMTPS id bq13si15929851wib.81.2014.08.18.06.41.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 06:41:20 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.48 as permitted sender) client-ip=74.125.82.48; Received: by mail-wg0-f48.google.com with SMTP id x13so5025305wgg.7 for ; Mon, 18 Aug 2014 06:41:20 -0700 (PDT) X-Received: by 10.180.21.101 with SMTP id u5mr40838559wie.68.1408369280159; Mon, 18 Aug 2014 06:41:20 -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 y6sm6351438wia.0.2014.08.18.06.41.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Aug 2014 06:41:19 -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 v9 02/16] arm: fiq: Allow ACK and EOI to be passed to the intc Date: Mon, 18 Aug 2014 14:40:50 +0100 Message-Id: <1408369264-14242-3-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1408369264-14242-1-git-send-email-daniel.thompson@linaro.org> References: <1404979427-12943-1-git-send-email-daniel.thompson@linaro.org> <1408369264-14242-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.170 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);