From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758687AbdKOP5T (ORCPT ); Wed, 15 Nov 2017 10:57:19 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:10833 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758149AbdKOP5K (ORCPT ); Wed, 15 Nov 2017 10:57:10 -0500 Subject: Re: [PATCH v7 08/15] gpio: Move irq_valid_mask into struct gpio_irq_chip To: Thierry Reding , Linus Walleij CC: Jonathan Hunter , , , References: <20171107181559.6318-1-thierry.reding@gmail.com> <20171107181559.6318-9-thierry.reding@gmail.com> From: Grygorii Strashko Message-ID: Date: Wed, 15 Nov 2017 09:57:07 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171107181559.6318-9-thierry.reding@gmail.com> 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 Hi Thierry, Linus, On 11/07/2017 12:15 PM, Thierry Reding wrote: > From: Thierry Reding > > In order to consolidate the multiple ways to associate an IRQ chip with > a GPIO chip, move more fields into the new struct gpio_irq_chip. > I'd like to report possible issue related to irq.valid_mask in case if drivers which are using it will switch to use gpio_irq_chip and new infra. Now irq.valid_mask is used the following way: - gpiochip_add_data() -- It will allocate irq.valid_mask - driver fills irq.valid_mask if required - driver calls gpiochip_irqchip_add() which will take into account irq.valid_mask and prevents mapping of invalid IRQs With current infra gpio irqchip will be created and initialized from gpiochip_add_data and drivers have no possibility to fill it before that. Again, for now this is "possible issue". > Signed-off-by: Thierry Reding > --- > Documentation/gpio/driver.txt | 4 ++-- > drivers/gpio/gpio-aspeed.c | 4 ++-- > drivers/gpio/gpio-stmpe.c | 4 ++-- > drivers/gpio/gpiolib.c | 16 ++++++++-------- > drivers/pinctrl/intel/pinctrl-baytrail.c | 4 ++-- > drivers/pinctrl/intel/pinctrl-cherryview.c | 4 ++-- > drivers/platform/x86/intel_int0002_vgpio.c | 4 ++-- > include/linux/gpio/driver.h | 21 +++++++++++++++------ > 8 files changed, 35 insertions(+), 26 deletions(-) > > diff --git a/Documentation/gpio/driver.txt b/Documentation/gpio/driver.txt > index dcf6af1d9e56..d8de1c7de85a 100644 > --- a/Documentation/gpio/driver.txt > +++ b/Documentation/gpio/driver.txt > @@ -313,8 +313,8 @@ symbol: > mark all the child IRQs as having the other IRQ as parent. > > If there is a need to exclude certain GPIOs from the IRQ domain, you can > -set .irq_need_valid_mask of the gpiochip before gpiochip_add_data() is > -called. This allocates an .irq_valid_mask with as many bits set as there > +set .irq.need_valid_mask of the gpiochip before gpiochip_add_data() is > +called. This allocates an .irq.valid_mask with as many bits set as there > are GPIOs in the chip. Drivers can exclude GPIOs by clearing bits from this > mask. The mask must be filled in before gpiochip_irqchip_add() or > gpiochip_irqchip_add_nested() is called. > diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c ,... -- regards, -grygorii