Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/277/?format=api
{ "id": 277, "url": "http://patchwork.ozlabs.org/api/patches/277/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20080915100406.342e027a@bull.net/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20080915100406.342e027a@bull.net>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20080915100406.342e027a@bull.net/", "date": "2008-09-15T08:04:06", "name": "powerpc: quick hack to get a functional eHEA with hardirq preemption", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "c7b407f68dd508a0714dfd0cd36b9eb0b22869b9", "submitter": { "id": 101, "url": "http://patchwork.ozlabs.org/api/people/101/?format=api", "name": "Sebastien Dugue", "email": "sebastien.dugue@bull.net" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20080915100406.342e027a@bull.net/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/277/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/277/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org>", "X-Original-To": [ "patchwork@ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Delivered-To": [ "patchwork@ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Received": [ "from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id 4AD46DE423\n\tfor <patchwork@ozlabs.org>; Mon, 15 Sep 2008 18:04:42 +1000 (EST)", "from ecfrec.frec.bull.fr (ecfrec.frec.bull.fr [129.183.4.8])\n\tby ozlabs.org (Postfix) with ESMTP id C5254DE23C\n\tfor <linuxppc-dev@ozlabs.org>; Mon, 15 Sep 2008 18:04:16 +1000 (EST)", "from localhost (localhost [127.0.0.1])\n\tby ecfrec.frec.bull.fr (Postfix) with ESMTP\n\tid 936E01A1CFB; Mon, 15 Sep 2008 10:04:09 +0200 (CEST)", "from ecfrec.frec.bull.fr ([127.0.0.1])\n\tby localhost (ecfrec.frec.bull.fr [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id 05971-07; Mon, 15 Sep 2008 10:04:06 +0200 (CEST)", "from cyclope.frec.bull.fr (cyclope.frec.bull.fr [129.183.4.9])\n\tby ecfrec.frec.bull.fr (Postfix) with ESMTP\n\tid 8EC991A1CEF; Mon, 15 Sep 2008 10:04:06 +0200 (CEST)", "from localhost (frecb000686.frec.bull.fr [129.183.101.139])\n\tby cyclope.frec.bull.fr (Postfix) with ESMTP id 3D9DC2728D;\n\tMon, 15 Sep 2008 10:04:04 +0200 (CEST)" ], "Date": "Mon, 15 Sep 2008 10:04:06 +0200", "From": "Sebastien Dugue <sebastien.dugue@bull.net>", "Subject": "[PATCH HACK] powerpc: quick hack to get a functional eHEA with\n\thardirq preemption", "Message-ID": "<20080915100406.342e027a@bull.net>", "X-Mailer": "Claws Mail 3.2.0 (GTK+ 2.12.2; i486-pc-linux-gnu)", "Mime-Version": "1.0", "X-Virus-Scanned": "by amavisd-new at frec.bull.fr", "Cc": "tklein@de.ibm.com, tinytim@us.ibm.com,\n\tLinux-rt <linux-rt-users@vger.kernel.org>, themann@de.ibm.com,\n\tnetdev@vger.kernel.org, linux-kernel <linux-kernel@vger.kernel.org>, \n\tjean-pierre.dion@bull.net, linux-ppc <linuxppc-dev@ozlabs.org>,\n\traisch@de.ibm.com, gilles.carry@ext.bull.net", "X-BeenThere": "linuxppc-dev@ozlabs.org", "X-Mailman-Version": "2.1.11", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>", "List-Unsubscribe": "<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://ozlabs.org/pipermail/linuxppc-dev>", "List-Post": "<mailto:linuxppc-dev@ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@ozlabs.org?subject=help>", "List-Subscribe": "<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org", "Errors-To": "linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org" }, "content": "WARNING: HACK - HACK - HACK\n\n Under the RT kernel (with hardirq preemption) the eHEA driver hangs right\nafter booting. Fiddling with the hardirqs and softirqs priorities allows to\nrun a bit longer but as soon as the network gets under load, the hang\nreturns. After investigating, it appears that the driver is loosing interrupts.\n\n To make a long story short, looking at the code, it appears that the XICS\nmaps all its interrupts to level sensitive interrupts (I don't know if it's the\nreality or if it's due to an incomplete implementation - no datasheets\navailable to check) and use the fasteoi processing flow.\n\n When entering the low level handler, level sensitive interrupts are masked,\nthen eio'd in interrupt context and then unmasked at the end of hardirq\nprocessing.\nThat's fine as any interrupt comming in-between will still be processed since\nthe kernel replays those pending interrupts.\n\n However, it appears that the eHEA interrupts are behaving as edge sensitive\ninterrupts and are routed through the XICS which process those as level\nsensitive using the fasteoi handler __OR__ the XICS loses interrupts when they\nare masked.\n\n Therefore the masking done in the handler causes any interrupt happening while\nin the handler to be lost.\n\n So this patch maps the interrupts being requested through\nibmebus_request_irq() as edge sensitive interrupts (this concerns both the eHEA\nand the eHCA - only users of ibmebus_request_irq()) and changes the way edge\ninterrupts are processed by the fasteoi handler.\n\n It works for the eHEA, dunno for the eHCA.\n\n So, unless all the designers of the XICS & eHEA have been shot to keep it\na secret, could someone knowledgeable shed some light on this issue.\n\n Thanks,\n\n Sebastien.\n\nNot-Signed-off-by: Sebastien Dugue <sebastien.dugue@bull.net>", "diff": "diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c\nindex 9971159..5200323 100644\n--- a/arch/powerpc/kernel/ibmebus.c\n+++ b/arch/powerpc/kernel/ibmebus.c\n@@ -41,6 +41,7 @@\n #include <linux/kobject.h>\n #include <linux/dma-mapping.h>\n #include <linux/interrupt.h>\n+#include <linux/irq.h>\n #include <linux/of.h>\n #include <linux/of_platform.h>\n #include <asm/ibmebus.h>\n@@ -213,11 +214,19 @@ int ibmebus_request_irq(u32 ist, irq_handler_t handler,\n \t\t\tvoid *dev_id)\n {\n \tunsigned int irq = irq_create_mapping(NULL, ist);\n+\tstruct irq_desc *desc;\n+\tint ret;\n \n \tif (irq == NO_IRQ)\n \t\treturn -EINVAL;\n \n-\treturn request_irq(irq, handler, irq_flags, devname, dev_id);\n+\tret = request_irq(irq, handler, irq_flags, devname, dev_id);\n+\n+\tdesc = irq_desc + irq;\n+\tdesc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);\n+\tdesc->status |= IRQ_TYPE_EDGE_RISING;\n+\n+\treturn ret;\n }\n EXPORT_SYMBOL(ibmebus_request_irq);\n \ndiff --git a/kernel/irq/chip.c b/kernel/irq/chip.c\nindex b7b397a..6d366ca 100644\n--- a/kernel/irq/chip.c\n+++ b/kernel/irq/chip.c\n@@ -430,7 +430,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)\n \taction = desc->action;\n \tif (unlikely(!action || (desc->status & (IRQ_INPROGRESS |\n \t\t\t\t\t\t IRQ_DISABLED)))) {\n-\t\tdesc->status |= IRQ_PENDING;\n+\t\tdesc->status |= IRQ_PENDING | IRQ_MASKED;\n \t\tif (desc->chip->mask)\n \t\t\tdesc->chip->mask(irq);\n \t\tgoto out;\n@@ -439,9 +439,10 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)\n \tdesc->status |= IRQ_INPROGRESS;\n \t/*\n \t * In the threaded case we fall back to a mask+eoi sequence:\n+\t * excepted for edge interrupts which are not masked.\n \t */\n \tif (redirect_hardirq(desc)) {\n-\t\tif (desc->chip->mask)\n+\t\tif (desc->chip->mask && !(desc->status & IRQ_TYPE_EDGE_BOTH))\n \t\t\tdesc->chip->mask(irq);\n \t\tgoto out;\n \t}\ndiff --git a/kernel/irq/manage.c b/kernel/irq/manage.c\nindex 3bffa20..3e39c71 100644\n--- a/kernel/irq/manage.c\n+++ b/kernel/irq/manage.c\n@@ -788,9 +788,12 @@ static void do_hardirq(struct irq_desc *desc)\n \t\tthread_simple_irq(desc);\n \telse if (desc->handle_irq == handle_level_irq)\n \t\tthread_level_irq(desc);\n-\telse if (desc->handle_irq == handle_fasteoi_irq)\n-\t\tthread_fasteoi_irq(desc);\n-\telse if (desc->handle_irq == handle_edge_irq)\n+\telse if (desc->handle_irq == handle_fasteoi_irq) {\n+\t\tif (desc->status & IRQ_TYPE_EDGE_BOTH)\n+\t\t\tthread_edge_irq(desc);\n+\t\telse\n+\t\t\tthread_fasteoi_irq(desc);\n+\t} else if (desc->handle_irq == handle_edge_irq)\n \t\tthread_edge_irq(desc);\n \telse\n \t\tthread_do_irq(desc);\n", "prefixes": [] }