From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Holler Subject: Re: [PATCH] RFC: interrupt consistency check for OF GPIO IRQs Date: Fri, 02 Aug 2013 17:35:38 +0200 Message-ID: <51FBD1CA.1000202@ahsoftware.de> References: <1375101368-17645-1-git-send-email-linus.walleij@linaro.org> <51F8CC35.1070704@collabora.co.uk> <51FB8292.9090000@ahsoftware.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from h1446028.stratoserver.net ([85.214.92.142]:39793 "EHLO mail.ahsoftware.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753871Ab3HBPgd (ORCPT ); Fri, 2 Aug 2013 11:36:33 -0400 In-Reply-To: <51FB8292.9090000@ahsoftware.de> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Javier Martinez Canillas Cc: Linus Walleij , Grant Likely , Linux Kernel Mailing List , "linux-arm-kernel@lists.infradead.org" , Linux-OMAP , "devicetree@vger.kernel.org" , Enric Balletbo i Serra , Jean-Christophe PLAGNIOL-VILLARD , Santosh Shilimkar , Kevin Hilman , Balaji T K , Tony Lindgren , Jon Hunter Am 02.08.2013 11:57, schrieb Alexander Holler: > There must have been a bug in the patch too. I've also added that > iinterrupt-parent stuff (with the same flags as used by the driver) and > just have let the driver call > > request_threaded_irq(gpio_to_irq(gpio), flags); > > without the gpio_request()/input() before. And request_threaded_irq() Not to forget that it would/will be a big problem, if you will forbid drivers to use gpio_request() when they use the gpio as irq (as it was/is necessary now). With my kernel 3.10.4 with some patches on top, I see # git grep gpio_to_irq | wc -l 678 So there are a lot of places where gpio_request(); gpio_direction_input() request_irq(); would have been changed to #ifdef CONFIG_OF_GPIO gpio_request(); gpio_direction_input() #endif request_irq(); to not fail during runtime (hopefully with some descriptive error message if it fails). Regards, Alexander Holler