Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp179842ybg; Sun, 31 May 2020 21:14:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8qIkqhNf3doQPrLpwsRd8B3mUcqPiiAGqNp2ShRDlNFUAG+pToRLm9a7B8fZcTlqEu2kB X-Received: by 2002:a05:6402:a49:: with SMTP id bt9mr19212857edb.300.1590984845103; Sun, 31 May 2020 21:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590984845; cv=none; d=google.com; s=arc-20160816; b=i4BBrgYVfoIXLdfi2LIE0SvehYANxCsG1G1sTGXqWciXPUflqzfB3p321AHgsl4UYG AhuxrOD/2FaVO2JhiMw4CEGiVzNJtPNUVJ5+UiBgoSlh9ZfmKFUxE/SA8iV9IPPtKITB /AH5riD2R08aTbBhtoMcGuJ+SL+nT/4wh5qf+k5Om29VKczssIR0p64cT6Cg7psAr2OO ISW+2nK/+mP4HSGZhYl2rg2ETmbgwp1WKL3Ka5cwrDYy+HqVpUjqKLOxELxxbwXiUnBs gpCv2pVIw11RUq8IKtsP3quK0eRXhyVI2EDF3c24ZuUOZMt4UtjNFM0PTmCtsCJ8viTx FMWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SDxsJqQtiN6qT4srwSvggU8FGCrRE9qkazQvrNm8wfM=; b=tvhG5cy0hOVmtOEFeljDrO42NgIcV8HO9cugcIsHgWYOPCv0aCE4bfboEIqqBMZqmf zBaFwLd6VLP6DgzRJKWyYreIi4dIGvtIxZSuJblGUgjE6C/sX86gthpm3p+2Z6/qg/Ru 8PvxyJSTf/z0rJESZac+E1bHq5k0KMyLAPUUU8ZcMhCFI7uyJ6ULazp2F6cAEiGDKK2h EKD8r3MIyIoP4erIPVFmS4jCgcXwgnJ/gWJX99yrjtHvoygh1NtPqx1Rlzxj6Hh+A50g veM+E7LHhxtXzP54k4F+/NvypDh5nLWbxfV4uDuVvbuAVJh/XE+2vXh4SOMV9Tz/mTlQ ZqLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=jknxIcNH; 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 dt1si2045714ejc.29.2020.05.31.21.13.41; Sun, 31 May 2020 21:14:05 -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.20150623.gappssmtp.com header.s=20150623 header.b=jknxIcNH; 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 S1725931AbgFAEJb (ORCPT + 99 others); Mon, 1 Jun 2020 00:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbgFAEJb (ORCPT ); Mon, 1 Jun 2020 00:09:31 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD8E5C08C5C0 for ; Sun, 31 May 2020 21:09:29 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id f5so9922933wmh.2 for ; Sun, 31 May 2020 21:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SDxsJqQtiN6qT4srwSvggU8FGCrRE9qkazQvrNm8wfM=; b=jknxIcNH2XQSSNADSiNUBSHeS3PF+O5g3LD87ZKg1H6TlAD0JXRYtW2TIbDZqzNFpl z6R9GNVtRO8obFFLI8YZNz9iQBPShTZdmMTBkeKi8wErxfL1rFeTK6rCGt7DhNGqYHWZ K8D4mxYOArJ+C6694FYqzOJ23r+YtXWb/ITfatn3AE/oPSaGqtPlAHUGdGfc8WB7jp9B Ba/+tIsl3cO4H33h1KG1vttcpU8w6Xu0oceZgFC9NIq7epa5eGptSZopF0bCf/ID31d+ +EzNXTS8MKYwnqPTZyG4Vnv+mr/91XjcdDg05caxGY2oF4NkShgxazFeL12UCwMUtP45 pzYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SDxsJqQtiN6qT4srwSvggU8FGCrRE9qkazQvrNm8wfM=; b=ZKnP36EBdlk2yAANwg01HuwxD8RlISqoyNc89+FGXL/ogxcmz0JSZi3ItPeJHt8sRB 16f7gZiaTJ7mU6CWllkhpKd4JwnOoVyQ0ZfVaAABtBa/RifV5wYGUZ/rBZ2mmfSLIsUu HL2qSRLRtP71IR0ZjRpDK54QXTzp7PCejCoTAUrDwefvOStpLnuhPnFZpjpj7YY34wwz 90pVcRZkmBaTnIrX2N0qQb14BYuijjokLMf8Y+mfifTxZPOKhbiP2cSS4nCu+Z6YPgPw A/flTb7l7GAWnvUj9C1jsg5WKMotYgBPSSsQCw98rqBt1uEcJTRdoI48ZbzXzL/f5Xiw +X8A== X-Gm-Message-State: AOAM5307i36jDmXU9uxVj3O1YfV8SiCPqVhm+gJ/DOlIj8EV7CtGQH47 k5HXz+5aNb+aPjiVAbA8KP0cHSjORL38O0aRO3nXTQAv5BU= X-Received: by 2002:a1c:a3c5:: with SMTP id m188mr8931300wme.152.1590984568220; Sun, 31 May 2020 21:09:28 -0700 (PDT) MIME-Version: 1.0 References: <20200530100725.265481-1-anup.patel@wdc.com> <20200530100725.265481-4-anup.patel@wdc.com> In-Reply-To: From: Anup Patel Date: Mon, 1 Jun 2020 09:39:16 +0530 Message-ID: Subject: Re: [PATCH v6 3/6] irqchip: RISC-V per-HART local interrupt controller driver To: Marc Zyngier 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 31, 2020 at 4:23 PM Marc Zyngier wrote: > > 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. Yes, your analogy is correct. BTW, PLIC does not handle MSI and does not have virtualization support pass-through interrupts. We will most likely see a new RISC-V interrupt controller spec for these capabilities. Also, the PLIC spec is now owned by RISC-V foundation (not SiFive) so we will have to rename the driver to "irq-riscv-plic" and will have a new generic compatible string "riscv,plic-1.0.0". One of us (me or Palmer) will send separate patches for this renaming. I hope you will be fine with this?? (Refer, https://github.com/riscv/riscv-plic-spec) > > > 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. Sure, I will update. > > 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... Regards, Anup