Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1534543

Re: [PATCH] acpi/rt: convert acpi_gbl_gpe_lock to raw spinlock

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] acpi/rt: convert acpi_gbl_gpe_lock to raw spinlock
Date 2016-12-02 00:30 +0100
Message-ID <sJIXD-3Tw-13@gated-at.bofh.it> (permalink)
References <sJjcS-1U1-25@gated-at.bofh.it> <sJB05-5a9-7@gated-at.bofh.it> <sJINX-3Qs-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 1 Dec 2016, Aaron Sierra wrote:
> ----- Original Message -----
> > From: "Thomas Gleixner" <tglx@linutronix.de>
> > Sent: Thursday, December 1, 2016 8:52:48 AM
> 
> > On Wed, 30 Nov 2016, Aaron Sierra wrote:
> >> When testing GPE interrupts with CONFIG_PREEMPT_RT_FULL enabled, a
> >> verbose WARN_ONCE message would print to the kernel log. It turned out
> >> that the GPE interrupt handler was being called with local interrupts
> >> enabled because acpi_gbl_gpe_lock was implemented as a spinlock_t. Full
> >> preemption strips local interrupt disabling from spinlock_t operations,
> >> but not for raw_spinlock_t operations.
> >> 
> >> This is the warning that was triggered:
> >> 
> >> ------------[ cut here ]------------
> >> WARNING: CPU: 8 PID: 483 at kernel/irq/handle.c:149
> >> __handle_irq_event_percpu+0x6f/0xcf
> >> irq 33 handler irq_default_primary_handler+0x0/0xb enabled interrupts
> >> Modules linked in: gpio_irq_demo(O)
> >> CPU: 8 PID: 483 Comm: irq/9-acpi Tainted: G           O
> >> 4.8.6-rt5-00012-geaa3b7c #6
> >> Hardware name: Extreme Engineering Solutions, Inc. XCalibur4643/XCalibur4643,
> >> BIOS 1-1.1.12.3_Alpha 04/29/2016
> >>  0000000000000000 ffff880858f3bc10 ffffffff81219a93 ffff880858f3bc60
> >>  0000000000000000 ffff880858f3bc50 ffffffff8104b84a 0000009500000000
> >>  ffff880855b76880 0000000000000021 0000000000000002 ffff880856356800
> >> Call Trace:
> >>  [<ffffffff81219a93>] dump_stack+0x4d/0x63
> >>  [<ffffffff8104b84a>] __warn+0xc0/0xdb
> >>  [<ffffffff8104b8af>] warn_slowpath_fmt+0x4a/0x4c
> >>  [<ffffffff810f7192>] ? path_openat+0xbf8/0xc62
> >>  [<ffffffff8107d7c3>] ? handle_irq_event+0x75/0x75
> >>  [<ffffffff8107d68d>] __handle_irq_event_percpu+0x6f/0xcf
> >>  [<ffffffff8107d727>] handle_irq_event_percpu+0x3a/0x61
> >>  [<ffffffff8107d7a3>] handle_irq_event+0x55/0x75
> >>  [<ffffffff8107ff76>] handle_simple_irq+0x5c/0x92
> >>  [<ffffffff81243a53>] gpe_irq_handler+0x2a/0x31
> > 
> > gpe_irq_handler is not in tree, so I really cannot tell what this is
> > about. It looks like it does interrupt demultiplexing, which triggers the
> > warning.
> 
> Thomas,
> Your guess is correct, this involves a currently out-of-tree extension to
> the gpio-ich driver which allows GPIO pins to be mapped to IRQs by demuxing
> their corresponding GPE events.
> The gpio_irq_demo module requests a GPIO pin, converts it to an IRQ using
> gpio_to_irq() and registers a trivial handler against the IRQ.

So the simple solution is in the demux handler:

 gpe_irq_handler()
 {
+	local_irq_save(flags);

	for_each_pending_gpio_irq(irq)
		generic_handle_irq(irq);

+	local_irq_restore(flags);
 }

Thanks,

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] acpi/rt: convert acpi_gbl_gpe_lock to raw spinlock Aaron Sierra <asierra@xes-inc.com> - 2016-11-30 21:00 +0100
  Re: [PATCH] acpi/rt: convert acpi_gbl_gpe_lock to raw spinlock Thomas Gleixner <tglx@linutronix.de> - 2016-12-01 16:00 +0100
    Re: [PATCH] acpi/rt: convert acpi_gbl_gpe_lock to raw spinlock Aaron Sierra <asierra@xes-inc.com> - 2016-12-02 00:20 +0100
      Re: [PATCH] acpi/rt: convert acpi_gbl_gpe_lock to raw spinlock Thomas Gleixner <tglx@linutronix.de> - 2016-12-02 00:30 +0100
        Re: [PATCH] acpi/rt: convert acpi_gbl_gpe_lock to raw spinlock Aaron Sierra <asierra@xes-inc.com> - 2016-12-02 18:10 +0100
      Re: [PATCH] acpi/rt: convert acpi_gbl_gpe_lock to raw spinlock "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-12-02 00:40 +0100
        Re: [PATCH] acpi/rt: convert acpi_gbl_gpe_lock to raw spinlock Aaron Sierra <asierra@xes-inc.com> - 2016-12-02 18:20 +0100

csiph-web