Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2264916imw; Sun, 10 Jul 2022 02:01:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1se8Thh+iCvF+Rd7aHPAIv4wCzdGtrNS9czlwi+JW1D2YwfaXch7AeetYjovHcFGLQ5jiK9 X-Received: by 2002:a63:1a52:0:b0:40d:9515:c113 with SMTP id a18-20020a631a52000000b0040d9515c113mr11048331pgm.312.1657443707812; Sun, 10 Jul 2022 02:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657443707; cv=none; d=google.com; s=arc-20160816; b=fjfXU4B7WuEpWXbswKJWSGJWwCaJeHc9zzAMx0weB3si5izfnThgMJtIA6AqaPuC+p gwWa9IM+Fn9hsC9MDUOzbOWLN+7zHzTj1xQqXGzdtGkFLp5bBlhBhruoDm3m0LUTxi/z oowkYfy1Wt8bTqXw4g/ijngNrg1Gi4OtSakpegw6Ohg53CyNVpVN/7Hg9QBKLuNJ/nyn xGUOkJQ6cN6SnCBtUf6mayg84yR8R8jntk3ugEG1t1eC1GCOjrRIMZrIliVAPKBJZ7j3 8v/BzGTbQZYQWiEhHriRrkJy/TRkaVMJJvus1j5lPeOT3pZ9FHwQTbVAom4Inz3yawTq S2aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=gg2f1dypWRC5ai0gg6L4wnST3LrIltIZIPQP1IRmy/I=; b=NvONUhprJ6PG2RSX6GaYLMlL98JJ2MdfaVtS+M1UnnOlhBgPdNpI+vbFELJHM5XGRd bg72GeH8IYmpvdjhBhdRyimcNyUQbUBxtX27BYLcSij4P+4D1+TNM2NL7xPzAcTnF8ZZ 8iXIu7Yb8lGPmGhZdiLXxM8Or/194V2O5NV+IrQtnZFJ+BYOIb9SUwONFcQD1FhKHCQP 3ffH1fVAEgmB7N9IhGkPcOoMF2390AtfyP212SugnCNoxZf7D6TIAvQUYt9HiZTq7+3O KJgWGQo2HZJl7dH3JzNbwYjiB8kB67yMz3wgLx6DuAICFq1Tk8Tsny0zRjGg/rcO8sur +vXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jyhNIKUs; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a63e954000000b004128ea1a97esi5597273pgj.751.2022.07.10.02.01.28; Sun, 10 Jul 2022 02:01:47 -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=@kernel.org header.s=k20201202 header.b=jyhNIKUs; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229601AbiGJIwo (ORCPT + 99 others); Sun, 10 Jul 2022 04:52:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiGJIwn (ORCPT ); Sun, 10 Jul 2022 04:52:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40A7913E33; Sun, 10 Jul 2022 01:52:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DCDACB8068F; Sun, 10 Jul 2022 08:52:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 676E7C3411E; Sun, 10 Jul 2022 08:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657443159; bh=1EGLFs5068J3AvAww5yO3QnC+XHUfwkOCvD6Fp6aLrk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jyhNIKUsHwDrtkxy8zObw3u1fDFPvNx56sEuGC2qvhYXGzhMsV/uG8CRtRSxdEpC+ F7eyGOu9sSkklxjnBi42t6J+aet3bUKC37hZpSb8oymnofyBD1WqBP58GNIMnZxtcW 2td8i/+mOWwjyGPYl9yXdos8/1CqzN0nChWLkYeG/2rJmo7Ptt796cTBoximyUHCgu CueZzblhXPKn7Q3ijymjDfoz8N8SP2FfHzIsnPLnK7HD191Bmq4o2HE2PbAngRXvp2 LGnCEtAdhOLfQJL6AAIaRxd23UmoOI/foOVaDCX2e3dv9X+kn5QUDTqFXtIRJ+ZaGd u7fL1kCcnjpXw== Received: from [213.208.244.172] (helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oASg9-006SB8-8o; Sun, 10 Jul 2022 09:52:37 +0100 Date: Sun, 10 Jul 2022 09:52:36 +0100 Message-ID: <87pmidl57v.wl-maz@kernel.org> From: Marc Zyngier To: Bartosz Golaszewski Cc: Prabhakar , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Geert Uytterhoeven , Linus Walleij , Philipp Zabel , devicetree , Linux-Renesas , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Biju Das , Lad Prabhakar Subject: Re: [PATCH v8 4/6] gpio: gpiolib: Allow free() callback to be overridden In-Reply-To: References: <20220707182314.66610-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20220707182314.66610-5-prabhakar.mahadev-lad.rj@bp.renesas.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 213.208.244.172 X-SA-Exim-Rcpt-To: brgl@bgdev.pl, prabhakar.csengg@gmail.com, tglx@linutronix.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, geert+renesas@glider.be, linus.walleij@linaro.org, p.zabel@pengutronix.de, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, biju.das.jz@bp.renesas.com, prabhakar.mahadev-lad.rj@bp.renesas.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Fri, 08 Jul 2022 16:52:21 +0100, Bartosz Golaszewski wrote: > > On Thu, Jul 7, 2022 at 8:24 PM wrote: > > > > From: Lad Prabhakar > > > > Allow free() callback to be overridden from irq_domain_ops for > > hierarchical chips. > > > > This allows drivers to free up resources which are allocated during > > child_to_parent_hwirq()/populate_parent_alloc_arg() callbacks. > > > > On Renesas RZ/G2L platform a bitmap is maintained for TINT slots, a slot > > is allocated in child_to_parent_hwirq() callback which is freed up in free > > callback hence this override. > > > > Signed-off-by: Lad Prabhakar > > Reviewed-by: Geert Uytterhoeven > > --- > > drivers/gpio/gpiolib.c | 9 ++++++--- > > 1 file changed, 6 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > > index bfde94243752..68d9f95d7799 100644 > > --- a/drivers/gpio/gpiolib.c > > +++ b/drivers/gpio/gpiolib.c > > @@ -1181,15 +1181,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() functions 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.25.1 > > > > Acked-by: Bartosz Golaszewski > > Which tree is this targetting? > Given the various dependencies, I've created a stable branch[1] on top of -rc3, and merged the whole thing into irq/irqchip-next. Feel free to pull the branch in the GPIO tree as well. Thanks, M. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=irq/renesas-irqc -- Without deviation from the norm, progress is not possible.