lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 26 Aug 2015 09:28:48 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] pinctrl: cherryview: Use raw_spinlock for locking

On Mon, Aug 17, 2015 at 3:13 PM, Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:

> When running -rt kernel and an interrupt happens on a GPIO line controlled by
> Intel Cherryview/Braswell pinctrl driver we get:
>
>  BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:917
>  in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/0
>  Preemption disabled at:[<ffffffff81092e9f>] cpu_startup_entry+0x17f/0x480
>
>  CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.5-rt5 #16
>   ...
>  Call Trace:
>   <IRQ>  [<ffffffff816283c6>] dump_stack+0x4a/0x61
>   [<ffffffff81077e17>] ___might_sleep+0xe7/0x170
>   [<ffffffff8162d6cf>] rt_spin_lock+0x1f/0x50
>   [<ffffffff812e52ed>] chv_gpio_irq_ack+0x3d/0xa0
>   [<ffffffff810a72f5>] handle_edge_irq+0x75/0x180
>   [<ffffffff810a3457>] generic_handle_irq+0x27/0x40
>   [<ffffffff812e57de>] chv_gpio_irq_handler+0x7e/0x110
>   [<ffffffff810050aa>] handle_irq+0xaa/0x190
>   ...
>
> This is because desc->lock is raw_spinlock and is held when chv_gpio_irq_ack()
> is called by the genirq core. chv_gpio_irq_ack() in turn takes pctrl->lock
> which in -rt is an rt-mutex causing might_sleep() rightfully to complain about
> sleeping function called from invalid context.
>
> In order to keep -rt happy but at the same time make sure that register
> accesses get serialized, convert the driver to use raw_spinlock instead.
>
> Suggested-by: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>

Patch applied. Again splendid job here.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ