From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH] gpio: omap: use raw locks for locking Date: Mon, 27 Jul 2015 14:50:53 +0200 Message-ID: References: <1437496011-11486-1-git-send-email-bigeasy@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-oi0-f50.google.com ([209.85.218.50]:35565 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751940AbbG0Mux (ORCPT ); Mon, 27 Jul 2015 08:50:53 -0400 Received: by oihq81 with SMTP id q81so50690149oih.2 for ; Mon, 27 Jul 2015 05:50:53 -0700 (PDT) In-Reply-To: <1437496011-11486-1-git-send-email-bigeasy@linutronix.de> Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Sebastian Andrzej Siewior Cc: Javier Martinez Canillas , "linux-gpio@vger.kernel.org" , Santosh Shilimkar , Tony Lindgren , ext Kevin Hilman , Alexandre Courbot , Linux-OMAP On Tue, Jul 21, 2015 at 6:26 PM, Sebastian Andrzej Siewior wrote: > This patch converts gpio_bank.lock from a spin_lock into a > raw_spin_lock. The call path is to access this lock is always under a > raw_spin_lock, for instance > - __setup_irq() holds &desc->lock with irq off > + __irq_set_trigger() > + omap_gpio_irq_type() > > - handle_level_irq() (runs with irqs off therefore raw locks) > + mask_ack_irq() > + omap_gpio_mask_irq() > > This fixes the obvious backtrace on -RT. However the locking vs context > is not and this is not limited to -RT: > - omap_gpio_irq_type() is called with IRQ off and has an conditional > call to pm_runtime_get_sync() which may sleep. Either it may happen or > it may not happen but pm_runtime_get_sync() should not be called with > irqs off. > > - omap_gpio_debounce() is holding the lock with IRQs off. > + omap2_set_gpio_debounce() > + clk_prepare_enable() > + clk_prepare() this one might sleep. > The number of users of gpiod_set_debounce() / gpio_set_debounce() > looks low but still this is not good. > > Acked-by: Javier Martinez Canillas > Acked-by: Santosh Shilimkar > Signed-off-by: Sebastian Andrzej Siewior Patch applied. Now this question appear in my head: Is drivers/gpio full of stuff that will not work with the -RT kernel, and is this a change that should be done mutatis mutandis on all the GPIO drivers? Yours, Linus Walleij