Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp970780iob; Fri, 13 May 2022 18:07:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTwdSqoY0knV0oAps2/eCVs2xUHqCFU9d00KGSUyuoG5vq9hpTYC5x9oAUuEGF3WBdqmBW X-Received: by 2002:adf:e60a:0:b0:20a:c402:6810 with SMTP id p10-20020adfe60a000000b0020ac4026810mr6077950wrm.45.1652490436262; Fri, 13 May 2022 18:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652490436; cv=none; d=google.com; s=arc-20160816; b=rqxGGB3mXhGcK11OR68w1LtA39Jrd/FCyJo6rAUGpVh33RseDkW3Rt7DVgD1UQPqZT yNfX6+8KMY/DIv8PQJX9W7/9B020QjrRn4q0WhhjnJ7Vk3rZ/dVj+GvTMktGGtGilOOX 9C7Im59MYMD5+PGwfzB6yixJt0VYp9CmArEVTW2sUHsTn9SWwGwuQrExWqu87OBy5gB+ iOL8+6KydPtF04LQIMk7oYgKCMIfMsuaMaUhXTJNFaJDMqAfsNthTVK3q5cJDoe3eEdA m+D+x1OaWw6zX2DT2N+GMlVoicfpLJIDnj/+tAfdVie21AA1/UXV8Encgy+LtRegAeoo CB6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=N/29ApuLGNkrP8cQtFV9pwNIUuiOD7+mTrKuwGNR5G8=; b=LwViFTe1q3akUb+Atg3X8UKKXst0H8sr55VdtVjvX1m+D9XoydhPtgOTex0XJzwVax HRm+gePthNggyRONNT98g5MpgmJxWdi7qsGFbpDkKEAlDRpvXbKNCmOg8ZK5Fszonb1o scZiRHehbs/Y7mZ+ARGNKN22KaUzFdhacx5hMGCnKPquEjhvy+kABRxTKXbg0o145waI mxvVZsxQzgr4T7bU0OWHpogC+iRerJMMar9WC423HFJc8SqG4VFwRaqmZmqkeVDcMzRP YNWnW5S84KukiM/n/wiTw5nM3FzXDgH7d8Rhk4HfGqkUH0pvCK9HAcTJ149Es9qsA1GR AOfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hLLoD0NB; 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=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d11-20020adff2cb000000b0020ad4ed534bsi3249421wrp.174.2022.05.13.18.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:07:16 -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=@kernel.org header.s=k20201202 header.b=hLLoD0NB; 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=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3EA75383958; Fri, 13 May 2022 16:39:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378679AbiEMIwC (ORCPT + 99 others); Fri, 13 May 2022 04:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348514AbiEMIwA (ORCPT ); Fri, 13 May 2022 04:52:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A43D11FE1DB; Fri, 13 May 2022 01:51:58 -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 552E1B82CD3; Fri, 13 May 2022 08:51:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BEE8C34100; Fri, 13 May 2022 08:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652431916; bh=Z9GNVgKPYgZkKWB6ukAD87t5wipTy5BqfBoBFI3+5tE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hLLoD0NB9PRvpctpe75eS4G7itCJY3McuHxXJrSO0E2FCQs3vBTR8RbexYLO6/Zst 4hNP80cRsC3y9ngKTwTeNhhjyiMXQnjqLKPSDIeEu+NrhLu0bQtxJ0nm0GlUJgGVdA iW/lOBhXMjExq7yhfs5u1rIXd0HVDkIPQ2meN1UOkBcMmV9FH1OLkhCRZX4myQKrgC URfZQTiTtQgJdWFi+lc8wrO+oeDd6VeTMJ32ECNYgAh45nR6/kq3MV8fhaRB0q8lGh MbQ/5Gb6UjO9Bup4Pf7oBUBvpsEfo1Qk1ZqdZgwDT58CZubHJ2bp5Yt34Q0cignsA8 HPgv+QbI3lxdA== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.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 1npR1d-00B4kN-9C; Fri, 13 May 2022 09:51:53 +0100 Date: Fri, 13 May 2022 09:51:53 +0100 Message-ID: <87tu9t6cie.wl-maz@kernel.org> From: Marc Zyngier To: Andy Shevchenko Cc: Linux Kernel Mailing List , Linus Walleij , 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 Subject: Re: [PATCH v3 00/10] gpiolib: Handle immutable irq_chip structures In-Reply-To: References: <20220419141846.598305-1-maz@kernel.org> <87tu9umm3k.wl-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: andy.shevchenko@gmail.com, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, brgl@bgdev.pl, thierry.reding@gmail.com, joey.gouly@arm.com, jonathanh@nvidia.com, marcan@marcan.st, sven@svenpeter.dev, alyssa@rosenzweig.io, bjorn.andersson@linaro.org, agross@kernel.org, jeffrey.l.hugo@gmail.com, tglx@linutronix.de, Basavaraj.Natikar@amd.com, Shyam-sundar.S-k@amd.com, 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-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Fri, 13 May 2022 09:43:29 +0100, Andy Shevchenko wrote: > > On Fri, May 13, 2022 at 12:18 AM Marc Zyngier wrote: > > On Thu, 12 May 2022 18:35:55 +0100, > > Andy Shevchenko wrote: > > > > > > On Thu, May 12, 2022 at 08:08:28PM +0300, Andy Shevchenko wrote: > > > > On Tue, Apr 19, 2022 at 03:18:36PM +0100, 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. > > > > > > > > Is this brings us to the issue with IRQ chip name? > > > > > > > > The use case in my mind is the following: > > > > 1) we have two or more GPIO chips that supports IRQ; > > > > 2) the user registers two IRQs of the same (by number) pin on different chips; > > > > 3) cat /proc/interrupt will show 'my_gpio_chip XX', where XX is the number. > > > > > > > > So, do I understand correct current state of affairs? > > > > > > > > If so, we have to fix this to have any kind of ID added to the chip name that > > > > we can map /proc/interrupts output correctly. > > > > > > Hmm... Some drivers are using static names, some -- dynamically > > > prepared (one way or another). Either way I think the ID is good to > > > have if we still miss it. > > > > No, this is a terrible idea. /proc/interrupts gives you a hint of > > which driver/subsystem deals with the interrupt. This isn't a source > > of topological information. /sys/kernel/debug/irq has all the > > information you can dream of, and much more. Just make use of it. > > Okay, so IIUC the mapping is that: I got a vIRQ number from > /proc/interrupts, but then I have to mount debugfs and look into it > for a detailed answer of which chip/domain this vIRQ belongs to. Normal users shouldn't care about irqdomains. If you are developing, you already have debugfs enabled and mounted on your system. > Also /sys/kernel/irq rings a bell, but not sure if it's related. This is the same thing as /proc/interrupt, just dumped with a different format. M. -- Without deviation from the norm, progress is not possible.