Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp409588pxb; Thu, 21 Oct 2021 01:52:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSN9+fzTxLu7Fbc9JSFw9RzKZayYaPuBdJmHWtuBhLXfK0fDbnwheCyuLh3hklBCau6Nc9 X-Received: by 2002:a17:907:d02:: with SMTP id gn2mr5745543ejc.527.1634806333486; Thu, 21 Oct 2021 01:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634806333; cv=none; d=google.com; s=arc-20160816; b=kVhgG5mOAoqUPHDDfTMHryOAL9o7PLxBKXHxbtbrlXnCETE+A9lsVKilSr7vpch1DS vzr5aFtbjCtbRle4ptGjQPWaEhWQFmAp+PgOGEunSyHXB4lCKzujW+BcaTLBVMGsUxMb TD42BH1kgADYUbu3ZMJuqcGn9tQm5FJoxukfy7dyIG1rZZDvW6xghULwxxxnKKSjZVq9 iTJTXOW5ivItm3LrgXLDw3BC2ZQyxA6zEampfBl8K5dJb1ZZ8qs6ykED9Bn1AlU8gHYX HQ+mB2jSwO2joNIVTno+gVOxQMdu2rztvayzzGYk3csmHVYwvoh3SGtu425d9Ai+c3Rn saSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=paZl2g6HHY69VKf6Y8X+ghPjPvGR1ETeK09s2XBFvzg=; b=Zjec3iIWdqyN8lFyFxvsJWvkb8MEojLswenMzdXcCpam2cch416HlZEGr+Q+E2tEX9 a0+LQ3iFPjpWwNTgW7X3YTb8ksCvPkBhZDVYWODINcoUWBkI3USj9LIErLQr6i7MiPoF Y7C1V+qY+iveo0R1BxlOspSKuVSb1CiRlz4ZvVNaOfW5vxt+jB5JqEtSmxEDq1RdJJz+ 1mVCpMauo7ac2MNNAP1xJ+VYfr7vikPigTOzVd4UGwwI6NXZSjzDGqVTiBkofeDoXJXx nvuj0zRzEb/JCBvdZIpSFEupitH0SmEKeD19SGj7JlD9XQ0o15HouKqCIfheG1ciBHX/ Vh6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=AciGL0qu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb16si8364414ejc.643.2021.10.21.01.51.49; Thu, 21 Oct 2021 01:52:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=AciGL0qu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231485AbhJUItp (ORCPT + 99 others); Thu, 21 Oct 2021 04:49:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231334AbhJUItf (ORCPT ); Thu, 21 Oct 2021 04:49:35 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B7D4C061749 for ; Thu, 21 Oct 2021 01:47:19 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id y22-20020a1c7d16000000b003231ea3d705so2259486wmc.4 for ; Thu, 21 Oct 2021 01:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=paZl2g6HHY69VKf6Y8X+ghPjPvGR1ETeK09s2XBFvzg=; b=AciGL0quv1VLtQW8hKxFL4HSl9/34w7CeQuR12Hl+p34yqNCMk9z84Cib3F9Q5c0xW sg9QrDE1X+4YdwHQqqNTlVITcKZ4BB3y2q2KvkHdYbcIBIJg+BLniONjI4JhKzhMzDwj XWT1bpjrr0fdmoyXtlwuCTYCmNpgw9HJcdiZDxJt26jTTtKl2AP7/daU9pu1uOXJ7+AU NpfSyWY9OmMBiEavA3XKZoUmp8UnpazdrWMrF6B5cW+xSC3bIuYZVuiO8OtrHZg+fgnM V8f4Fygp9ncNaa/oeZaFeNjjS/Nay3kBDMUSsT2u1XVXxP3t/kfO/GS7SWarZVrhzFIg TF9Q== 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; bh=paZl2g6HHY69VKf6Y8X+ghPjPvGR1ETeK09s2XBFvzg=; b=8J7azOjGD3lajQdueaa2Vth77aV2sE50F/tArQ48G6XJhy+oY0IXHtfUvQT7tKnNH6 12z49QyfjnE7uqJVykpuuIpHfFbI2AgzWNS06BId3zyM3ENql/xxT6U4TAdseL0K4oe8 IRX0BEdj3/sjrNxO6374e4x5GIu0/q//s/tjsESnV44rECf0PUnFoRUfP2OaKKrycFzm EfGscKZZkGLfOcO/a4bwls9G1GdLbFibzWy8mZ4DiwtfE85ZeF/pmzDNSpRWMcK/mCVW BZY09rdHaWSTihBP9zH//XXyOhsNzZwThzo8RgYw8d/yd83zrtJADfR2o4G51e9JYjeu nknA== X-Gm-Message-State: AOAM533ytu4BOIH4fjWJhXVdwI4yL2p3cq/+1L7w9gVCacl7pZIgZu/l 5RTmQa4vP0tilS1iAKT397Jc/tFvpwFfflBgPsiYnw== X-Received: by 2002:a05:600c:4111:: with SMTP id j17mr19602240wmi.59.1634806037719; Thu, 21 Oct 2021 01:47:17 -0700 (PDT) MIME-Version: 1.0 References: <20211016032200.2869998-2-guoren@kernel.org> <8be1bdbd-365d-cd28-79d7-b924908f9e39@sholland.org> <8735oxuxlq.wl-maz@kernel.org> <875ytrddma.wl-maz@kernel.org> In-Reply-To: From: Anup Patel Date: Thu, 21 Oct 2021 14:17:05 +0530 Message-ID: Subject: Re: [PATCH V4 1/3] irqchip/sifive-plic: Add thead,c900-plic support To: Anup Patel , Guo Ren , Marc Zyngier , Samuel Holland , Atish Patra , Thomas Gleixner , Palmer Dabbelt , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Rob Herring , Linux Kernel Mailing List , linux-riscv , Guo Ren Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 11:32 PM Darius Rad wrote: > > On Wed, Oct 20, 2021 at 09:48:36PM +0530, Anup Patel wrote: > > On Wed, Oct 20, 2021 at 8:29 PM Darius Rad wrote: > > > > > > On Wed, Oct 20, 2021 at 10:19:06PM +0800, Guo Ren wrote: > > > > On Wed, Oct 20, 2021 at 9:34 PM Marc Zyngier wrote: > > > > > > > > > > On Tue, 19 Oct 2021 14:27:02 +0100, > > > > > Guo Ren wrote: > > > > > > > > > > > > On Tue, Oct 19, 2021 at 6:18 PM Marc Zyngier wrote: > > > > > > > > > > > > > > On Tue, 19 Oct 2021 10:33:49 +0100, > > > > > > > Guo Ren wrote: > > > > > > > > > > > > > > > > If you have an 'automask' behavior and yet the HW doesn't record this > > > > > > > > > in a separate bit, then you need to track this by yourself in the > > > > > > > > > irq_eoi() callback instead. I guess that you would skip the write to > > > > > > > > > the CLAIM register in this case, though I have no idea whether this > > > > > > > > > breaks > > > > > > > > > the HW interrupt state or not. > > > > > > > > The problem is when enable bit is 0 for that irq_number, > > > > > > > > "writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM)" wouldn't affect > > > > > > > > the hw state machine. Then this irq would enter in ack state and no > > > > > > > > continues irqs could come in. > > > > > > > > > > > > > > Really? This means that you cannot mask an interrupt while it is being > > > > > > > handled? How great... > > > > > > If the completion ID does not match an interrupt source that is > > > > > > currently enabled for the target, the completion is silently ignored. > > > > > > So, C9xx completion depends on enable-bit. > > > > > > > > > > Is that what the PLIC spec says? Or what your implementation does? I > > > > > can understand that one implementation would be broken, but if the > > > > > PLIC architecture itself is broken, that's far more concerning. > > > > > > > > Here is the description of Interrupt Completion in PLIC spec [1]: > > > > > > > > The PLIC signals it has completed executing an interrupt handler by > > > > writing the interrupt ID it received from the claim to the claim/complete > > > > register. The PLIC does not check whether the completion ID is the same > > > > as the last claim ID for that target. If the completion ID does not match > > > > an interrupt source that is currently enabled for the target, the > > > > ^^ ^^^^^^^^^ ^^^^^^^ > > > > completion is silently ignored. > > > > > > > > [1] https://github.com/riscv/riscv-plic-spec/blob/master/riscv-plic.adoc > > > > > > > > Did we misunderstand the PLIC spec? > > > > > > > > > > That clause sounds to me like it is due to the SiFive implementation, which > > > the RISC-V PLIC specification is based on. Since the PLIC spec is still a > > > draft I would expect it to change before release. > > > > The SiFive PLIC has been adopted by various RISC-V platforms (including > > SiFive themselves). Almost all existing RISC-V boards have PLIC as the > > interrupt controller. > > > > Considering the wide usage of PLIC across existing platforms, the RISC-V > > International has adopted it as an official RISC-V non-ISA spec. ... > > You mean is in the process of adopting it, right? Yes, it in the process. > > > ... Of course, > > the RISC-V PLIC spec needs to follow the process for RISC-V non-ISA spec > > but changing the RISC-V PLIC spec now would mean all existing RISC-V > > platforms will become non-compliant. > > > > I would expect the review process to produce a proper specification, rather > than a verbatim copy of the SiFive datasheet, and clarify some ambgiuous > and implementation specific language. Clarifying the specification does > not necessarily make all existing implementations non-compliant, as this > has been done numerous times with other RISC-V specifications. Yes, clarification can be definitely done. Regards, Anup > > > The RISC-V AIA spec is intended to replace the RISC-V PLIC spec as the > > new interrupt controller spec for future RISC-V platforms. > > > > Regards, > > Anup > > > > _______________________________________________ > > linux-riscv mailing list > > linux-riscv@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-riscv