Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp418737ybv; Thu, 13 Feb 2020 03:02:32 -0800 (PST) X-Google-Smtp-Source: APXvYqw1oPBO5+zGxNOJmBl+nTHZI+FVLVVFwdGEWxGg6Yfwr5/untSU+0walSsSgiT8BVrOc6NZ X-Received: by 2002:aca:3542:: with SMTP id c63mr2474098oia.135.1581591752655; Thu, 13 Feb 2020 03:02:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581591752; cv=none; d=google.com; s=arc-20160816; b=e28BY0LtbPsTs86WeEcUPQYDB470/heFCG3xV3H9F4AQGFHKAqtPc/f7szlSJWZcNo w3Q0qCAlzEe1qYd/WiMW4HmaxKka/yNpfDWQKv0LtwVIdahIAHcTEV2AHyDUQi8T3RGS w5EnDtITUgM7g62J5tHkSlmgs05qa4nmqOAji9y+iAN3rJAvnzHRmPvZBP+xaI28OIKa SHhg+DW8oz1GLGKWtNSCdzR1LOVOpgkx7zCV9xzIjhzhAQxDuG2Ec6D3YC0PfU5C3zV9 +7LjC13Dhr24/8aJjjmTN1H9x2JQSBIMMBNH9D32X/dsW2IzShu0QZ14VVNqBJu3taMi eApg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from; bh=ZbCVCsWtjaV6WQRwY8Rn/uEchVFjr3LoL9o0Yg5mTY0=; b=Qpl1JmanJhmPkW9dNyzYCBuAOAf4oEE3cfk/90r6t6lLfNYIn34tgSzd4YXw60BS3J s0FayfOqqlPZorxcXTnNegoseFdXfPvp66pg/Q52q9xFwAIleVj1d6TrPMscAoHswLN1 l+gR/On0W4EVqEc65ZhkhKudqGm00HumgIbpe4huOPBYguXTrYtWRvn4LXZ8ZwNAca5U RXfXsbd6Nh+sZABEECKkggLzNSIiku/XAH04rQFtIb8KsF7lk1pF54FR6awel7aYMUox /FRNiD6AfCPXgKPgWq/br+QyYuDyOVC6fZztWsgGJDi3mTOJC3xIMWdVTejOT4rFm/FH +0kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si949980oij.139.2020.02.13.03.02.18; Thu, 13 Feb 2020 03:02:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729572AbgBMLCL (ORCPT + 99 others); Thu, 13 Feb 2020 06:02:11 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:51565 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729511AbgBMLCL (ORCPT ); Thu, 13 Feb 2020 06:02:11 -0500 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j2CFW-0007Yp-CI; Thu, 13 Feb 2020 12:01:38 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 068BB1013A6; Thu, 13 Feb 2020 12:01:38 +0100 (CET) From: Thomas Gleixner To: Atish Patra , linux-kernel@vger.kernel.org Cc: Atish Patra , Albert Ou , Allison Randal , Anup Patel , Borislav Petkov , Daniel Lezcano , "Eric W. Biederman" , Geert Uytterhoeven , Heiko Carstens , Jason Cooper , Kees Cook , linux-riscv@lists.infradead.org, Mao Han , Marc Zyngier , Marek Szyprowski , Michael Ellerman , Mike Rapoport , Palmer Dabbelt , Paul Walmsley , Vincent Chen Subject: Re: [PATCH v8 10/11] irqchip/sifive-plic: Initialize the plic handler when cpu comes online In-Reply-To: <20200212014822.28684-11-atish.patra@wdc.com> Date: Thu, 13 Feb 2020 12:01:37 +0100 Message-ID: <87ftfe3g4u.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Atish Patra writes: > +static void plic_handler_init(struct plic_handler *handler, u32 threshold) > +{ > + irq_hw_number_t hwirq; > + > + /* priority must be > threshold to trigger an interrupt */ > + writel(threshold, handler->hart_base + CONTEXT_THRESHOLD); > + for (hwirq = 1; hwirq < plic_irqdomain->hwirq_max; hwirq++) > + plic_toggle(handler, hwirq, 0); > +} > + > +static int plic_starting_cpu(unsigned int cpu) > +{ > + u32 threshold = 0; Pointless variable. Also you use PLIC_DISABLE_THRESHOLD down below, so please add a proper define for enable as well. > + struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu); this_cpu_ptr*&...) The callback is guaranteed to run on the plugged in CPU. > - threshold = 0xffffffff; > + plic_handler_init(handler, PLIC_DISABLE_THRESHOLD); Thanks, tglx