Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753951AbXKZNpn (ORCPT ); Mon, 26 Nov 2007 08:45:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753280AbXKZNpe (ORCPT ); Mon, 26 Nov 2007 08:45:34 -0500 Received: from py-out-1112.google.com ([64.233.166.179]:31264 "EHLO py-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752882AbXKZNpd (ORCPT ); Mon, 26 Nov 2007 08:45:33 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=B1peXdHcoU9+Gd39olfTkTZodf3mLESJOmykLE49pzqfAvbBPBHE9niC8K5J+rrGZG+4J4btif5ALhJXgD3jyZDueGKbQAbN/0K8HYUAo9otkjwnO2XbIBSqpbXbUoXGez9+b1Wc6BYYt5i/o+uDiH7VA6NOLWbl+T0siyIP4R4= Message-ID: <3efb10970711260545i419a8352o4ca5248b10d81db5@mail.gmail.com> Date: Mon, 26 Nov 2007 14:45:32 +0100 From: "Remy Bohmer" To: "Ingo Molnar" , "Steven Rostedt" Subject: Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling can/will stall forever Cc: "ARM Linux Mailing List" , RT , linux-kernel In-Reply-To: <3efb10970711260531x5e9f05acgfabdfa885a220192@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_5441_21490065.1196084732436" References: <3efb10970711260531x5e9f05acgfabdfa885a220192@mail.gmail.com> X-Google-Sender-Auth: 1c43e0f779acb7a4 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5732 Lines: 101 ------=_Part_5441_21490065.1196084732436 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Attached the same patch, but it also cleans the manage.c code a bit, because the IRQ types 'simple IRQ', 'level-IRQ' and 'FastEOI' were handled differently while they should be handled the same. Kind Regards, Remy 2007/11/26, Remy Bohmer : > Hello, > > I use 2.6.23.1-rt5 on the Atmel AT91 series. > Interrupt threading on Preempt-RT and ARM works fine, except for > (edge-triggered) GPIO interrupts. There is a problem when a new > interrupt arives while the interrupt thread is handling the previous > interrupt. If this occurs the interrupt handling stalls forever. > > This is caused by a unbalanced interrupt mask/unmask problem in the kernel. > The attached patch fixes this. More information about this problem is > documented inside the patch itself. > > This patch is meant for Preempt-RT only. > > Kind Regards, > > Remy Bohmer > > ------=_Part_5441_21490065.1196084732436 Content-Type: text/x-patch; name=fix-gpio-irq-stalling-bug.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_f9h1zef7 Content-Disposition: attachment; filename=fix-gpio-irq-stalling-bug.patch T24gQVJNIHRoZXJlIGlzIGEgcHJvYmxlbSB3aGVyZSB0aGUgaW50ZXJydXB0IGhhbmRsZXIgc3Rh bGxzIHdoZW4gdGhleSBhcmUgCmNvbWluZyBmYXN0ZXIgdGhhbiB0aGUga2VybmVsIGNhbiBoYW5k bGUuCgpUaGUgcHJvYmxlbSBvY2N1cnMgd2hlbiB0aGUgcm91dGluZSBoYW5kbGVfc2ltcGxlX2ly cSgpIG1hc2tzIHRoZSBpbnRlcnJ1cHQgCndoZW4gYW4gSVJRLXRocmVhZCBpcyBoYW5kbGluZyB0 aGUgaW50ZXJydXB0IGF0IHRoZSBzYW1lIHRpbWUuIChJUlFfSU5QUk9HUkVTUwppcyBzZXQpLiBU aGUgaW50ZXJydXB0IHRocmVhZCwgaG93ZXZlciBkb2VzICoqbmV2ZXIqKiBhIApkZXNjLT5jaGlw LT51bm1hc2soKSwgc28gdGhlIGludGVycnVwdCBiZWNvbWVzIGRpc2FibGVkIGZvcmV2ZXIuCgpJ UlFfRElTQUJMRUQgaXMgdXN1YWxseSBub3Qgc2V0IGZvciB0aGlzIGludGVycnVwdAoKVGhpcyBp cyBpbiBrZ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WxzZSBpZiAoZGVzYy0+aGFuZGxlX2lycSA9PSBoYW5kbGVfbGV2ZWxf aXJxKQotCQl0aHJlYWRfbGV2ZWxfaXJxKGRlc2MpOwotCWVsc2UgaWYgKGRlc2MtPmhhbmRsZV9p cnEgPT0gaGFuZGxlX2Zhc3Rlb2lfaXJxKQotCQl0aHJlYWRfZmFzdGVvaV9pcnEoZGVzYyk7CiAJ ZWxzZSBpZiAoZGVzYy0+aGFuZGxlX2lycSA9PSBoYW5kbGVfZWRnZV9pcnEpCiAJCXRocmVhZF9l ZGdlX2lycShkZXNjKTsKIAllbHNlCg== ------=_Part_5441_21490065.1196084732436-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/