Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3613025rdg; Tue, 17 Oct 2023 23:58:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGV4AFoAwryW2mq+behYSG4juAiPI5GIwLagwslp4vFsgu0OZE2CAZaShwtLnXhx7mO8MQ1 X-Received: by 2002:a17:903:248:b0:1c3:6d97:e89e with SMTP id j8-20020a170903024800b001c36d97e89emr4799108plh.58.1697612304375; Tue, 17 Oct 2023 23:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697612304; cv=none; d=google.com; s=arc-20160816; b=xU6YVyCd09rA6hp5VLUhM+/zwMYswF86Ut5KizDo09G2sUIAwLKRGB4jntyJ0tnPYi wAFc8WXLEUcJylxYBGrrxYpLMH0PmgXq36zVH83/qEiPhMFhmIQqGJrJE6/B59ymd44S bk0/uir1QilMFUc7nVJE61uxCNoXYLnWSrvFUpK81jahcKnwPRgcMySB/hq/oIZiSFnU p1OiDIBIvI8+I1sSK9VoImMvrsljYSdJD1OlpBI1cGUYENGkXBpK8fpJVvPtKLePnEkl pb6gJS0EibjkWZWEUVrfltHMgYwlYAEAaqRRQMS18dQ6ckw5Gec4VwIBy+PgSwHW51KN eh0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kwC4vINsKq9AZoCiHY7v2qaBARUu3Ce9v82O1PQj3I8=; fh=CdeYOtkAFrnRJAouaJhDXyzTGrX8rUzzN7bvW46zaKs=; b=Ui6DrqVUn//2Lx7Vb/QRFGckiFkKqyICwjjbMoAbOnpNw9tk8+jvACBAowXWYamKK5 u6Jx5ZcwJlZDQMmx/gB5aOdXrEOfvqpqBcHrHR6B/CmcZ2nCCqy2J+69Izcpap8KxwQN sDTxz3T273l1J/0HBct4eBMObKAQf8W7hd/nU2k6c2HGvvIkG+IZttg47lf/LIKU206V JUV49qDnvo6XIbru/2V3QhZmUfHAwwIm0/b2CkgVRS7qnCugpSE/zAxeid2L3/5jhwf6 sRletpkZ2nw5WJADxjHsdFaOub1vJNgS5ugioM5bml1G9JyNts0a3NI4FCYaX1HYu2fH Fu7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YkcPy1I4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id e1-20020a17090301c100b001bf0b29d935si3723164plh.34.2023.10.17.23.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 23:58:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YkcPy1I4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5DFE0801BF5F; Tue, 17 Oct 2023 23:58:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbjJRG6K (ORCPT + 99 others); Wed, 18 Oct 2023 02:58:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbjJRG6I (ORCPT ); Wed, 18 Oct 2023 02:58:08 -0400 Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFFE3B0; Tue, 17 Oct 2023 23:58:06 -0700 (PDT) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-5a7c95b8d14so82809827b3.3; Tue, 17 Oct 2023 23:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697612286; x=1698217086; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kwC4vINsKq9AZoCiHY7v2qaBARUu3Ce9v82O1PQj3I8=; b=YkcPy1I42u2qAWk/UMix0vDl8hSdVc25OHbDbszY7lMTuzdETKKoD9SOJHuzyMlFZI jWYDEN5ZeJLNmFMbnDJryxJcDY2FZAaEdHsTMQd12rRIwU2t5Vfh4QLncREQf1OgshwB sl7QyVlN60dAdhIkailca/lmeux4FhlHJ/WNjVBg+OnzZ5amEm0gTO3UdQGhAPF/ly0S YC1WbzflWA9DGd8nHhvoBY2zVajeD/GXXAgKJj24VjSzsmxEWwEdA1at+pghOpVJOm4K SwfphGgS0ksLEylGSJPkjJbAh6ZnH90M8EieeyzH/1XRh0JX1IzdVQCcxDtu8U6KxKJi 5B8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697612286; x=1698217086; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kwC4vINsKq9AZoCiHY7v2qaBARUu3Ce9v82O1PQj3I8=; b=SBlSWq2XjVhT4DJDwQ48uVkU5YMW6Wkm33+hS0+8Vy3pDtZOmmzrY8v5gTFTP9dZ0B 32SNExtNubCUbGHL/LkoxUi3/lkOQT7Ajk0OHom69CFQ7w6q3Pq+MVAVV83Yp6Stubx1 LOvrEZhxOqi3vNWicP1Pgku3okjbcdoadbyBSDKMBsnrbtprJHSmGlkXLxvA8YJIamyt 602+XcC0hxuW6OLOrD/pH8Dk2px113nneD4rShfhKQMuBPs1NuObNCBp3tpL6sWbWJrg S5eIBb+SUGJ5ZvLyGdO5DUMYZo1yWLjDhtpzYjBW8KmLSjb4Z/QzFrU9HbhtCAtFLa+Y eeqg== X-Gm-Message-State: AOJu0Yx5XaESVnYr5GT2Uiz6ILNWMLSIF7T+HpToVHUqRspsIwikqmy4 UwOKZkWC72DEl23AeJQzE/LRB9g+KFyW7+6VfeU= X-Received: by 2002:a25:8042:0:b0:d9a:baa8:30a2 with SMTP id a2-20020a258042000000b00d9abaa830a2mr4263564ybn.8.1697612286050; Tue, 17 Oct 2023 23:58:06 -0700 (PDT) MIME-Version: 1.0 References: <20230821061315.3416836-1-zhoubinbin@loongson.cn> <6ba31912-6738-6156-d5f4-3c8d3a3ca7bc@linaro.org> <86wmxcejav.wl-maz@kernel.org> <86pm2ye2si.wl-maz@kernel.org> In-Reply-To: From: Binbin Zhou Date: Wed, 18 Oct 2023 12:57:53 +0600 Message-ID: Subject: Re: [PATCH v2] dt-bindings: interrupt-controller: loongson,liointc: Fix warnings about liointc-2.0 To: Jonas Gorski Cc: Marc Zyngier , Jiaxun Yang , Krzysztof Kozlowski , Binbin Zhou , Huacai Chen , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Huacai Chen , loongson-kernel@lists.loongnix.cn, devicetree@vger.kernel.org, Thomas Bogendoerfer , linux-mips@vger.kernel.org, diasyzhang@tencent.com, linux-kernel@vger.kernel.org, frowand.list@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 17 Oct 2023 23:58:21 -0700 (PDT) On Tue, Oct 17, 2023 at 9:05=E2=80=AFPM Jonas Gorski wrote: > > On Mon, 16 Oct 2023 at 13:26, Binbin Zhou wrote: > > > > Hi all: > > > > Sorry, it's been a while since the last discussion. > > > > Previously, Krzysztof suggested using the standard "interrupt-map" > > attribute instead of the "loongson,parent_int_map" attribute, which I > > tried to implement, but the downside of this approach seems to be > > obvious. > > > > First of all, let me explain again the interrupt routing of the > > loongson liointc. > > For example, the Loongson-2K1000 has 64 interrupt sources, each with > > the following 8-bit interrupt routing registers (main regs attribute > > in dts): > > > > +----+-----------------------------------------------------------------= --+ > > | bit | description > > | > > +----+-----------------------------------------------------------------= --+ > > | 3:0 | Processor core to route = | > > | 7:4 | Routed processor core interrupt pins (INT0--INT3) | > > +-----+----------------------------------------------------------------= --+ > > > > The "loongson,parent_int_map" attribute is to describe the routed > > interrupt pins to cpuintc. > > > > However, the "interrupt-map" attribute is not supposed to be used for > > interrupt controller in the normal case. Though since commit > > 041284181226 ("of/irq: Allow matching of an interrupt-map local to an > > interrupt controller"), the "interrupt-map" attribute can be used in > > interrupt controller nodes. Some interrupt controllers were found not > > to work properly later, so in commit de4adddcbcc2 ("of/irq: Add a > > quirk for controllers with their own definition of interrupt-map"), a > > quirk was added for these interrupt controllers. As we can see from > > the commit message, this is a bad solution in itself. > > > > Similarly, if we choose to use the "interrupt-map" attribute in the > > interrupt controller, we have to use this unfriendly solution (quirk). > > Because we hope of_irq_parse_raw() stops at the liointc level rather > > than goto its parent level. > > > > So, I don't think it's a good choice to use a bad solution as a replace= ment. > > > > Do you have any other ideas? > > Assuming this is changeable at runtime, this sounds to me like this > mapping/routing could easily be exposed as irqchip cpu affinity. Then > userspace can apply all the performance optimizations it wants (and > can easily update them without fiddling with the kernel/dts). > > And then there would be no need to hardcode/describe it in the dts(i) at = all. Hi Jonas: Thanks for your reply. It is possible that my non-detailed explanation caused your misunderstandin= g. Allow me to explain again about the interrupt routing register above, which we know is divided into two parts: +----+-------------------------------------------------------------------+ | bit | description | +----+-------------------------------------------------------------------+ | 3:0 | Processor core to route | | 7:4 | Routed processor core interrupt pins (INT0--INT3) | +-----+------------------------------------------------------------------+ The first part "processor core" will be set to "boot_cpu_id" in the driver, which we assume is fixed and we don't need to care about it here. What we care about is the second part "mapping of device interrupts to processor interrupt pins", which is what we want to describe in dts(i). Let's take the Loongson-2K1000 as an example again, it has 64 interrupt sources as inputs and 4 processor core interrupt pins as outputs. The sketch is shown below: Device Interrupts Interrupt Pins +-------------+ 0---->| |--> INT0 ... | Mapping |--> INT1 ... | |--> INT2 63--->| |--> INT3 +-------------+ Therefore, this mapping relationship cannot be changed at runtime and needs to be hardcoded/described in dts(i). Thanks. Binbin > > Best Regards, > Jonas