All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Yinghai Lu <yinghai@kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Can request_irq be called under spinlock?
Date: Fri, 13 Feb 2009 10:52:31 +0100	[thread overview]
Message-ID: <20090213095231.GD17774@elte.hu> (raw)
In-Reply-To: <20090213033803.GA13631@cmpxchg.org>


* Johannes Weiner <hannes@cmpxchg.org> wrote:

> From: Johannes Weiner <hannes@cmpxchg.org>
> Subject: irq: use GFP_KERNEL for action allocation in request_irq()
> 
> request_irq() calls into proc code via __setup_irq() which is not safe
> in an atomic context, so request_irq() can itself use the more
> reliable GFP_KERNEL allocation for the action descriptor.
> 
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> ---
> 
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 291f036..0f2b3b6 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -709,7 +709,7 @@ int request_irq(unsigned int irq, irq_handler_t handler,
>  	if (!handler)
>  		return -EINVAL;
>  
> -	action = kmalloc(sizeof(struct irqaction), GFP_ATOMIC);
> +	action = kmalloc(sizeof(struct irqaction), GFP_KERNEL);
>  	if (!action)
>  		return -ENOMEM;

Good catch - applied to tip:irq/genirq, thanks Johannes!

	Ingo

  reply	other threads:[~2009-02-13  9:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-12 20:08 Can request_irq be called under spinlock? Jeremy Fitzhardinge
2009-02-12 22:28 ` Thomas Gleixner
2009-02-12 23:35   ` Jeremy Fitzhardinge
2009-02-13  3:38     ` Johannes Weiner
2009-02-13  9:52       ` Ingo Molnar [this message]
2009-02-13  9:23     ` Thomas Gleixner

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=20090213095231.GD17774@elte.hu \
    --to=mingo@elte.hu \
    --cc=hannes@cmpxchg.org \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.