Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2409827pxp; Fri, 18 Mar 2022 09:56:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjbUFp335Luf5d3fagqbZ03yMgzByjpks3bixc4AC54DllcJDEEW8vQUR+xm7Uf1CRtLHp X-Received: by 2002:a17:906:b102:b0:6db:1487:e73 with SMTP id u2-20020a170906b10200b006db14870e73mr9399724ejy.474.1647622608775; Fri, 18 Mar 2022 09:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647622608; cv=none; d=google.com; s=arc-20160816; b=FPKvW/f3ooxSGsV5IBjZdrgFLTPOiMicLUuAQHuFXaH07eVFQvzOtnqbXOc2cSCYX5 vayE5HobRr5isVv7+mLuSoDuv/7g7rXfwQMhw/gJwNyNiwvUr5aXkgZ/SchEPGBhJUW4 9+2rROGHYuvyL18eaca/+HNn/DA48tUvRXE4UVAQsOXpDoeatZPIUhE+8DsGtrFhMv7w brYNcb3FXAxud19pSvdQTDWxSeRBQVthY5vr3hOHLqCwp2ZZjPhMkO4Rh/Vp7Ccc9Azd R8SeuxrAAhdrsVGrlqWzrNYTFZu/lUZFh3jswhfKCFRNGEkKBw2sQdq49O1B1LyQv4dB Ir4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=s7nTlpYa/I83xP+Stl6OjCxXKL7eS12QD0mo9SCq80Y=; b=fElultVHmpHTNMQB06CU6OuAL1670v8LhvLP0snAt293mVmswxytBhP3ayySdJgwyQ BmSvLvzNySZ1kT1dt/rNUXxT0tnZZht1hw7/J47Xivo6bFuV+jlDZJHLtLXUgloQrVv/ HCXuvpDBAda9z1TAs4bq6MijEPjXG7lWvJ1hnHNP38lNYYKq0dAx3CwM4ZnaJ4t03lUg oiC0ASOdDzYoBIfr1ib+KTtL7/d1Cj2BlMnAbr3kDEO9aoJ9MavVwAESJOzt1spDmW5J GoGBuwVvWy1W12Pvd59XMKLRetODJkZTROMpNHJe+ttsm0BfSaOoSs29EPgwFVhIFBtZ 8RnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ou7Ya+Xj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a50cdc8000000b00418c2b5bdf5si3584374edj.215.2022.03.18.09.56.23; Fri, 18 Mar 2022 09:56:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ou7Ya+Xj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237887AbiCRPRb (ORCPT + 99 others); Fri, 18 Mar 2022 11:17:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236931AbiCRPRa (ORCPT ); Fri, 18 Mar 2022 11:17:30 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E0253D494; Fri, 18 Mar 2022 08:16:11 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id t33so8786094ybt.12; Fri, 18 Mar 2022 08:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=s7nTlpYa/I83xP+Stl6OjCxXKL7eS12QD0mo9SCq80Y=; b=ou7Ya+Xj7TjLlCrlKkf3IPBywBvRPaOhRklCh3JoU/vaxf7ZUmUSEezXROjzWvWUJg sBN00Po+jpzdZfnEr9tpaQh5GV5za+LNySiW0AiLqLNNxCKKfC+TRVZv/i8I2JcBuugP Qbo7fpyC7K+dKEaDFZrg775asI15VLKp4thUVWNktijyehclRNP3Nq6yLkrSXRteYx1Y hytYPOFS8amQe6p1S36M8J7dSynNu0F/IWWkLN8D3fv3c8WwG83UXxFc/6DEMWqh61CZ 2MUTXFZ/V2wr92D2auQXWWpqd7uQvffBQApDkooRRkE3ZyZaYJV435AXev1KZr6ROy6g OS9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s7nTlpYa/I83xP+Stl6OjCxXKL7eS12QD0mo9SCq80Y=; b=t4PkjOVLzzKHeiWdVVu+hXt8bVe4r1Ob4RSTg5Y1M2LpMENWny0UWyY3BF/T2WSBrl aEfFoX87pa/OXrNbeKp9VYumJjj+9mx1eBhO9i1tkUT4TBXFpQcnSGdpAqpMDxHa4wh+ TLTwffQSN0nWnC9Ntx0XbfDATOjNBgv8jHeJyefH41ln/rcF9Idaal4epchIuXN6BV5B 6x1iIwAJmVA8HC5TmGzpm0WLHy0m9Nnr65kxjNQGlZpCPal6I5pFhh/J59z8eMExcoqu vj/ocvT5ofpgBCd4C0JRpqJlegUNj3kAphhylrhr9CsFlj783fv+0GNpEOck0WmWQbIg nNCw== X-Gm-Message-State: AOAM530lv2bElhncBMCyzCemD8o9dokXP38D56p8VfRrfWVrr+iuU7Ap yK3EaC0OIw8OwR4eeusctYd3fqvz3FcIgeplG2k= X-Received: by 2002:a25:8812:0:b0:633:7bd8:16ff with SMTP id c18-20020a258812000000b006337bd816ffmr10358271ybl.645.1647616570656; Fri, 18 Mar 2022 08:16:10 -0700 (PDT) MIME-Version: 1.0 References: <20220317012404.8069-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20220317012404.8069-4-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: <20220317012404.8069-4-prabhakar.mahadev-lad.rj@bp.renesas.com> From: "Lad, Prabhakar" Date: Fri, 18 Mar 2022 15:15:44 +0000 Message-ID: Subject: Re: [RFC PATCH v4 3/5] gpio: gpiolib: Allow free() callback to be overridden To: Linus Walleij Cc: Lad Prabhakar , Thomas Gleixner , Marc Zyngier , Rob Herring , Bartosz Golaszewski , Geert Uytterhoeven , Philipp Zabel , LKML , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:GPIO SUBSYSTEM" , Linux-Renesas , Biju Das Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, On Thu, Mar 17, 2022 at 1:24 AM Lad Prabhakar wrote: > > Allow free() callback to be overridden from irq_domain_ops for > hierarchical chips. > > This allows drivers to free any resources which are allocated during > populate_parent_alloc_arg(). > > Signed-off-by: Lad Prabhakar > --- > drivers/gpio/gpiolib.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > Sorry to ping early, this patch and 4/5 hasn't been reviewed at all in previous versions. So I wanted to get your feedback before I post an non -RFC version of the series. Cheers, Prabhakar > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index defb7c464b87..aede442f610d 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -1187,15 +1187,18 @@ static void gpiochip_hierarchy_setup_domain_ops(struct irq_domain_ops *ops) > ops->activate = gpiochip_irq_domain_activate; > ops->deactivate = gpiochip_irq_domain_deactivate; > ops->alloc = gpiochip_hierarchy_irq_domain_alloc; > - ops->free = irq_domain_free_irqs_common; > > /* > - * We only allow overriding the translate() function for > + * We only allow overriding the translate() and free() function for > * hierarchical chips, and this should only be done if the user > - * really need something other than 1:1 translation. > + * really need something other than 1:1 translation for translate() > + * callback and free if user wants to free up any resources which > + * were allocated during callbacks for example populate_parent_alloc_arg. > */ > if (!ops->translate) > ops->translate = gpiochip_hierarchy_irq_domain_translate; > + if (!ops->free) > + ops->free = irq_domain_free_irqs_common; > } > > static int gpiochip_hierarchy_add_domain(struct gpio_chip *gc) > -- > 2.17.1 >