Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5214908rwb; Tue, 8 Aug 2023 23:56:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6iaeQYKN62tMpOzQd7L/Bmq54zIXjSFDACkj5juQLRKzvEpPMTYvqjlFaVXgH5uWft0rV X-Received: by 2002:a17:902:cecd:b0:1bc:6a89:86ba with SMTP id d13-20020a170902cecd00b001bc6a8986bamr1948489plg.16.1691564217633; Tue, 08 Aug 2023 23:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691564217; cv=none; d=google.com; s=arc-20160816; b=vCqk7AtiHFi1aYHYghS+uoe4RkMbywiw1p6w1qrUmDcZX2KAit7JteN38GRe56XEdK tKnKDf+bwpiREFuLI7CY8obZjtumwUihkTtE+mhEcZljxjrc66Y0XPcbMlcdYsEUqsR5 LCCOBhgB7zBhtSHyUz7XhO00X1XKPMRVddyqXVUgPEfZbyDPVLIk4vzySgOM4GczWwPm 5FoKoQSfCrq0xso/B1JIRtvPc/A3S/NOumt9XImA4BLxvrgJ48kytTLWY6v44kvzqa+K bMG/CMgwzsbcROOCTXhW2zIjtz0rCecw0RKg3LCezDf6v13S8fqQcKzdWv7mGqDaDbOa LRsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vxcldl12I3EwBgJQlvH4uhDdlUAS8X8H2ABb+awGB+s=; fh=10fYJjisDDYqGPSIfTvQ5j9mrmZy0DRhk3L7Dsre9PA=; b=cX4Pd1iHZ4hxmi4ycQwm1NZEjhoLoxpg/H2epxDk8xm1FhKITYqQbr1aIfRCpiXL67 0XcP0ZfAY0XnIgpIAuL6xnl5SCqCLQRXfkmJFvuH1JColcWCvgRsq35LDQmJYyHLOeBi BR91i9TRTVuOtKbKb80GK2ppw3kunET37gnbod2yjonscJ3NeUxtQCZNCq69DCx8+2mn XkcyFICDMoGxc4yQdwi2OlMeK8B9KWn4Qkr9FjFKb4FM0UGRaGk84kt3D+RqXHWHq4z3 NaUP3zzKHI4ak78DQnyevNqKVS81iQiRagyRkKwMOS9AACeiPwfgiXXw7s/baWYzxY9v 6XTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=bWGuxL1D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iw4-20020a170903044400b001bb0fc56a1esi8566905plb.197.2023.08.08.23.56.44; Tue, 08 Aug 2023 23:56:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=bWGuxL1D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229541AbjHIFou (ORCPT + 99 others); Wed, 9 Aug 2023 01:44:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbjHIFos (ORCPT ); Wed, 9 Aug 2023 01:44:48 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 041151BF2 for ; Tue, 8 Aug 2023 22:44:47 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1b8b4748fe4so42760885ad.1 for ; Tue, 08 Aug 2023 22:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1691559886; x=1692164686; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vxcldl12I3EwBgJQlvH4uhDdlUAS8X8H2ABb+awGB+s=; b=bWGuxL1DOLIxUyEVzJG60PbAM1TTn29jgsmsdGFv9qt+PlkLpRdGCCJZGPoiRMfOYr w9qFJTH5PT+r7p4FA5jao0vuTT90gasDkW6Bo1XxbbOWe/fhyXTmQUTE2pfQLsatgY0r lX7gmoWKIwHD6LZwG2TlGOKagQrqaidNlUvAOGhXyV8pCSVZ/Lk0UmyWUdXrIu+T9Eh3 /Soqy/xjVjR1GiUStLrKv7rmXMRysXV7RIbStm8m+wr2i3F1i+UdIwa9g55kgvjwJrxx DBO33rOID4saTHn/d3MhTY0k3X/iUrCb06S3/3JTmz6goyAyYFhB0CeGlH+nFXPQYBNd TuBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691559886; x=1692164686; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vxcldl12I3EwBgJQlvH4uhDdlUAS8X8H2ABb+awGB+s=; b=J9Fld3LnQxASIcZqyc755GOc1Eq2fOFkDBBkzK5cLPketoSs/9Yhj3zVsXi+jE73LZ MXYOg7zfjUS00Scw8ONCoPwKwCOSGm0/KaKH0gsegZq9urXZRsE1hlUBADBrNpRPC1Fb 5HpABQIAMVT1SnXxZGgnT/sWIXx1SyQpPI0UKc93KBupnmJovhHztK+1Fkj7pFBXXdY7 eFb0Xt3RTRcZYQpM2F93KLtMk89oFqEZlyMMeFYVlI9b0Gz34aWDRRzI/IbEsAx139oG BvlU+ln25LCtto4A8nvyR0gviXpT0hVFIpEZF9/H5/eHwKCrRTFKrwWPg8uHyUkDSIVO YjZw== X-Gm-Message-State: AOJu0YznXvi7iUnE2PNH/pQFWbrtq/I2Q2jt6MCxSSBwvalHho0pR4Q4 behGlxUokT8JZ1PL7UEop0hz0w== X-Received: by 2002:a17:902:e88b:b0:1bb:dc48:644a with SMTP id w11-20020a170902e88b00b001bbdc48644amr1829426plg.49.1691559886467; Tue, 08 Aug 2023 22:44:46 -0700 (PDT) Received: from sunil-laptop ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id jw15-20020a170903278f00b001b8a54f99d1sm10040833plb.275.2023.08.08.22.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 22:44:46 -0700 (PDT) Date: Wed, 9 Aug 2023 11:14:36 +0530 From: Sunil V L To: Marc Zyngier Cc: Andy Shevchenko , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Len Brown , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , Daniel Lezcano , Thomas Gleixner , Anup Patel , Bjorn Helgaas , Robert Moore , Haibo Xu , Andrew Jones , Conor Dooley , Atish Kumar Patra , Anup Patel Subject: Re: [RFC PATCH v1 11/21] swnode: Add support to create early during boot Message-ID: References: <20230803175916.3174453-1-sunilvl@ventanamicro.com> <20230803175916.3174453-12-sunilvl@ventanamicro.com> <865y5phdwd.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <865y5phdwd.wl-maz@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 Tue, Aug 08, 2023 at 02:17:22PM +0100, Marc Zyngier wrote: > On Fri, 04 Aug 2023 09:11:05 +0100, > Sunil V L wrote: > > > > Hi Andy, > > > > On Fri, Aug 04, 2023 at 09:09:16AM +0300, Andy Shevchenko wrote: > > > On Thu, Aug 03, 2023 at 11:29:06PM +0530, Sunil V L wrote: > > > > From: Anup Patel > > > > > > > > swnode framework can be used to create fwnode for interrupt > > > > controllers. > > > > > > Why? What is this for? > > > Can you elaborate? This commit message is poorly written... > > > > > > And why firmware node is not enough for ACPI case? > > > I assume the fwnode in DT case is already provided by OF. > > > > > Thanks a lot for the review!. > > > > You are right, OF provides the fwnode for irqchip drivers. However, for > > ACPI case, it is typically created using irq_domain_alloc_named_fwnode > > or irq_domain_alloc_fwnode since these are not ACPI devices in the > > namespace but from MADT. The fwnode created using > > irq_domain_alloc_fwnode() is a simple one which doesn't support properties > > similar to the one created by OF framework or software node framework. > > Hence, lot of data from the MADT structures need to be cached as > > separate structures in the drivers and also would need several ifdefs to > > check for ACPI and some amount of code duplication is also required due > > to the way DT driver gets the information vs ACPI. > > > > The beauty of software node framework is, it supports adding properties > > and also is a supported fwnode type in __irq_domain_create(). > > There is no beauty here. Only some extra bloat that we do not need. > > DT and ACPI exposes very different attributes. One describe the HW, > the other one describe an OS abstraction. Pretending that you can > summon both into the same infrastructure is a fallacy. You'll just end > up with the cross product of both infrastructure, and pollute the rest > of the kernel with pointless cruft. > Hi Marc, Thank you very much for the feedback!. Sure, let me revert this approach and do as you recommended in next version. > > So, if we > > can create the fwnode for these irqchip using software node, we can > > attach the same properties and the actual irqchip driver which uses the > > fwnode doesn't need to have any ACPI vs DT checks. Same driver will work > > seamlessly on both DT and ACPI platforms. But the challenge is, > > currently swnode expects to be created with sysfs which won't be > > available during early boot when irqchip drivers need to be probed. So, > > adding support to create without dependency on sysfs help us to reuse > > the same framework for irqchip use case also. > > That's another fallacy. > > Most irqchips *DO NOT* need to be probed early. Only the root > irqchip. Given that this series is about *secondary* interrupt > controllers, they absolutely don't need to be probed early. > Since we created swnode for root irqchip also in this approach, we had to support early creation. With your feedback, this is no longer required. > To be clear: I do not intend to merge anything that: > > - invents yet another way to "abstract" firmware interfaces > > - adds more "early probe" hacks for non-primary interrupt controllers > > I have already said that in response to Anup's AIA series, and this > equally applies to this series. > In Anup's AIA v7 series, he has made non-primary controller drivers as platform drivers which are not probed early. Thanks, Sunil