From mboxrd@z Thu Jan 1 00:00:00 1970 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 CAF30C433FE for ; Sat, 14 May 2022 10:36:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231778AbiENKgW (ORCPT ); Sat, 14 May 2022 06:36:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbiENKgV (ORCPT ); Sat, 14 May 2022 06:36:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28856BFA; Sat, 14 May 2022 03:36:20 -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 0F211B80159; Sat, 14 May 2022 10:36:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7A87C340EE; Sat, 14 May 2022 10:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652524576; bh=IZ20DnElaUQpGD9AQjF+GTf8KlNtO0jZ4I5fpkzKRAg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RI2Iyaydzs9i8l3W1mZ9L/zOUjwA5u5KH186hWT5zJbULe1YO1bWudVvVFZOqRLDt KwBOczHvrcdEwYj76PwBAiAfn2VswtiBq9sl7UU4e9R4fyTlrhHwQP4hg8pR9oUKGI 6xkv4bOa2cX2e3RecGYMh7tb8Eg6XlV5412ulgD8uVHmZ2bxYPDvnmo7qlPDG4AVAB nvobTo4sxzGS5HLo1T4KX9S93N/TlINZzmC2c12yifBKH7U8hjOl33HhVIzMkp9TQE oTvYuTFxUNBEeIaQOfBKCW1RLsX9LSn5kl6hZ6jWHyhVnGUZUQUqvhJ+L/aBlO/2Is EGLO+6vuzsGbg== Received: from sofa.misterjones.org ([185.219.108.64] 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.94.2) (envelope-from ) id 1npp8A-00BIKM-4A; Sat, 14 May 2022 11:36:14 +0100 Date: Sat, 14 May 2022 11:36:13 +0100 Message-ID: <87r14wmmea.wl-maz@kernel.org> From: Marc Zyngier To: Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel-team@android.com, Daniel Palmer , Romain Perier , Bartosz Golaszewski , Thierry Reding , Jonathan Hunter , Robert Richter , Nobuhiro Iwamatsu , Andy Gross , Bjorn Andersson Subject: Re: [PATCH] gpio: Remove dynamic allocation from populate_parent_alloc_arg() In-Reply-To: References: <20220512162320.2213488-1-maz@kernel.org> 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: 185.219.108.64 X-SA-Exim-Rcpt-To: linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel-team@android.com, daniel@thingy.jp, romain.perier@gmail.com, brgl@bgdev.pl, thierry.reding@gmail.com, jonathanh@nvidia.com, rric@kernel.org, nobuhiro1.iwamatsu@toshiba.co.jp, agross@kernel.org, bjorn.andersson@linaro.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hey Linus, On Fri, 13 May 2022 22:24:40 +0100, Linus Walleij wrote: > > On Thu, May 12, 2022 at 6:23 PM Marc Zyngier wrote: > > > The gpiolib is unique in the way it uses intermediate fwspecs > > when feeding an interrupt specifier to the parent domain, as it > > relies on the populate_parent_alloc_arg() callback to perform > > a dynamic allocation. > > > > THis is pretty inefficient (we free the structure almost immediately), > > and the only reason this isn't a stack allocation is that our > > ThunderX friend uses MSIs rather than a FW-constructed structure. > > > > Let's solve it by providing a new type composed of the union > > of a struct irq_fwspec and a msi_info_t, which satisfies both > > requirements. This allows us to use a stack allocation, and we > > can move the handful of users to this new scheme. > > > > Also perform some additional cleanup, such as getting rid of the > > stub versions of the irq_domain_translate_*cell helpers, which > > are never used when CONFIG_IRQ_DOMAIN_HIERARCHY isn't selected. > > > > Tested on a Tegra186. > > > > Signed-off-by: Marc Zyngier > > Cc: Daniel Palmer > > Cc: Romain Perier > > Cc: Linus Walleij > > Cc: Bartosz Golaszewski > > Cc: Thierry Reding > > Cc: Jonathan Hunter > > Cc: Robert Richter > > Cc: Nobuhiro Iwamatsu > > Cc: Andy Gross > > Cc: Bjorn Andersson > > This looks very appetizing to me but: > > drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 15 ++++----- > > This seems to have some changes to > ->populate_parent_alloc_arg not even in linux-next, > so I get confused, what are the prerequisites? (Probably > something I already reviewed, but...) Odd. This patch is on top of irqchip-next, which is itself already in -next (you got me worried and I just pulled everything to check). > Also: don't you also need to fix something in > drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c? > the way I remember it it was quite similar to spmi-gpio > but I may be mistaken. No, this one is graceful enough to use gpiochip_populate_parent_fwspec_twocell(), which is directly provided by gpiolib and thus addressed directly by this patch. Same thing for the spmi-mpp version, which uses the fourcell variant. HTH, M. -- Without deviation from the norm, progress is not possible.