Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756577AbbHZHwG (ORCPT ); Wed, 26 Aug 2015 03:52:06 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:33746 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756056AbbHZHwE (ORCPT ); Wed, 26 Aug 2015 03:52:04 -0400 MIME-Version: 1.0 In-Reply-To: <1439896258-26449-6-git-send-email-grygorii.strashko@ti.com> References: <1439896258-26449-1-git-send-email-grygorii.strashko@ti.com> <1439896258-26449-6-git-send-email-grygorii.strashko@ti.com> Date: Wed, 26 Aug 2015 09:52:02 +0200 Message-ID: Subject: Re: [PATCH 5/7] gpio: omap: fix clk_prepare/unprepare usage From: Linus Walleij To: Grygorii Strashko Cc: Alexandre Courbot , Santosh Shilimkar , Kevin Hilman , Tony Lindgren , Javier Martinez Canillas , Linux-OMAP , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1340 Lines: 36 On Tue, Aug 18, 2015 at 1:10 PM, Grygorii Strashko wrote: > As per CCF documentation (clk.txt) the clk_prepare/unprepare APIs > are not allowed in atomic context. But now OMAP GPIO driver > uses them while applying debounce settings and as part > of PM runtime irqsafe operations: > > - omap_gpio_debounce() is holding the lock with IRQs off. > + omap2_set_gpio_debounce() > + clk_prepare_enable() > + clk_prepare() this one might sleep. > > - pm_runtime_get_sync() is holding the lock with IRQs off > + omap_gpio_runtime_suspend() > + raw_spin_lock_irqsave() > + omap_gpio_dbck_disable() > + clk_disable_unprepare() > > Hence, fix it by moeving dbclk prepare/unprepare in OMAP GPIO > omap_gpio_probe/omap_gpio_remove. Also, while here, ensure that > debounce functionality is disabled if clk_get() failed, > because otherwise kernel will carsh in omap2_set_gpio_debounce(). > > Reported-by: Sebastian Andrzej Siewior > Signed-off-by: Grygorii Strashko Patch applied. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/