From patchwork Fri Jun 10 18:47:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Freyther X-Patchwork-Id: 871462 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5BBo64o025900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 11 Jun 2011 11:50:27 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QVMhS-0001nv-Ry; Sat, 11 Jun 2011 11:49:59 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QVMhS-0004T9-De; Sat, 11 Jun 2011 11:49:58 +0000 Received: from casper.infradead.org ([85.118.1.10]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QVLpO-0001xJ-0c for linux-arm-kernel@canuck.infradead.org; Sat, 11 Jun 2011 10:54:06 +0000 Received: from gandharva.secretlabs.de ([78.46.147.237]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QV6js-0000bY-NF for linux-arm-kernel@lists.infradead.org; Fri, 10 Jun 2011 18:47:25 +0000 Received: from [172.16.254.25] (unknown [213.167.137.242]) by gandharva.secretlabs.de (Postfix) with ESMTPA id E76471B10C0A; Fri, 10 Jun 2011 18:53:26 +0000 (UTC) Message-ID: <4DF266B6.6090303@selfish.org> Date: Fri, 10 Jun 2011 20:47:18 +0200 From: Holger Freyther User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Thomas Gleixner Subject: Re: TI-Davinci 6446 oops on interrupts References: <4DECCADE.6080100@selfish.org> <4DECD8C0.6010908@freyther.de> <4DECEDF9.4010202@selfish.org> In-Reply-To: X-Enigmail-Version: 1.1.1 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110610_194724_941538_7CB16F6A X-CRM114-Status: GOOD ( 23.78 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2-r929478 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=zecke%40selfish.org; ip=78.46.147.237; r=casper.infradead.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kevin Hilman , linux-arm-kernel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 11 Jun 2011 11:50:27 +0000 (UTC) On 06/06/2011 05:25 PM, Thomas Gleixner wrote: > On Mon, 6 Jun 2011, Holger Freyther wrote: >> On 06/06/2011 04:54 PM, Thomas Gleixner wrote: >> >> and both interrupts should be on REG1.. so for IRQ56 it looks like this method >> is entered with bogus data. Again, I have no idea about the underlying code, >> but could there be an issue with chained irq and the GC IRC code? > > Crap, yes. The code which does the chained handler setup overwrites > chip_data. Hi Thomas, I think the for loop above the one that was patched has the same kind of issue (changing the irq_chip_data)? One needs to have a dm365.c for this code to become active though. In general what do you think about a patch like the one below, it is at least boot tested on a qemu-system-i386. From 8db6d163de33f41d0d9118b8207b8bd1e13c262d Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 10 Jun 2011 20:38:43 +0200 Subject: [PATCH] irq: Check if someone is overwriting the irq chip data This tries to establish the semantic that one can either set the chip data to NULL or if it is NULL to some value but never overwrite a non NULL value. Signed-off-by: Holger Hans Peter Freyther --- kernel/irq/chip.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index d5a3009..25e446d 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -123,6 +123,10 @@ int irq_set_chip_data(unsigned int irq, void *data) if (!desc) return -EINVAL; + + BUG_ON(data && desc->irq_data.chip_data && + data != desc->irq_data.chip_data); + desc->irq_data.chip_data = data; irq_put_desc_unlock(desc, flags); return 0;