Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1031839iob; Fri, 13 May 2022 20:21:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoRNcUPjUCK28vjbp5d6ME+P17CToWUfchQE6J8UVzMv+fcSgyMgqf9ZuIavIAPojbmJ1F X-Received: by 2002:a5d:4344:0:b0:20c:cad4:9e9b with SMTP id u4-20020a5d4344000000b0020ccad49e9bmr6026196wrr.187.1652498475626; Fri, 13 May 2022 20:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652498475; cv=none; d=google.com; s=arc-20160816; b=GAqn+wK7tp+ObkUXeFXfmvB9S0yW0U+8KHDiywi8FDqRwjqIAVYbm4kNj2HmlVI+mh zTkUhV3jmr1u0sQ5HNqMR1l5bPDqLfntN2+yGtGFDciUGDZMMS1rGCMGtOaeve5Q2JUY oEGP3T7mG1M9Io0y4EbbMoW9EJMa5+QwTToGxonpLQC6qM5HjSOSLBBIpsJtjBC1+fC7 aMCf4VKkzOBlO+6tchMowu9lN52IxCLoMCDsntyuLTOOj6n9PZmczEU/UZzlZNNeSOSX jFGis/EmkelqBGZJ+cO13HEayv1rIeiGivofUUJDT2ZhNo5azpEQguaxAvEVowxwLjpK 4aYw== 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=iZuFOu7mi3R6oaoaxmRQI9ZUruMPyMLHtg+6pEfGbWE=; b=ucl2VMXJ9xzOwUltNyuCReB8HEEzvIBUlfEwTSLijeTTShpoAf1/kNH7v2tj5uOoki InUYUpbnm5llW0Fl7iyvfEjwGQRNqjLwcpYQk3D8Q1LjqVmCU9uUuAnPVPz4E6wm5rRx nKXy9wfAlzmYgDpSbafWUiW+quDSyJg4po7jgfLYco7KOUmR59kTqfW3IN8d8Wu3j8r3 NeQ8Cfp0joH9AyUNq1y7gLk3Vgo7C2H27HW31Jkf8m3QKqsv1uK9XOKF9WDZ/Wmby6Cz eQ7ttboTKHIzXsiv25eIpUvezblBtKkG9evF4HZIsVn8kfO6eXWS693ACle9+Y4lL7Ud w35w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QYRK3klw; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g7-20020adfd1e7000000b0020aaac45374si5282253wrd.514.2022.05.13.20.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:21:15 -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=@gmail.com header.s=20210112 header.b=QYRK3klw; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EFC773FCD50; Fri, 13 May 2022 16:59:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378506AbiEMIoS (ORCPT + 99 others); Fri, 13 May 2022 04:44:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378502AbiEMIoL (ORCPT ); Fri, 13 May 2022 04:44:11 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 918AC2AC0E9; Fri, 13 May 2022 01:44:06 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id g6so14899913ejw.1; Fri, 13 May 2022 01:44:06 -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=iZuFOu7mi3R6oaoaxmRQI9ZUruMPyMLHtg+6pEfGbWE=; b=QYRK3klwC97qKC35SuJKJwR3ljh55QviJszDrOQTatoqR3xNXMtv7y2tvL4oQ4/62i bStx1dSMmwYPsweHMouSZ6m5taR7WQzEu4YiXV4kG4shELh1Ig+35kxhhXG61u6AKgdc pR61dzxoH6r/PYTiXE54q8E3yCNMWAMevaU2PXapNsGNmJc1ml+5L1Q6Tjs9N5s+JT6q rYQdkbioGf8769je7PEU73DViMl73nUYqx0s50EQ1tqJRvqGOqGUz1G97vxB8p4MZG7x OxETS/BRxq/yxN3NaDWXol9IcY2gYO5HUGyfVJuJsd437aNM2RCZxQnR2QOufjV10Ygz s4Qg== 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=iZuFOu7mi3R6oaoaxmRQI9ZUruMPyMLHtg+6pEfGbWE=; b=zVY8YQJhxoea1hxBQci07SzzKWd+ZZC5U0c6eN/314GCaOsVhK9kZBjpDQPgCt7a1I ouLJmefim5iYRK0zr+hKjO1oO1PfqZ+OD3kjD2mRAobYr+LQhnjqFh/avyb/htS2Yapr 8Ys8Zy3ZI/PYWbyAo9nqj2jtbHQaJgHaL2n1NvN08MpiwEyZSIsj8U+hYfideCzNQorF ccTzcSqLrWyk99cEBmbjiwhad3kNBimyxK/PD6Mutvio0OfOXWWQ3T6Wmup7Gd13uUve fcRe3oQnL3wIxE5p2VjZBgEVykuRGdrqLpcGJ6+R74lQ1ayLZzBR8GMEsM51WQvsshC6 wdRA== X-Gm-Message-State: AOAM530F2tu80uAjDmRXDzcM4CRGQ3NI3KomxnUE9hiUcDBQxUZYYArg FFil6TCZuerdw1TpjXucWquTV6T1FHqujrzfCt4= X-Received: by 2002:a17:906:c10d:b0:6f4:a770:846e with SMTP id do13-20020a170906c10d00b006f4a770846emr3263286ejc.497.1652431444879; Fri, 13 May 2022 01:44:04 -0700 (PDT) MIME-Version: 1.0 References: <20220419141846.598305-1-maz@kernel.org> <87tu9umm3k.wl-maz@kernel.org> In-Reply-To: <87tu9umm3k.wl-maz@kernel.org> From: Andy Shevchenko Date: Fri, 13 May 2022 10:43:29 +0200 Message-ID: Subject: Re: [PATCH v3 00/10] gpiolib: Handle immutable irq_chip structures To: Marc Zyngier 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 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. Also /sys/kernel/irq rings a bell, but not sure if it's related. -- With Best Regards, Andy Shevchenko