Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0640C636CC for ; Mon, 13 Feb 2023 23:39:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230486AbjBMXju (ORCPT ); Mon, 13 Feb 2023 18:39:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjBMXjs (ORCPT ); Mon, 13 Feb 2023 18:39:48 -0500 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A29FCA2E for ; Mon, 13 Feb 2023 15:39:40 -0800 (PST) Received: from localhost (88-113-24-128.elisa-laajakaista.fi [88.113.24.128]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id ace8a4f6-abf7-11ed-aae9-005056bdfda7; Tue, 14 Feb 2023 01:39:38 +0200 (EET) From: andy.shevchenko@gmail.com Date: Tue, 14 Feb 2023 01:39:36 +0200 To: Asmaa Mnebhi Cc: Andy Shevchenko , "linus.walleij@linaro.org" , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" Subject: Re: [PATCH v3 1/2] Support NVIDIA BlueField-3 GPIO controller Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mon, Feb 13, 2023 at 11:14:06PM +0000, Asmaa Mnebhi kirjoitti: > Thanks Andy for the feedback! Will address your comment in v4. > > > + generic_handle_irq(irq_find_mapping(gc->irq.domain, level)); > > There is a helper that unites these two calls together. > > I didn't find any helper in v6.2. Could you please point me to it? It's available even longer than just in v6.2: generic_handle_domain_irq(). ... > > +static int mlxbf3_gpio_init_valid_mask(struct gpio_chip *gc, > > + unsigned long *valid_mask, > > + unsigned int ngpios) > > +{ > > + struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); > > + > > + *valid_mask = gs->valid_mask; > > + > > + return 0; > > +} > > Why do you need this? > > Since we only use ACPI tables and we want user space (libgpiod tool) or possibly (in the future) > other kernel drivers to have access to certain GPIO pins, we use this valid_mask to do so. > Linus previously explained that if we ask for a GPIO then it will be muxed in using .gpio_request_enable(). > And so we would use .valid_mask to restrict the use of certain gpios. So, why you can't use gpio-reserved-ranges property? -- With Best Regards, Andy Shevchenko