Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1554060pxb; Wed, 20 Oct 2021 07:22:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDT+Nkc1OpXS0Yg275fNNiVr4Pr62JHu6ErBoxsy7f5KvFmHUV2Er4WsGkQNHRkQ9vuxxs X-Received: by 2002:a62:1887:0:b0:44c:872e:27ed with SMTP id 129-20020a621887000000b0044c872e27edmr272746pfy.71.1634739731996; Wed, 20 Oct 2021 07:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634739731; cv=none; d=google.com; s=arc-20160816; b=UOlkgqiRUBJVqWBAOIJjaxc1WF2gi7pC7Rg6kmAuNnC1p0Fv5nNw9q/d3Vg3RlKvLl n63B7iCfSjEGY0RVRtXhejeWpLO8GKK/RvP0rr7494ccIkhWyO5rDbu8gxj5NnzzQ2gN 1GcxDhHmebmQ0lMOP6IKUneyVkDWcEakv4vQRpKViXT5ar2YIJ1uoRvP3HcZAb0NnJRB B0zzoQFUcHB0CEqDaJ0FZfQynfTMhww0tQEiAA+hIUmcv/PBvKKtgKHGfeEclYNsHl1h 7zKMtlvNPrZNiJKxSz7bQjgyOC30GXmFiwn+vnO6FxKPFfWOXh1OrpZreXBshBDYPcMX kWhA== 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=7+Lzkni+UzPr6MqikVujqkBp7kBVk1cB+So4GEbxieo=; b=gUG9T+HyzxXqK6l06yvQ0qSizBnJvM1fyJH+6bM97+aWvAGmB66ZKEmOcH3o5d3omH 1jmWNmtQgedx/TbxAdu9CysoT19XdjomSeOwo5WFB+XlQAcIRpue9/n5P6v2Uxtt+dTX N2sZVbJa+YLP+kkGn9ur9HywDDzNk05sN0EkjY3gzOvSuaOna/Zuj0/YIWdgCO1tSMHV gZ2ym8GUVm/fpfYfuuaYfdzUFknRSqSOmsYo8AAiK/26oIAWL9RKxiWi7NQoWaaDz6Jf QKAh8/HgsYdj7tZShGPlhbr2PWy6Ba/DxPfbLYm7dWeVuR4YUNw9rcBLhdIeIqG1bskc pogQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nM3r90b+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si2820685pla.229.2021.10.20.07.21.56; Wed, 20 Oct 2021 07:22:11 -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=@kernel.org header.s=k20201202 header.b=nM3r90b+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbhJTOVd (ORCPT + 99 others); Wed, 20 Oct 2021 10:21:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:56868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbhJTOVd (ORCPT ); Wed, 20 Oct 2021 10:21:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9D79061373 for ; Wed, 20 Oct 2021 14:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634739558; bh=fmi+0bD2m3tiuIJS1w2in+x3YNM1wstFL0HPNrVRe8w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nM3r90b+dwpLL60m0jQscBK0+9Dy10kOWm8uy3/ZKXvif0JDmcnttvbMSqaGcQdLD 2pHlz2QbN3JzW7UNHBX4lhtaqgzf4U+qF4SQVX3zDuZ8+rVuUlWEqHDf9CPhyrNgBQ Xx0AId1V0cQVBKlDBQo3+/XzyWBC71teBm/ATWEkXVDIvs6Ll5RwJUtvSP/mxugprK 82HFFUsNi7APytpsZdVE8PQH20BU/jU8siZjU7+ozj15+Z6RWZNh7Se5vYoDj/HPzY ebPRveXrldpuKIXDineCR7swtCwqJSh7qhdme95Q+y+qweD8vRoWoZzrN099ojeNxO WucXNcR8pUNpQ== Received: by mail-ua1-f54.google.com with SMTP id q13so6958548uaq.2 for ; Wed, 20 Oct 2021 07:19:18 -0700 (PDT) X-Gm-Message-State: AOAM530XzF5k61WQ5ZJ0fuONqR1lw2jDkK9+pMzZFZDnvgoMGlioOKSe FG2OyKnfjtkha2rPVqrEsYl7NQpa/zNLIC3uJA8= X-Received: by 2002:ab0:5b59:: with SMTP id v25mr7354848uae.57.1634739556855; Wed, 20 Oct 2021 07:19:16 -0700 (PDT) MIME-Version: 1.0 References: <20211016032200.2869998-1-guoren@kernel.org> <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: <875ytrddma.wl-maz@kernel.org> From: Guo Ren Date: Wed, 20 Oct 2021 22:19:06 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V4 1/3] irqchip/sifive-plic: Add thead,c900-plic support To: Marc Zyngier Cc: Samuel Holland , Anup Patel , 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 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? > > M. > > -- > Without deviation from the norm, progress is not possible. -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/