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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ADBDFC433F5 for ; Fri, 22 Apr 2022 21:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/ZrI3W+lspypQiqILWpJi2o2FhtrZjTtIs6Pm/wqM+k=; b=lMospWFb7w/kFB yjjgFkaZOPrvcfa/EBul1gmQwBVqrKkXWLzqLU3BJi/jfPZ2S/S3g+/CBDCx7+MF4JmZ46Q6FbdYJ 7zYwtT/Sq7mLd+OVaDBHSfhl9BcewJIokPeGKwQeiDZ+FVYFqaaS0lYW4I3kP8+9cKyHnPlpU6bQR 4OhgzlogyZoRsd/g0w6zXGRNys0oeKg98Q/PkMBgoq+3iHlJO8uXoc5ByxuvYpLMfnjNX6BO1SeoC GPA5YP4F4XXWTkrILgGhZv0qev6Tvb/8lK9+FhW5JJIsJsQj0q2oOBUbCBGdywokGYZ3VqaLRt29Q dNC2Zys3rhoIn0/YdJvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ni0lc-002SKl-MC; Fri, 22 Apr 2022 21:24:41 +0000 Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ni0lX-002SHe-0g for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2022 21:24:36 +0000 Received: by mail-yb1-xb29.google.com with SMTP id f38so16740638ybi.3 for ; Fri, 22 Apr 2022 14:24:34 -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=SOU4gw2OndPAHlyb0Yx1jIvLcwnBW7WU3bDm4X/+Fi4=; b=YfsZ4tU3PuYgqcdjIDeQeP3YRzUO5ivIGgFF1ltC/6cArnKzaw0zeJWVYikoKwMjOE OdEykxqICO7B5JcdxEsqUmyHPybbUs/wGZaO8WggpZlsChK/8OwwojOgf1BsBMku+PLG MAtb2fgJpkzrfqNAIEezByuUWj1P12+quEESjC9NqSMK3lSlcD47ha1lp12du7h/IiM9 FDye+1z8JpkXsYNIIFUjATBQPXD1WBJ6fAmgYdNWG36EvLkWWB5Iqb8FzcwT3TpPcJGv ntzQ1/nuCBAT00gA8Shal5DE+qEmWahWgq3yXj3gk7VaHYOto1+FcB+rijHPlvSV+dM8 TjcA== 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=SOU4gw2OndPAHlyb0Yx1jIvLcwnBW7WU3bDm4X/+Fi4=; b=d6/8J80l1W1Qrx4suwMBVDuQ8jEeJp3pLja8QqX1gRVp9kKQ1EPzL9/zXwu2yhRVot sfCdtRAAKSe1+AeVufQjbxNZiSKB3x+n887osmuJIDzCis9t6BNpyjbRIgjLrX+yWscX 0Ctv60hazQtSTDdRt6FKocXaV3U1XFpFdU4/PFa4McbGCjn0ejUjthCS5ZtRa1qQd/AS MSOkah34itjareVg4XR0uKFEGsZkdhd5T8IPepfuG4L7ZojZBKqQmpU59LULO1nHxpoO Ltzwt+b6KtkAu1dtGoeBvRpJ3slxtTMOfuqliPOlNmPDPts18qKDygsKHc436Jx3sslG f6fQ== X-Gm-Message-State: AOAM53113hibrk8p9HwT1aiPZqEt9MuaAbZduZIKaPBvKmRWvUInY8Z5 b+rQK2Ys0QI10bp7CxCiqWetq69wl6BdSHzTBh06pA== X-Google-Smtp-Source: ABdhPJxsXcP45rrTkuqz2IOlfWfxSn7HO8ecvoT5emKdoiPaqAi9KObKULKewKrgsbOq2XjWVK/mAr4bUvR0dK/u9is= X-Received: by 2002:a5b:dc5:0:b0:624:f16d:7069 with SMTP id t5-20020a5b0dc5000000b00624f16d7069mr6530719ybr.295.1650662673435; Fri, 22 Apr 2022 14:24:33 -0700 (PDT) MIME-Version: 1.0 References: <20220419141846.598305-1-maz@kernel.org> In-Reply-To: <20220419141846.598305-1-maz@kernel.org> From: Linus Walleij Date: Fri, 22 Apr 2022 23:24:22 +0200 Message-ID: Subject: Re: [PATCH v3 00/10] gpiolib: Handle immutable irq_chip structures To: Marc Zyngier Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski , Thierry Reding , Joey Gouly , Jonathan Hunter , Hector Martin , Sven Peter , Alyssa Rosenzweig , Bjorn Andersson , Andy Gross , Jeffrey Hugo , Thomas Gleixner , Basavaraj Natikar , Shyam Sundar S K , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, kernel-team@android.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220422_142435_133901_0DE50937 X-CRM114-Status: GOOD ( 23.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Apr 19, 2022 at 4:19 PM Marc Zyngier wrote: > This is a followup from [2]. > > I recently realised that the gpiolib play ugly tricks on the > unsuspecting irq_chip structures by patching the callbacks. > > Not only this breaks when an irq_chip structure is made const (which > really should be the default case), but it also forces this structure > to be copied at nauseam for each instance of the GPIO block, which is > a waste of memory. > > My current approach is to add a new irq_chip flag (IRQCHIP_IMMUTABLE) > which does what it says on the tin: don't you dare writing to them. > Gpiolib is further updated not to install its own callbacks, and it > becomes the responsibility of the driver to call into the gpiolib when > required. This is similar to what we do for other subsystems such as > PCI-MSI. > > 5 drivers are updated to this new model: M1, QC, Tegra, pl061 and AMD > (as I actively use them) keeping a single irq_chip structure, marking > it const, and exposing the new flag. > > Nothing breaks, the volume of change is small, the memory usage goes > down and we have fewer callbacks that can be used as attack vectors. > What's not to love? > > Since there wasn't any objection in the previous round of review, I'm > going to take this series into -next to see if anything breaks at > scale. The series: Acked-by: Linus Walleij Bartosz: if you're happy with this can you apply it to an immutable branch from v5.18-rc1 and merge that into the GPIO for-next and then I can also pull that into pinctrl? Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel