From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965151AbbJ0QTY (ORCPT ); Tue, 27 Oct 2015 12:19:24 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:53203 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965011AbbJ0QTW (ORCPT ); Tue, 27 Oct 2015 12:19:22 -0400 Subject: Re: [PATCH] gpio: zynq: Implement irq_(request|release)_resources To: Linus Walleij , Soren Brinkmann References: <1445607381-7794-1-git-send-email-soren.brinkmann@xilinx.com> CC: Alexandre Courbot , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , Michal Simek , "linux-arm-kernel@lists.infradead.org" , John Linn From: Grygorii Strashko Message-ID: <562FA3EE.5040408@ti.com> Date: Tue, 27 Oct 2015 18:18:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/27/2015 05:53 PM, Linus Walleij wrote: > On Fri, Oct 23, 2015 at 3:36 PM, Soren Brinkmann > wrote: > >> The driver uses runtime PM to leverage low power techniques. For >> use-cases using GPIO as interrupt the device needs to be in an >> appropriate state. >> >> Reported-by: John Linn >> Signed-off-by: Soren Brinkmann >> Tested-by: John Linn > > As pointed out by Grygorii in > commit aca82d1cbb49af34b69ecd4571a0fe48ad9247c1: > > The PM runtime API can't be used in atomic contex on -RT even if > it's configured as irqsafe. As result, below error report can > be seen when PM runtime API called from IRQ chip's callbacks > irq_startup/irq_shutdown/irq_set_type, because they are > protected by RAW spinlock: > (...) > The IRQ chip interface defines only two callbacks which are executed in > non-atomic contex - irq_bus_lock/irq_bus_sync_unlock, so lets move > PM runtime calls there. > > I.e. these calls are atomic context and it's just luck that it works > and this is fragile. > > Can you please check if you can move it to > irq_bus_lock()/irq_sync_unlock() > like Grygorii does? > This patch rises the question not only about PM runtime, but also about gpiochip_irq_reqres()/gpiochip_irq_relres(). -- regards, -grygorii