mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Alexander Gordeev <agordeev@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: io_apic: Move and reenable irq only when CONFIG_GENERIC_PENDING_IRQ=y
Date: Fri, 2 Mar 2012 10:40:01 +0100	[thread overview]
Message-ID: <20120302094001.GA462@elte.hu> (raw)
In-Reply-To: <20120302093034.GE8350@dhcp-26-207.brq.redhat.com>


* Alexander Gordeev <agordeev@redhat.com> wrote:

> When CONFIG_GENERIC_PENDING_IRQ=n irq move and reenable code is never get
> executed, nor do_unmask_irq variable updates its init value. Move both the
> code and do_unmask_irq under CONFIG_GENERIC_PENDING_IRQ macro.
> 
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  arch/x86/kernel/apic/io_apic.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> index fb07275..57dec14 100644
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -2515,8 +2515,11 @@ atomic_t irq_mis_count;
>  static void ack_apic_level(struct irq_data *data)
>  {
>  	struct irq_cfg *cfg = data->chip_data;
> -	int i, do_unmask_irq = 0, irq = data->irq;
> +	int i, irq = data->irq;
>  	unsigned long v;
> +#ifdef CONFIG_GENERIC_PENDING_IRQ
> +	int do_unmask_irq = 0;
> +#endif
>  
>  	irq_complete_move(cfg);
>  #ifdef CONFIG_GENERIC_PENDING_IRQ
> @@ -2581,6 +2584,7 @@ static void ack_apic_level(struct irq_data *data)
>  		eoi_ioapic_irq(irq, cfg);
>  	}
>  
> +#ifdef CONFIG_GENERIC_PENDING_IRQ
>  	/* Now we can move and renable the irq */
>  	if (unlikely(do_unmask_irq)) {
>  		/* Only migrate the irq if the ack has been received.
> @@ -2613,6 +2617,7 @@ static void ack_apic_level(struct irq_data *data)
>  			irq_move_masked_irq(data);
>  		unmask_ioapic(cfg);
>  	}
> +#endif

The two CONFIG_GENERIC_PENDING_IRQ blocks should be moved out 
into two helper inline functions right in front of 
ack_apic_level() so that we do not complicate ack_apic_level() 
with so many #ifdefs.

They'd have the form of:

	int masked = 0;

	masked = ioapic_irqd_mask(data, cfg);

	...

	ioapic_irqd_unmask(data, cfg, masked);

or so.

Thanks,

	Ingo

      reply	other threads:[~2012-03-02  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02  9:30 Alexander Gordeev
2012-03-02  9:40 ` Ingo Molnar [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=20120302094001.GA462@elte.hu \
    --to=mingo@elte.hu \
    --cc=agordeev@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®