From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266899AbUHRPsj (ORCPT ); Wed, 18 Aug 2004 11:48:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266919AbUHRPsj (ORCPT ); Wed, 18 Aug 2004 11:48:39 -0400 Received: from cantor.suse.de ([195.135.220.2]:1414 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S266899AbUHRPsd (ORCPT ); Wed, 18 Aug 2004 11:48:33 -0400 Date: Wed, 18 Aug 2004 17:46:43 +0200 Message-ID: From: Takashi Iwai To: Thomas Charbonnel Cc: Ingo Molnar , Lee Revell , Florian Schmidt , linux-kernel , Felipe Alfaro Solana Subject: Re: [patch] voluntary-preempt-2.6.8.1-P2 In-Reply-To: <1092842775.7682.7.camel@localhost> References: <20040816023655.GA8746@elte.hu> <1092624221.867.118.camel@krustophenia.net> <20040816032806.GA11750@elte.hu> <20040816033623.GA12157@elte.hu> <1092627691.867.150.camel@krustophenia.net> <20040816034618.GA13063@elte.hu> <1092628493.810.3.camel@krustophenia.net> <20040816040515.GA13665@elte.hu> <1092654819.5057.18.camel@localhost> <20040816113131.GA30527@elte.hu> <20040816120933.GA4211@elte.hu> <1092831726.5777.160.camel@localhost> <1092842775.7682.7.camel@localhost> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 15) (Security Through Obscurity) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Wed, 18 Aug 2004 17:26:16 +0200, Thomas Charbonnel wrote: > > I was thinking more of something like this : > > --- irq.c.orig 2004-08-16 14:26:34.000000000 +0200 > +++ irq.c 2004-08-18 17:23:18.011059064 +0200 > @@ -955,11 +955,16 @@ > return -EBUSY; > } > > - /* add new interrupt at end of irq queue */ > - do { > - p = &old->next; > - old = *p; > - } while (old); > + if (new->flags & SA_INTERRUPT) > + /* add interrupt at the start of the queue */ > + new->next = old; > + else > + /* add new interrupt at end of irq queue */ > + do { > + p = &old->next; > + old = *p; > + } while (old); > + > shared = 1; > } Ok, how about this one? Together with your patch, the irq is turned on for handlers without SA_INTERRUPT. Takashi --- linux/arch/i386/kernel/irq.c 2004-08-18 15:15:18.000000000 +0200 +++ linux/arch/i386/kernel/irq.c 2004-08-18 17:42:57.454819403 +0200 @@ -219,15 +219,23 @@ inline void synchronize_irq(unsigned int asmlinkage int handle_IRQ_event(unsigned int irq, struct pt_regs *regs, struct irqaction *action) { - int status = 1; /* Force the "do bottom halves" bit */ - int retval = 0; - - if (!(action->flags & SA_INTERRUPT)) - local_irq_enable(); + int status; + int ret, retval = 0; + int irq_off = 1; + status = 0; do { - status |= action->flags; - retval |= action->handler(irq, action->dev_id, regs); + /* Assume that all SA_INTERRUPT handlers are at the head + * of the irq queue + */ + if (irq_off && ! (action->flags & SA_INTERRUPT)) { + local_irq_enable(); + irq_off = 0; + } + ret = action->handler(irq, action->dev_id, regs); + if (ret) + status |= action->flags; + retval |= ret; action = action->next; } while (action); if (status & SA_SAMPLE_RANDOM) @@ -955,11 +963,16 @@ int setup_irq(unsigned int irq, struct i return -EBUSY; } - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); + if (new->flags & SA_INTERRUPT) + /* add interrupt at the start of the queue */ + new->next = old; + else + /* add new interrupt at end of irq queue */ + do { + p = &old->next; + old = *p; + } while (old); + shared = 1; }