Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp397718imi; Fri, 22 Jul 2022 01:14:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vm4W/bDq2yDaasRK7VHzxdfSx0xVUMyZsHFg2YOVXrZmEZFanRdY5S/V2BD2Rs9gQLuL8I X-Received: by 2002:aa7:ce02:0:b0:43b:c381:5e19 with SMTP id d2-20020aa7ce02000000b0043bc3815e19mr2257235edv.295.1658477656363; Fri, 22 Jul 2022 01:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658477656; cv=none; d=google.com; s=arc-20160816; b=G0VdeyeywNFmaEE/WXF8cDG351WxB5NXSe2bADB62khgNf6HD+qNV0LOT/k85K0Asd rFMgNfmwVJapfXn9YlgNJ4CFI+k0YrxwDwkHyEqT1phbZg2FIOSglJxoYexp1uVtAp81 EFVk+zJv31Z54oKROR5RYrU/HrQOIe+PC7Ufh2WgKwh0AOaF98McMLPyIQx7M7yauojU wrysZ188hf322u2bakhD6W9lFD8g75VPlBq8ahQWurrRIGdO3jwTbt6MFnT+Z08lSPBe Y1lYkBPfl99aDa7hE+Z/aWpYU5/ranVjDMjMWiGO+oC3ZXRX42rYsdwmcpWmcFhyd8La IPXA== 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=96znZdiwPCkyNjDqtwxjDYyUIzp3mPMS2IIfGwlXMro=; b=ucfj+5kOP/HxGMNNa73hZ6GEjnymDEhlWMi4e1Fy9UOuygZzOTxLhYny8CGWTa6pfP c9ZtIZK1bpeuadCFZzWwDqxP6gB58nAJCwMjhXOAXj0bTh5XoVFEiMODTSYP56iixreS QSSRhCNjdN8jbhhFB+dOwAE9Fzqvcg8WecfOzjyt4+h0n1ovs8aMOptdq75lA5KE2nBD +u743X8dh+zPs2zCwbZtYtJuKInDUbUBEWWvtPW/Tb4Jp98MtylQLsTwNER2AhtQgS6O OGyK3Id0Q49zMeasBZu0KFlLfdVBsfRzfBDvRCiCcZ6hEW9yy1GkrfmFYIzb7tXUhcPK qitw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KSnH2SnT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g5-20020a50d0c5000000b0043a7264df4asi5286709edf.265.2022.07.22.01.13.51; Fri, 22 Jul 2022 01:14:16 -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=@kernel.org header.s=k20201202 header.b=KSnH2SnT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234744AbiGVIHv (ORCPT + 99 others); Fri, 22 Jul 2022 04:07:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbiGVIHt (ORCPT ); Fri, 22 Jul 2022 04:07:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F91A9B576 for ; Fri, 22 Jul 2022 01:07:49 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B37266138B for ; Fri, 22 Jul 2022 08:07:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 215C3C341C6; Fri, 22 Jul 2022 08:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658477268; bh=ArMP6+H2VqRCpQ6HR0t51RGFDWByuXnQDn/27Yz7/g8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KSnH2SnT4Dxj0152oLHytdvMtbeCRLGb451qsqbiTDBJN7LvqPPFJBkYNZy/8rONt 6CA0rQsd9iLh9EcHvvGZxIELWufBQ5TKB99lcp+RxPfMQ07dwfrIksesyQ8nNFnZMC hYF3NlzI3wVoNI+F4WOP5KWhxBLzioq+iYGRSqqoC1XQWVCXdX7LcqiqDwgck1aoVs 12oRLKQ0LVRtCgEw+iD0wKlEEx3eS01PqQSbJ+mKQ9amiagE586Kzjjls5Rr1TJEN+ 5CdTUdgOgDdf8QDEFNR5f96JQ2DmgthySzVw2N2Qd63WnlKJKTzyc2+cun4QraPILG VNzLV+FNRJewA== 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.95) (envelope-from ) id 1oEnhK-009GzO-2o; Fri, 22 Jul 2022 09:07:46 +0100 Date: Fri, 22 Jul 2022 09:07:45 +0100 Message-ID: <87r12dy3hq.wl-maz@kernel.org> From: Marc Zyngier To: Huacai Chen Cc: Jianmin Lv , Thomas Gleixner , LKML , loongarch@lists.linux.dev, Hanjun Guo , Lorenzo Pieralisi , Jiaxun Yang , Huacai Chen Subject: Re: [PATCH V18 00/13] irqchip: Add LoongArch-related irqchip drivers In-Reply-To: References: <1658314292-35346-1-git-send-email-lvjianmin@loongson.cn> <874jzcyrjl.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: chenhuacai@kernel.org, lvjianmin@loongson.cn, tglx@linutronix.de, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, guohanjun@huawei.com, lorenzo.pieralisi@arm.com, jiaxun.yang@flygoat.com, chenhuacai@loongson.cn 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=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Hi Huacai, On Fri, 22 Jul 2022 03:25:23 +0100, Huacai Chen wrote: > > Hi, Marc, > > On Wed, Jul 20, 2022 at 7:03 PM Marc Zyngier wrote: > > > > On Wed, 20 Jul 2022 11:51:19 +0100, > > Jianmin Lv wrote: > > > > > > LoongArch is a new RISC ISA, which is a bit like MIPS or RISC-V. > > > LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit > > > version (LA32S) and a 64-bit version (LA64). LoongArch use ACPI as its > > > boot protocol LoongArch-specific interrupt controllers (similar to APIC) > > > are already added in the ACPI Specification 6.5(which may be published in > > > early June this year and the board is reviewing the draft). > > > > > > Currently, LoongArch based processors (e.g. Loongson-3A5000) can only > > > work together with LS7A chipsets. The irq chips in LoongArch computers > > > include CPUINTC (CPU Core Interrupt Controller), LIOINTC (Legacy I/O > > > Interrupt Controller), EIOINTC (Extended I/O Interrupt Controller), PCH-PIC > > > (Main Interrupt Controller in LS7A chipset), PCH-LPC (LPC Interrupt Controller > > > in LS7A chipset) and PCH-MSI (MSI Interrupt Controller). > > > > [...] > > > > OK, that's 4 versions in quick succession, so I suggest we stop the > > bikeshedding and focus on getting this actually merged. > > > > I'm going to stick this in a branch and throw it at -next. Any change > > will need to go on top of it, no rebasing. If anything that breaks > > cannot be fixed easily, I will drop the branch. > Thank you very much for this series finally get merged. > But there is a question that has puzzled me for a long time so I want > to consult with you: Why exporting fwnode_handle in the driver is > acceptable but exporting irqdomain is not? In my opinion, exporting > irqdomain is more simple and direct because it can avoid > irq_find_matching_fwnode() in the consumer side. The idea is that creating a mapping is normally driven by the code that parses firmware tables, be it DT or ACPI. That code normally only has access to something that eventually derives into a fwnode. irqdomains should only be a concern for the IRQ stack itself, and not the firmware interface. Now, your architecture breaks some of the fundamentals of what we have tried to do over the past 10 years, which is to separate the FW interface from the IRQ code, because you can't describe the topology in the firmware tables and are stuck with some in-code flow. We have two choices: - Either we let you break the above separation and start exposing irqdomains everywhere outside of the IRQ stack, - Or we turn your arch code into its own firmware interface, and make it drive the IRQ code as DT/ACPI would normally do. I have decided to go for the latter, because I don't think the LoongArch model is a good one. I'm convinced that eventually you will have to redesign a FW interface that allows full topology discovery (probably similar to IORT, should you stick with the ACPI model), and that the current code will become a historical artefact. And I really don't want this legacy in the core code. M. -- Without deviation from the norm, progress is not possible.