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 5DA44C433EF for ; Tue, 26 Apr 2022 10:33:31 +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=+rwvpPAoGXSKBUTkFZrxrjAOejrSo6Uvs0rD7z33TOA=; b=LliyK6J3DMGZF0 AZ/FELql99nu3Jf9Cp04PukCm2b2Gdw5se+F56OLhz3F+GvPGP7ZGL7MDO9F/Xs2Rt4W+u88PEeuH lDdO44xTnLPMmay9LCzr0fZYorrF8bR6tz58iprsIAw//O1yIGzzKbEKzdmm0gqJLQ9bhgeyMgMTJ XxsJQ0gTEmgCi0zVTS4U3kj34SX/sXLZZAP9pLOxWzrWd4PCoPQUrRXIVwBfL04zWTl6KSXBQtVOu aMo03z8MEggHyBTKazRtAX3Tv2L7+W6PkaHdYbSnGhaoUi+vXoMeR0rj+VBnuuiMPJKw2axGfyH2g 1FjwQc21hwlhWQQj5jcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njIU8-00DtlS-6C; Tue, 26 Apr 2022 10:31:56 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1njINf-00DqNW-4C for linux-arm-kernel@lists.infradead.org; Tue, 26 Apr 2022 10:25:16 +0000 Received: by mail-ej1-x62a.google.com with SMTP id m20so14356510ejj.10 for ; Tue, 26 Apr 2022 03:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E3GiU4VgA4X0FVG9Q0HUFWR78xcN+9K+AQZgrStd20Q=; b=CqFomzrJcPjoOLCpk2zbMHsv8s4gpt3ktEOcbqKM6d/FBoOtD162g1SitcHKd5PByk suRxgZLOxEcLtTnne2ZL5e33i5js7iU4Usk44bOXl9eMekMOjP4BBExt+1l94b+4ZW1x 3KbOzjNgjZHgZk9PIe8VNP4PcKpVxPsMiCv9L7rNy9JCscKBN7X7YgF3t4VDA4abwdTH wJMBKu5z5Swresr5lB1ZQTWORt1kt5ewc+QqNpXpMnEuZ5OY2BWsL2UfeB9h/oHySeAe 9VM8P6oOc/aSpYDNuFbu5UHHt0oFmrU6l5Rpe+LsVYVIAgKMvTxlt9BzjZ4G2j66QbCA 8now== 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=E3GiU4VgA4X0FVG9Q0HUFWR78xcN+9K+AQZgrStd20Q=; b=HE6SVBj8Y3SF7uadmsEbxQAChXAvd98qXNh7c/10Wcpsd1z3QCBSDXFbGYWmWSHD7g UGrihnp94v6jn7ghhgefpcUflEJRkgAgX3m5LUOtGqKNE0MTIZYNNWsTSMC2edgaHQTS EPK3+fDDB4muel4LeiXFMsm05QQFMfyDS0WIE3j8JU5I/QV4gJOMJpfvOpIZXjHq1YOE 6F8V2EigIdVZH+6iG8JHN2s23fZuGvruZ1RDBGew46RBR01DYsd6zur8oK7XOfjGfFod TuJNCkeuMsWWKwzmKuzJl0h4mYKC+C7RAhnTqZJdNPoprzTn9rpmancEHUIhRWY4TCFv z3Dw== X-Gm-Message-State: AOAM532dK7MIamJNY5CDG6DyDnzatC34NCZSY/gC2Z3tx1jObuz+skhv gdfDupc9FIeTwzbmwrzCR1f/r2MVstTv9y7HJ2Y= X-Google-Smtp-Source: ABdhPJz8BmGLAmH9fEGi0KuLOTUtQRadgcrFFvw87vyemx36ybgw9064Ch2gGNh59MOiJlvtRR/goPKKu8WsaV94ZpM= X-Received: by 2002:a17:907:7d8c:b0:6f2:476d:fde4 with SMTP id oz12-20020a1709077d8c00b006f2476dfde4mr19555140ejc.497.1650968710844; Tue, 26 Apr 2022 03:25:10 -0700 (PDT) MIME-Version: 1.0 References: <20220419141846.598305-1-maz@kernel.org> <874k2kccse.wl-maz@kernel.org> In-Reply-To: <874k2kccse.wl-maz@kernel.org> From: Andy Shevchenko Date: Tue, 26 Apr 2022 12:24:31 +0200 Message-ID: Subject: Re: [PATCH v3 00/10] gpiolib: Handle immutable irq_chip structures To: Marc Zyngier Cc: Linus Walleij , Linux Kernel Mailing List , 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 , "open list:GPIO SUBSYSTEM" , linux-tegra , linux-arm Mailing List , linux-arm-msm@vger.kernel.org, Android Kernel Team X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220426_032515_205312_166EE595 X-CRM114-Status: GOOD ( 35.55 ) 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 Sat, Apr 23, 2022 at 12:30 PM Marc Zyngier wrote: > > On Fri, 22 Apr 2022 22:24:22 +0100, > Linus Walleij wrote: > > > > 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? > > For what it is worth, I've pushed this branch into irqchip-next. > > You can pick it up from: > > https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=irq/gpio-immutable > > but I can also drop it from the irqchip tree. > > Just let me know. I would prefer it if it goes as is now and every stakeholder can just pull it. As far as my drivers are concerned I also want to convert them sooner than later, meaning I want to pull this into my little tree as well. Bart, Linus, would it be also preferable for you? -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel