From: Takashi Iwai <tiwai@suse.de>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, thomas@undata.org
Subject: Re: [PATCH] Fix shared interrupt handling of SA_INTERRUPT and SA_SAMPLE_RANDOM
Date: Thu, 26 Aug 2004 16:27:00 +0200 [thread overview]
Message-ID: <s5hpt5ekma3.wl@alsa2.suse.de> (raw)
In-Reply-To: <20040826151832.G21364@flint.arm.linux.org.uk>
At Thu, 26 Aug 2004 15:18:32 +0100,
Russell King wrote:
>
> On Thu, Aug 26, 2004 at 04:10:54PM +0200, Takashi Iwai wrote:
> > At Thu, 26 Aug 2004 15:04:04 +0100,
> > Russell King wrote:
> > >
> > > On Thu, Aug 26, 2004 at 02:50:52PM +0200, Takashi Iwai wrote:
> > > > At Wed, 25 Aug 2004 13:41:12 -0700,
> > > > Andrew Morton wrote:
> > > > >
> > > > > Takashi Iwai <tiwai@suse.de> wrote:
> > > > > >
> > > > > > Anyway, suppressing the unnecessary call of add_interrupt_randomness()
> > > > > > should be still valid. The reduced patch is below.
> > > > (snip)
> > > > >
> > > > > Shouldn't that be `if (ret == IRQ_HANDLED)'?
> > > >
> > > > Yes, it's more strict.
> > >
> > > I don't think so. Look at what's going on. If "ret" is IRQ_HANDLED
> > > all well and fine. However, look at how "retval" is being used:
> > >
> > > static void __report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret)
> > > {
> > > ...
> > > if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) {
> > > printk(KERN_ERR "irq event %d: bogus return value %x\n",
> > > irq, action_ret);
> > > } else {
> > > printk(KERN_ERR "irq %d: nobody cared!\n", irq);
> > > }
> > >
> > > So, we're looking to see not only if a handler returned IRQ_HANDLED,
> > > but also if a handler returned _some other value_ other than IRQ_HANDLED
> > > or IRQ_NONE.
> >
> > But obviously any other value is invalid as shown above, so we
> > shouldn't take it seriously as the correct return value for
> > triggering add_random_interrupt().
>
> Point is: you're killing the method for detecting when IRQ handlers
> return bogus return codes since you only look at them when they
> respond with IRQ_HANDLED.
>
> So, you're disabling the "bogus return value" check. Completely.
No, the return value from handle_IRQ_event won't be changed at all by
my patch.
asmlinkage int handle_IRQ_event(unsigned int irq, ...
{
...
do {
ret = action->handler(irq, action->dev_id, regs);
==> if (ret == IRQ_HANDLED)
==> status |= action->flags;
==> retval |= ret;
action = action->next;
} while (action);
if (status & SA_SAMPLE_RANDOM)
add_interrupt_randomness(irq);
local_irq_disable();
return retval;
}
The patch adds the additional check for another variable 'status'
which is used only for checking SA_SAMPLE_RANDOM.
Takashi
prev parent reply other threads:[~2004-08-26 14:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-23 17:10 [PATCH] Fix shared interrupt handling of SA_INTERRUPT and SA_SAMPLE_RANDOM Takashi Iwai
2004-08-23 17:29 ` Takashi Iwai
2004-08-23 18:09 ` Zwane Mwaikambo
2004-08-25 3:45 ` Andrew Morton
2004-08-25 11:17 ` Takashi Iwai
2004-08-25 20:41 ` Andrew Morton
2004-08-26 12:50 ` Takashi Iwai
2004-08-26 14:04 ` Russell King
2004-08-26 14:10 ` Takashi Iwai
2004-08-26 14:18 ` Russell King
2004-08-26 14:27 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hpt5ekma3.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=thomas@undata.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox