From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752684AbdF3TzK (ORCPT ); Fri, 30 Jun 2017 15:55:10 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:33630 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611AbdF3TzI (ORCPT ); Fri, 30 Jun 2017 15:55:08 -0400 Subject: Re: [RFC] gpio: about the need to manage irq mapping dynamically. To: Linus Walleij CC: Jerome Brunet , "linux-gpio@vger.kernel.org" , Marc Zyngier , "open list:ARM/Amlogic Meson..." , Kevin Hilman , Linux Kernel References: <1497543642.3086.35.camel@baylibre.com> <1497954416.7387.1.camel@baylibre.com> <1497979438.7387.10.camel@baylibre.com> <1498141515.7387.16.camel@baylibre.com> <0e12f9bd-4e0b-c602-5627-5dbda5371dee@ti.com> <1498587929.25567.12.camel@baylibre.com> <657221fa-c6b3-e914-1a81-9a48972ee6d5@ti.com> From: Grygorii Strashko Message-ID: Date: Fri, 30 Jun 2017 14:54:37 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [128.247.59.147] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/29/2017 09:16 AM, Linus Walleij wrote: > On Tue, Jun 27, 2017 at 10:43 PM, Grygorii Strashko > wrote: > >> And my opinion is still the same here - It should be perfectly valid to create >> mappings from gpio_to_irq() to handle properly orthogonality of gpiochip and >> gpio-irqchip functionality and satisfy SPARSE_IRQ goal (allocate Linux virq and >> irq descriptors on demand). > > You are right. > > I would rather say: GPIO drivers that have a 1-to-1 mapping between GPIO > lines and IRQs should not do it, they should map up them all at probe(). > Sry, can't completely agree here :( There could be 300 (or even thousands) of gpios and only dozen of them will be used as GPIO IRQ, so statical mapping will just waste system resources. So, better not define such kind of restrictions - it seems platform/system specific. > Drivers that actually have fewer IRQs than GPIO lines should be able to > create the mappings in gpio_to_irq(). -- regards, -grygorii