Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1952096ybm; Sun, 31 May 2020 03:55:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZvaBcmZWZxHGMIKZ7NvpSC2+STp6QmCWmfXrARysRqWpaF7Vy31PgkU55hHWP+mjU4d0T X-Received: by 2002:a17:907:4240:: with SMTP id oi24mr683428ejb.127.1590922546788; Sun, 31 May 2020 03:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590922546; cv=none; d=google.com; s=arc-20160816; b=nlBYAqayy4d09pThXxe/8hsfZDyT3BXLEYbKxFNqnoWA7bkO3u4ZEQHcBPQJyqySPz SADsipxWJa/NhFLc01yqkvorQZp7m8xqQxGxTh4SDjRtTRpcMo9QPNDKYPdLUd8b+Jzk g1H/Rolh4aloRI6Z/0DZrhFXn/BAFwlOfLByEptmbRqMd5jfMudCjC0jskb4gY3NVnR/ yiDsd4BQ4kWXACDp2gscn+JVqbeW1s0VhlU3fIO51sSaGqTvnP7WwPOSJaKn+ystK5XQ 0QDj9++ZGOQMs4t4ft1rOMDEShZeoNr7ubEepmT/YbhVjBxARfsifxKRrwAGTiCznUnH aRxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=4aCqTrXmmcbMuK15JiRN6ZR8INpmlbAqy7bTPEXkHco=; b=WYeIXkwsFuHwhYrgDhz+kiPskf5Z63gkcJO6l1IRQqN5UHLala7HcLHxfDkuxWFRDC 6+oIVUHhlNy1/nss+HvkknmURzyKPL/MVpQ9nZnQA7tyt3yqdW4GH1FEfxfCZMYsW9wa y7PDQq/5cdr9Tpvm0kHNX7f5giNoP/IrUXADdSwTqgW8PY7+cM4luOEesE7XNc2eJb9g p5L/XPgs8DkxH9JPk87rY3rzffEsRl/FhMKeztNpafmTDe9j+neSL9AjeJT4Gi0o8t/D zaTTFMfAUmPmXdTc648ZWOr4d4eqkjtRKZVah1/6Fdypow/2RdaYJ54NAw0twczueNDc H8pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WtBH4tp1; 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 bi26si9321144edb.82.2020.05.31.03.55.24; Sun, 31 May 2020 03:55:46 -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=default header.b=WtBH4tp1; 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 S1729603AbgEaKxU (ORCPT + 99 others); Sun, 31 May 2020 06:53:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:55010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728288AbgEaKxT (ORCPT ); Sun, 31 May 2020 06:53:19 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 03F7B2077D; Sun, 31 May 2020 10:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590922399; bh=cDOXdwIRPzfH77hpV1aQ9G8n49HhGcsjIyovyaKeb+c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WtBH4tp1jQ3zoPFoW5sVLnr5DlAebaJW1Jqvqx9RZleEKQqYO59S9Iw56TfIRvmHk syWHSxJjmb2nhRRmMa7RRkKG8UfncPQPV4eUS/b3MBdd05qCcYe3BXcyVA2giihB5R kXhpyuHSiWdmTrp8g/OBOdv9aZatKNa7amVlz228= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jfLaf-00GfrJ-IT; Sun, 31 May 2020 11:53:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 31 May 2020 11:53:17 +0100 From: Marc Zyngier To: Anup Patel Cc: Anup Patel , Palmer Dabbelt , Paul Walmsley , Albert Ou , Daniel Lezcano , Thomas Gleixner , Jason Cooper , Atish Patra , Alistair Francis , linux-riscv , "linux-kernel@vger.kernel.org List" , Palmer Dabbelt Subject: Re: [PATCH v6 3/6] irqchip: RISC-V per-HART local interrupt controller driver In-Reply-To: References: <20200530100725.265481-1-anup.patel@wdc.com> <20200530100725.265481-4-anup.patel@wdc.com> User-Agent: Roundcube Webmail/1.4.4 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: anup@brainfault.org, anup.patel@wdc.com, palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, daniel.lezcano@linaro.org, tglx@linutronix.de, jason@lakedaemon.net, atish.patra@wdc.com, Alistair.Francis@wdc.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, palmerdabbelt@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-31 11:06, Anup Patel wrote: > On Sun, May 31, 2020 at 3:03 PM Marc Zyngier wrote: >> >> On 2020-05-31 06:36, Anup Patel wrote: >> > On Sat, May 30, 2020 at 5:31 PM Marc Zyngier wrote: >> >> [...] >> >> >> > plic_set_threshold(handler, PLIC_DISABLE_THRESHOLD); >> >> >> >> Why do you need to both disable the interrupt *and* change the >> >> priority >> >> threshold? It seems to be that one of them should be enough, but my >> >> kno9wledge of the PLIC is limited. In any case, this would deserve a >> >> comment. >> > >> > Okay, I will test and remove "disable the interrupt" part from >> > plic_dying_cpu(). >> >> Be careful, as interrupt enabling/disabling is refcounted in order >> to allow nesting. If you only enable on CPU_ON and not disable >> on CPU_OFF, you will end-up with a depth that only increases, >> up to the point where you hit the roof (it will take a while though). >> >> I would keep the enable/disable as is, and drop the priority >> setting from the CPU_OFF path. > > The PLIC threshold is like GICv2 CPU interface enable/disable. Looking at the documentation[1], that's not really a correct analogy: - The PLIC is far removed from the CPU, and is more akin a GICv3 distributor. The INTC itself is more like a GICv3 redistributor, as it deals with local interrupts only. I don't see anything in the RISC-V architecture that actually behaves like a GIC CPU interface (not necessarily a bad thing...). - The threshold register is not an ON/OFF, but a priority mask, similar to the GIC PMR (except that the PMR lives in the CPU interface and affects all interrupts targetting this CPU while this only seem to affect PLIC interrupts and not the INTC interrupts). You may be using it as an ON/OFF for now as you don't support multiple priorities yet, but that's just a SW thing. > Based on your comment, we should only program the PLIC threshold > in CPU_ON and don't touch the PLIC threshold in CPU_OFF. Right?? This seems like the correct thing to do. M. [1] https://sifive.cdn.prismic.io/sifive%2Fdc4980ff-17db-448b-b521-4c7ab26b7488_sifive+u54-mc+manual+v19.08.pdf -- Jazz is not dead. It just smells funny...