Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1053503iob; Fri, 13 May 2022 21:15:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwckt8Fiy7vgayluO3slofUm5tEvN/DvET7rvxdC1KN8FBU4AvpwdgS+Z0x/3f851eq9Jne X-Received: by 2002:a5d:68c6:0:b0:20a:d654:6cae with SMTP id p6-20020a5d68c6000000b0020ad6546caemr6180298wrw.564.1652501742559; Fri, 13 May 2022 21:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652501742; cv=none; d=google.com; s=arc-20160816; b=wlZZZdA5jPkjN2rDuC2gcOSyfe4LPg5ROqKUZH6LKzaW1Mbq7xltrUi3YatTd4YuaK rYo1juWjDrJit5+l6hmElGk3ruA9Gd8HXfF7xZ1/GitifHGWFvmlMrf2qf82HTjhi4tE uobnMlCAi8MY47Z9q++jPJietOUjHkLB48RP5kuurlCtzsIGWrWywVtlyLE9tWxiXPdv IPcBDYYWuhHp9c5I+3Vxus3FZjazGAjyXhZ/QAE7FK2kbcf+SZUvdKljuGSvqODiLg49 M0nMt8GNJiNS8IiFP+gVBJegUOxaWSXstYV7NYXAWJAxA3AIMIjIpMw8sMOnIZX5ZQqN 4zzw== 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=0ueDaSsTErmQolYj/n89FuDLYTxrI+xxTPOLBk1HDOg=; b=N7ozUkujdIEa7ZL1GTelWoHGF5g2jR0p4X97k84GKN8z1sc/gyFfkxreE2YMn8+3fs Qd2EcbcL+FqfapS9wywb+U5DHWee5RhftV86b0plISatni/gg5YogvlXO4/1U2DkNq5f cHezqyXzMeTn9ZvMIjRh107IkfWnUMKhr5UHqS1k75bXPFgFoPxUUYk8Rjz24Z7PCuDU 6NYpFdD2I5TuWucEJA0f5Vw4nvovQj2sWMXTKT/zJvMbapEfTgUDdR3+kq7G82gaxIpY zDa5bCgAOVW4Xxhzfg8LDz62CwF+O6okxuuSlJioYPjJHViA88PD5eo2RIS+fsFxDBuX zO8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XvprDXkD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c12-20020adffb0c000000b0020abcb542dcsi4044648wrr.730.2022.05.13.21.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 21:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XvprDXkD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 32FFA4E84EE; Fri, 13 May 2022 17:46:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384647AbiEMVY4 (ORCPT + 99 others); Fri, 13 May 2022 17:24:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358795AbiEMVYz (ORCPT ); Fri, 13 May 2022 17:24:55 -0400 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9022663FA for ; Fri, 13 May 2022 14:24:52 -0700 (PDT) Received: by mail-yb1-xb35.google.com with SMTP id j84so6569975ybc.3 for ; Fri, 13 May 2022 14:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0ueDaSsTErmQolYj/n89FuDLYTxrI+xxTPOLBk1HDOg=; b=XvprDXkDP/fuPYLrBoI4hnZYfwqDXbJPAroGtexlcSuJlDruxai6ShoTfhn7sxb4C5 iZlmgndunl0Hw27N+ZimYysy3vyVRSfqc6FMBeWqre2N6FyL0pBjDjIGLhQgQ206Nvw2 Oq9nfla9Z0DMWaJkFf/k3obDJKp2edaLrq/zqi7t0zFH/XMOxP1ndGdLjg1RIDpHb9Y0 ky8J5D1ObPqIIwJKcn6eat+nhChP11h/FM9WjQvdChQIgY0D4VDL1UsPSVZZocgyR5aq N7ZS/EvualRlqgh+jJJvouLCgjCiP23rbWgVTlOCHvr+s/DyYLSIl8B1nHBlm7o4gUTy nXhQ== 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=0ueDaSsTErmQolYj/n89FuDLYTxrI+xxTPOLBk1HDOg=; b=R3rleVBa0IpbCdKO8ltR7CrqVXYc+Mez5ibUd7d20aF0EqCTyQXxFNcbsBcGju8Q6p Co7J+A5YOlzEXsEozT8/NonCbdnyGVdbohl2Nt51DHUzQ9+PaFy4ldHG9gagEeiwGP0H M2WVk98ANxahmptNrDNHOnFIkVIMXbCLRgZOMFRfueGev3eqnzZynycDE+WmzEpCHEDH IAEF461YnswUkOqxDetRRpqeCAngMYc8U19FD25vNddzMnnjUI0ihBfEr9rxIxwnMdKV Xt/bjDroTxvTMjwas9Vg+foySaeGpXTJ7wrGxd92dQvDOR0KJJeQccV3+0Hxg3VA7yFQ mX7w== X-Gm-Message-State: AOAM533bA3PLTOTD8bgZVWZQf3AFN595tyNJumhpZgIOuOdFgvZzLJMx /LJg4aWH1OM0DhhIrtkyzDLp2w95lzvelLJDqGsFhg== X-Received: by 2002:a25:2c82:0:b0:64d:62a1:850b with SMTP id s124-20020a252c82000000b0064d62a1850bmr273160ybs.291.1652477091802; Fri, 13 May 2022 14:24:51 -0700 (PDT) MIME-Version: 1.0 References: <20220512162320.2213488-1-maz@kernel.org> In-Reply-To: <20220512162320.2213488-1-maz@kernel.org> From: Linus Walleij Date: Fri, 13 May 2022 23:24:40 +0200 Message-ID: Subject: Re: [PATCH] gpio: Remove dynamic allocation from populate_parent_alloc_arg() To: Marc Zyngier 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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...) 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. Yours, Linus Walleij