Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbdFGMIy (ORCPT ); Wed, 7 Jun 2017 08:08:54 -0400 Received: from mout.web.de ([212.227.15.4]:52180 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751694AbdFGMIv (ORCPT ); Wed, 7 Jun 2017 08:08:51 -0400 From: Alexander Stein To: linux-kernel@vger.kernel.org Cc: Phil Elwell , Mark Rutland , Rob Herring , Stephen Boyd , Florian Fainelli , Eric Anholt , Stefan Wahren , devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org Subject: Re: [PATCH 1/2] clk: bcm2835: Add AUX interrupt controller Date: Wed, 07 Jun 2017 14:07:32 +0200 Message-ID: <3148562.tSrsoIclEp@ws-stein> User-Agent: KMail/4.14.10 (Linux/4.11.3-gentoo; KDE/4.14.32; x86_64; ; ) In-Reply-To: <79d4534c-49fe-3af4-13d8-2aaf22120d43@raspberrypi.org> References: <79d4534c-49fe-3af4-13d8-2aaf22120d43@raspberrypi.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:LgAupxlwF2OdFyIWYb3h9b6+a00KZyDC2Dv5vC7+3wGSoRJc7CI wXW4JmO3KxcqcFX3xNmedKka4W3Rs7exMrgTE6Asgz7BhZw/e28l/VMLYSvsDVQAMHsC97T NDJwKDFjgklhOgmE7L3Xu3C/BKUSoqZRc6vEmtDOw3EbTRmCvlwayyCmy0mH+vJZ42Onbmr UP0N1r4Yofk2hTmT4077A== X-UI-Out-Filterresults: notjunk:1;V01:K0:AfjCOfnNGEM=:JhNp3XsxEOM/v5fHJYPzoT /bodu0Hy3UR+R+cZtonLPbExbaLjcomkTkSSyocuCs9bmRaGOo3XUEq6IdFZmNybrZ+yDrCAD gsQgCPUpLo9lhIxwI3mModyoX5U3rvmFSUUafNJAuPw8b2ao6Q+MC0h22U+zLQGH8Ii9f8IY3 rTDR6kaN/dyUc/DtJCc6Hk6memOAialrYucREfrBftrKF2wlmz6lPjBVsShkWKIateIICHE+R ENOb3+NBL3vs5vGr9lftoq87QuHf/MKVxo4GVDr3ATxKVkhaATTkSUQ9BRxlXnTMIkBFQ+YxL TsveoQpPwC0l1GQQuvVT/gf/hJIfkXyZDbKuXh0vqrjF/zdi7ULELVSF+mJsEifDL6FVAc3o9 v8zMFc1s7CC1/o8+pWbBDdD39VVWpoqkql+Z3JFN1K5StrHhuiwgd9MPJ0peRSyjBJ7K8xUyn 2Ieo1P8+5JC+JTXyARAtA2MGBTC3Wt//GfA0j7Jj1EUYQTs4s5LxU6R+gGF9HQksD8PIhVOvg K6TE9XhkMHeFjn1Zg3GK7ev+JUGMhupKu4Mmsr86h9uMMk7SmI1c0lSkt8sj8v3HnV+qrHLan ZSgxGbYZrXw9gg5cg3j0cC/Qha9NoRfddUBkJQpFgQhf3XjuU4Xhr7kIFeoowZVdnyYYE/UiH NBSNtgKvTeAp4Uuwuk5Jg3KhqVWxSYD1BTHuWBJZKpUacAAi11M17qczh9T5HDy/F7BN+Qe+H xQ6fFie1Qeqki+/Yz055PWJmQEleBNmOYTAgOh/P9UlG1QTSGNNzxil+0npz65UEX3AJ73LkZ u5wJ/li Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1881 Lines: 53 On Wednesday 07 June 2017 12:11:45, Phil Elwell wrote: > Devices in the AUX block share a common interrupt line, with a register > indicating which devices have active IRQs. Expose this as a nested > interrupt controller to avoid IRQ sharing problems (easily observed if > UART1 and SPI1/2 are enabled simultaneously). > > Signed-off-by: Phil Elwell > --- > drivers/clk/bcm/clk-bcm2835-aux.c | 120 > ++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) > > diff --git a/drivers/clk/bcm/clk-bcm2835-aux.c > b/drivers/clk/bcm/clk-bcm2835-aux.c index bd750cf..41e0702 100644 > --- a/drivers/clk/bcm/clk-bcm2835-aux.c > +++ b/drivers/clk/bcm/clk-bcm2835-aux.c > [...] > +struct auxirq_state { > + void __iomem *status; > + u32 enables; > + struct irq_domain *domain; > + struct regmap *local_regmap; > +}; > + > +static struct auxirq_state auxirq __read_mostly; > + > +static irqreturn_t bcm2835_auxirq_handler(int irq, void *dev_id) > +{ > + u32 stat = readl_relaxed(auxirq.status); > + u32 masked = stat & auxirq.enables; Doesn't this hide any spurious interrupts? Is this acceptable? I mean getting informed about spurious interrupts seems nice to me, as it indicates a hardware/configuration problem. > + if (masked & BCM2835_AUXIRQ_UART_MASK) > + generic_handle_irq(irq_linear_revmap(auxirq.domain, > + BCM2835_AUXIRQ_UART_IRQ)); > + > + if (masked & BCM2835_AUXIRQ_SPI1_MASK) > + generic_handle_irq(irq_linear_revmap(auxirq.domain, > + BCM2835_AUXIRQ_SPI1_IRQ)); > + > + if (masked & BCM2835_AUXIRQ_SPI2_MASK) > + generic_handle_irq(irq_linear_revmap(auxirq.domain, > + BCM2835_AUXIRQ_SPI2_IRQ)); > + > + return (masked & BCM2835_AUXIRQ_ALL_MASK) ? IRQ_HANDLED : IRQ_NONE; > +} How does interrupt acknowledgement work in these 3 interrupts work? Best regards, Alexander