Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1944006ybm; Sun, 31 May 2020 03:36:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw457CVP0ExQacpfQ30dIhW1FrSZqMLqPWvR03KR1Uh22Nb8gk3QCzSl51Uc6tgiMMhTFBb X-Received: by 2002:a50:a68f:: with SMTP id e15mr17054106edc.285.1590921371053; Sun, 31 May 2020 03:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590921371; cv=none; d=google.com; s=arc-20160816; b=l/w9XirwmOtm4AEktRIHg6ytgRvNLCd5ugrSenIYBuWeNx49rbVXYPscJ9YpD2wxH/ eBdmilGgDwrPBTeJ8YOyd/x2QktZm8wu8FVyYS0WOAL3CMFkOP+XKBcbA3vD0BeeG0T+ DPbUJ8HfR5D/28wcBv4tAKrYc1/avjzg+xZ0yB69SgI6sY6W4rOwKNz2h9GkZan3h7cc tPUZYW052MHy7ZguoQl0J2WGQ/WVu0BNbsti/tCJOT9tvWe7JePn157F5OZj1IN1nGI4 71OqNjXA1AhJnQ7kerILwnWgeaRGe4frukKgJwIPoOE+wNH6WMCbiPUnY06b4fjo4WC2 OgxQ== 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=2hPeXGDljymjoN8cxh2DsvjXD31g09/x8EqEDUlr2Cs=; b=a9VzlkJOIl8AI8incyO8V41FFerR8kxZ5BXFfVPxDYTOXmP/JVXFsK1G3CbxSQwYZP f3Vwcfglr+ju2rnbNOCgBLhEICuUZT/r3afReMZ05v7zt/ojHA2A7lWXcRw6vftLryZV vnkrWzFZxP4MfXgKr6npGiMBS4ngFvHNZuUsjcMHW21GD6QAH4G0GrZn62gVKVtsAjtI KNDZD34r/1FeFB4IW3WnX1btaw85oBqR0BZkQdZlZ8EV0K43zREjLdy+1gd+d1sE7+J7 uO9yTtGE2UDjWdM+pG56bQpLDHx4Pgo7zuwEkjMZXCoamR00+o3VdtrsuDjnEQDUPiw1 GvFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=gvLcAle4; 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 d13si8661902ejj.191.2020.05.31.03.35.47; Sun, 31 May 2020 03:36: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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=gvLcAle4; 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 S1728158AbgEaKGX (ORCPT + 99 others); Sun, 31 May 2020 06:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727887AbgEaKGX (ORCPT ); Sun, 31 May 2020 06:06:23 -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 8ABA3C061A0E for ; Sun, 31 May 2020 03:06:21 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id n5so8492172wmd.0 for ; Sun, 31 May 2020 03:06:21 -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=2hPeXGDljymjoN8cxh2DsvjXD31g09/x8EqEDUlr2Cs=; b=gvLcAle4FOVMTZ4Ko1hxhk71DlaCLYZJAMxcJeowYNUkUwx9IiyifHx+bndCRzZa+e T5H7XF44coZYUmYSArfEgHOm2BkVqv/w21FT5IHjZ9JZvVbYbI22oNC4S2J+mBzeMvE+ +sKfmYZQPInVjwtfuekdp7iKKZiPmjMgqnkTJPRCgYSVKKaPIGhKugNam2UiBQ4qjh2k YGOKYVpq13Sqx6O4BX4cXf5EZ4mK55gqpMJ7PhwFScqwrbXkOOUzFRstGmNdgBx1D/D+ rBiVKbCiIwrY6F9YoMrI32gMWskoTNhNerRFVRonGWOCCg9KTzZANIj1ibLzxUxh2BBx ccdw== 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=2hPeXGDljymjoN8cxh2DsvjXD31g09/x8EqEDUlr2Cs=; b=LnrDhfrrGvzkHEDx6/S8IP8tiGYuLVkVNRf7/HtMGZwTq3zAZWLM6Qiy/ztBqh9Qdy XxuVM6B5a7oSU7pt/reGw2GSx+nT3VcZZsz4COVyxwBIMvCaj+Lrwht6/IXb9XXVWGQe vgurC+Yd2aJHosQ2W0gemVZQwYwqO8AO6n/3lytZKKF6XQ/AtApbLjml2TFfJIZta9Ni QeTUiTmj65Zq7Rg/Me+VQEnIWjIrR52Mm5Vt44wx/2Yr1p5COKmGtYVbQMQS948+7yS3 rBizqEdB1eRRU/PsGNFHPcvUnIFlY08qSr2reRppTTFXrhqecFEFPj2Ro9LIIiHTKotF ZU4Q== X-Gm-Message-State: AOAM5328C3XwAm+PZ4EPZefSmfpsbzdoCsqDwqgs2ktH5vkwshBQo/X+ /Gal7MKF/etPJCJ+O1J4CjfJYw8UZKZtxaFQKzjDyQ== X-Received: by 2002:a1c:1b17:: with SMTP id b23mr16536717wmb.3.1590919580005; Sun, 31 May 2020 03:06:20 -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: Sun, 31 May 2020 15:36:08 +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 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. 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?? > > >> > return 0; > >> > @@ -260,7 +266,11 @@ static int plic_starting_cpu(unsigned int cpu) > >> > { > >> > struct plic_handler *handler = this_cpu_ptr(&plic_handlers); > >> > > >> > - csr_set(CSR_IE, IE_EIE); > >> > + if (plic_parent_irq) > >> > + enable_percpu_irq(plic_parent_irq, > >> > + irq_get_trigger_type(plic_parent_irq)); > >> > + else > >> > + pr_warn("cpu%d: parent irq not available\n"); > >> > >> What does it mean to carry on if the interrupt cannot be signaled? > >> Shouldn't you error out instead, and leave the CPU dead? > > > > The CPU is not dead if we cannot enable RISC-V INTC external > > interrupt because the Timer and IPIs interrupts are always through > > RISC-V INTC. The PLIC external interrupt not present for a CPU > > only means that that CPU cannot receive peripherial interrupts. > > > > On a sane RISC-V system, if PLIC is present then all CPUs should > > be able to get RISC-V INTC external interrupt. Base on this rationale, > > I have put a warning for plic_parent_irq == 0. > > Fair enough. > > M. > -- > Jazz is not dead. It just smells funny... Regards, Anup