Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2262124imw; Sun, 10 Jul 2022 01:57:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v9K7mrEPtCGUJOVET9IQqCL4sGqZyBAJP9mgEtfUtyheWxowt+bisbvHnOnF3GJkBAWamc X-Received: by 2002:a17:90a:474c:b0:1ec:f898:d85b with SMTP id y12-20020a17090a474c00b001ecf898d85bmr11099790pjg.11.1657443471449; Sun, 10 Jul 2022 01:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657443471; cv=none; d=google.com; s=arc-20160816; b=1LnAceDbqLrnlgq7exMDbbHY1Og4ANYl/5xQtpLyV9Fxt0Xx+rmg70m32HfNr7CJzU OVkEo7vaQksLb0T0lXOnmQThWLJ4D43wOE8FBg9Cjuh39yWNxlOVRRp53Qq3gKSXQ6Gz HnHhXF+VzKUyxq82cMkwF6/MqwCYMEAe2G4/c69dWTtTfU5nNodUKKBFgwTJ+ZZmzIR1 KFjYKyzpktRsdrB/yD56qEETVnin8NDatpnmqRSdAZG6fOe6k1IfIVCUTRKjfXYmpN3d 1ZAPP1d2RLAxqaljGdEslxz/xkdyI6ihcKBgZ78yB+uutYG7TZ2xcWch+UysIHG/DygF A4Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=9V2bNa6SzOeLc8wtQ4EVBagb37U/GoAK3ceK1ZOqE0Y=; b=ugqz6397l+wdvfGdCVSifQmOq150nz6d7NKiIsKZUkd0r5rmynvc/8t5HF7qZKu1r9 5KNw0wEBuTh/Yri71wF60cfPNKfsEzJxFiG7PqZJj9Ig0U6VDm9mqGtOEWbjdMFNEAl6 Dv2ezxTrcU9S/rbqKH2sZb5YaMv93MZLAJneaAOmlPBJcS7MvAtT5QsagdQkb12UXUSg kFFeKnolC+QG/syHyBbkDSnBIkoPd+QQ78qQMBaaL8oRZsp5GKg8Y3Wh930SPaD0QMDQ x9mDqpl68DuUa7C90QbFJ+YIM+lu5kPrKVQDjfWb+ZjnmXKt4M4zPY4sbO1bcfv5l81U 2MCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q+bwjPvC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2de4WU64; 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=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h6-20020a17090adb8600b001efc9d2e27bsi5029576pjv.0.2022.07.10.01.57.37; Sun, 10 Jul 2022 01:57:51 -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=@linutronix.de header.s=2020 header.b=Q+bwjPvC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2de4WU64; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229617AbiGJImJ (ORCPT + 99 others); Sun, 10 Jul 2022 04:42:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbiGJImG (ORCPT ); Sun, 10 Jul 2022 04:42:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8D6C18E1E for ; Sun, 10 Jul 2022 01:42:05 -0700 (PDT) Date: Sun, 10 Jul 2022 08:42:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1657442524; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9V2bNa6SzOeLc8wtQ4EVBagb37U/GoAK3ceK1ZOqE0Y=; b=Q+bwjPvCIHrffeFTjpCs5C/LF51XdxrcOAvnGDdegsjYBi5aRyOxMAUX8GgJRevCJfOBNx TzQJiNzi742vbsDK9QPGDH3jgK8421yn8KZV94crTFitVxMMtcjx8/U7OUmmhEvSWiqegM WGybqfG3G8QSe7wmv6SVXa8GVpD+JSe/N7D/sofGhGC3+v8AUo7WEkPAMK/77sYtRv3vnc T60B0ILzoTyjSsARF9FGdKTrOUuphL9DZnsG/Y1569U2SEFrXV5j1V7yuIZFgEv3CForqV dATQxTRFmeD9jmaFca5G99V4ucs0iYrJE+oRdEQNuyhZ9wVKxpFvNniFLlGRSQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1657442524; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9V2bNa6SzOeLc8wtQ4EVBagb37U/GoAK3ceK1ZOqE0Y=; b=2de4WU64V0QR7P8tUq6oIOehQn4GxIvM562OKPSiuYfPxRCTfBw51JmRQqcnRk6yEWN3ZL Zn+ZBnHLACO6+VDA== From: "irqchip-bot for Lad Prabhakar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] gpio: gpiolib: Allow free() callback to be overridden Cc: Lad Prabhakar , Geert Uytterhoeven , Bartosz Golaszewski , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20220707182314.66610-5-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20220707182314.66610-5-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Message-ID: <165744252336.15455.10210434568702753718.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 08f12b4534c274c67245019021961206e7a3eefa Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/08f12b4534c274c67245019021961206e7a3eefa Author: Lad Prabhakar AuthorDate: Thu, 07 Jul 2022 19:23:12 +01:00 Committer: Marc Zyngier CommitterDate: Sun, 10 Jul 2022 09:30:00 +01:00 gpio: gpiolib: Allow free() callback to be overridden 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 Acked-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220707182314.66610-5-prabhakar.mahadev-lad.rj@bp.renesas.com --- 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 bfde942..68d9f95 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)