From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933854AbdBQLjj (ORCPT ); Fri, 17 Feb 2017 06:39:39 -0500 Received: from anchovy1.45ru.net.au ([203.30.46.145]:51427 "EHLO anchovy.45ru.net.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933482AbdBQLji (ORCPT ); Fri, 17 Feb 2017 06:39:38 -0500 X-Greylist: delayed 401 seconds by postgrey-1.27 at vger.kernel.org; Fri, 17 Feb 2017 06:39:37 EST Subject: Re: [PATCH 1/1] gpio: altera: Use handle_level_irq when configured as a level_high To: Andy Shevchenko References: <1487322752-31896-1-git-send-email-preid@electromag.com.au> Cc: thloh@altera.com, Linus Walleij , Alexandre Courbot , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Phil Reid Message-ID: Date: Fri, 17 Feb 2017 19:32:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 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 17/02/2017 17:23, Andy Shevchenko wrote: > On Fri, Feb 17, 2017 at 11:12 AM, Phil Reid wrote: >> When a threaded irq handler is chained attached to one of the gpio >> pins when configure for level irq the altera_gpio_irq_leveL_high_handler >> does not mask the interrupt while being handled by the chained irq. >> This resulting in the threaded irq not getting enough cycles to complete >> quickly enough before the irq was disabled as faulty. >> It looks like handle_level_irq should be used in this situation >> instead of handle_simple_irq. > >> @@ -310,7 +310,8 @@ static int altera_gpio_probe(struct platform_device *pdev) >> altera_gc->interrupt_trigger = reg; >> >> ret = gpiochip_irqchip_add(&altera_gc->mmchip.gc, &altera_irq_chip, 0, >> - handle_simple_irq, IRQ_TYPE_NONE); >> + altera_gc->interrupt_trigger == IRQ_TYPE_LEVEL_HIGH ? >> + handle_level_irq : handle_simple_irq, IRQ_TYPE_NONE); > > AFAIK, handle_bad_irq() should be used here. > G'day Andy Grepping drivers/gpio find a combination of handle_simple_irq handle_level_irq handle_edge_irq handle_bad_irq used in gpiochip_irqchip_add The ones which use handle_bad_irq call irq_set_handler_locked in their irq_type callback to either handle_level_irq / handle_edge_irq So I think in this case it's correct. But I'm no expert. -- Regards Phil Reid