From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934798AbaFTIFZ (ORCPT ); Fri, 20 Jun 2014 04:05:25 -0400 Received: from www.linutronix.de ([62.245.132.108]:57344 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933971AbaFTIFU (ORCPT ); Fri, 20 Jun 2014 04:05:20 -0400 Date: Fri, 20 Jun 2014 10:05:16 +0200 (CEST) From: Thomas Gleixner To: Viresh Kumar cc: LKML , Jason Cooper , Shiraz Hashim , spear-devel Subject: Re: [patch 13/13] irqchip: spear_shirq: Simplify register access code In-Reply-To: Message-ID: References: <20140619212606.431750473@linutronix.de> <20140619212713.923306179@linutronix.de> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Jun 2014, Viresh Kumar wrote: > On Fri, Jun 20, 2014 at 3:04 AM, Thomas Gleixner wrote: > > > Index: linux/drivers/irqchip/spear-shirq.c > > -struct shirq_regs { > > - u32 enb_reg; > > - u32 reset_to_enb; > > I don't see something similar to 'reset_to_enb' is added again. > AFAICT, this field is being used by two blocks: > > spear300_shirq_ras1: writes 0 to this. i.e. we need to write 0 to > mask the interrupt > > and > > spear320_shirq_ras3: writes 1 to this. i.e. we need to write 1 to > mask the interrupt. AGAIN: spear320_shirq_ras3 is never instantiated as a chained irq. So the chip for these interrupts is never set. And if it ever is, you need a separate irq chip for it and not some conditional hackery. > And so the new code you have added breaks it for SPEAr300 ? +static void shirq_irq_mask(struct irq_data *d) +{ + struct spear_shirq *shirq = irq_data_get_irq_chip_data(d); + u32 val, shift = d->irq - shirq->virq_base + shirq->offset; + u32 __iomem *reg = shirq->base + shirq->regs.enb_reg; + + raw_spin_lock(&shirq_lock); + val = readl(reg) & ~(0x1 << shift); + writel(val, reg); + raw_spin_unlock(&shirq_lock); +} That's the mask function for 300 and it clears the bit, right? Thanks, tglx