Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp871517ybv; Thu, 13 Feb 2020 11:05:08 -0800 (PST) X-Google-Smtp-Source: APXvYqzxBjdTup3mR7R/z8tRPFV8YHhnjwFQXob/rLaXAabLHdh1Cs29DcG97ddCpZTvOslbvypU X-Received: by 2002:a9d:66c1:: with SMTP id t1mr13206431otm.73.1581620708756; Thu, 13 Feb 2020 11:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581620708; cv=none; d=google.com; s=arc-20160816; b=vV6NZ46FdoedJADRfUOmakCf4SQrScafRExwZm2TZHvHGhQTVtuFwjWtyxed0ETmc6 tWny9bCS2qOWAx/IANtutUp5B+ziQisrQImwoKO4Jr0FXwwJFyw0CXxH9Mmj1B8uUwx2 YMUL1Lkk6xHq7tw+vuGWQOmyeaqnkdImTISC+Q3/Nv8MorySG4RcGdb7PFAk3JsfU4/6 Os0mEGvoRxFSKubJmfcw7gjRDtrtfiSMJchAmQMiAtaFFlZDnpEOtyFJCGDPwDq8tK4S R1VWe028H/7AkKGA9S+dVmv7XM/0hNZzebcNBNIA2tjYBsWgOya944BL/+Dc5akV0EP8 h+Sg== 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=dn/tfISxJoEgJnzBpyA8uxc0Qgp5ipdz2fWVodey7ek=; b=tzVNdPRNbqxCmi+EroNeLJuJVgJ9H4V7i3ODeUoNmIWYbB0ID1HWXcPi5S5nnqJTX5 epPfhJOSjs/fIuvNCgs85Z+26nUeMSaUIDMkrR9xe/8T9Y+T7/K9XoHNxISM+1Fg45sL D8iw3kRkXlw5zx6X8fiPNgZ7qSSPKkZn//b2tS3quPJxr9mMxovo+nwQX2A4y5x3b1ya xMlEbc7I4GJ9Suq5/rUYJmG9t52I/hUsmzwp0CbtNFsM/Bpqgp5jvfYsAgjm0m5JzKtq Hjs8suoP5m4u+X57FDLsX6cgBCFnSD0ZgMb2qOmcIVWgSmJ2ZEqKmTJajPudkWfzXOsW SfIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b="FvsUf/SD"; 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 w20si1522472oic.103.2020.02.13.11.04.48; Thu, 13 Feb 2020 11:05:08 -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; dkim=pass header.i=@atishpatra.org header.s=google header.b="FvsUf/SD"; 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 S1727806AbgBMTBu (ORCPT + 99 others); Thu, 13 Feb 2020 14:01:50 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40878 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbgBMTBu (ORCPT ); Thu, 13 Feb 2020 14:01:50 -0500 Received: by mail-wm1-f67.google.com with SMTP id t14so7960812wmi.5 for ; Thu, 13 Feb 2020 11:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dn/tfISxJoEgJnzBpyA8uxc0Qgp5ipdz2fWVodey7ek=; b=FvsUf/SD1XtJK8Wv0KC5LO+bJJrBnNL1zUODU1QXFKPaNQRfcb558edoDGX+tpbCkK +kHZ2AmiXYJdzjGVZ00LnSFk8Mz48I2UBSQLZpTPhYwKkdZfCxRVfhkWF3lHzMiRqT5A QAyIyXJaxFK6g4ZVmDQhUxoYLDBpGhw8UUEZNVtncCvNnesYT0IpuRmG3hl/iH5sm/ZM lpYnUr5luOuM9iHi9pKW54m3c+9hX4bGfcXaoR6j2pj3gFk4kC34PNxxzVhDoteoij1K Y50hRut0NDEO83w2ngofXVI2FPnMAFURWMuwL2nDwkhFwz18DLA4KOa1QAnbLR5Whypu Am+w== 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=dn/tfISxJoEgJnzBpyA8uxc0Qgp5ipdz2fWVodey7ek=; b=RRLHOOjp+ZYhwkCnzaYHhwpDSJXHrpdv9pDi1ub845hD/eqPPYPOuQrkt/rGm+bwl+ Yxj3eQ4rFNaiv/MUmBX5CKs4gOLklXvtWeFrOi3woelj25Sdlt03NRkYKgCcyb3RTZQ/ bNrROIYwbWGJfN7Ydrej3RB+M7/UzZVAekVQS7JEqXa3Zrpip52arbs7zhAIw9HogZio nft17utoQaZLYTIHZS6M7S1kksk1xdG4oRP3UvhmhT+KdjkADCu6fbgKsGGuhJ1Ln5h3 WFXJeZXNhMdIkTXST1mXkJNU2B3OWCeV/ZpkddBFeKGaKntwBXNKJcd9UQEpIvPG8ZaV X9RA== X-Gm-Message-State: APjAAAXQYds+Kul1GViBtZkjmdTA5Vh+dLFzACOQPJhpRp5wgMbiZumd VGFyUw+virPJgSKdkyZr1JaypBWzYhkPYOO+twEG X-Received: by 2002:a05:600c:2215:: with SMTP id z21mr7230678wml.55.1581620506752; Thu, 13 Feb 2020 11:01:46 -0800 (PST) MIME-Version: 1.0 References: <20200212014822.28684-11-atish.patra@wdc.com> <87ftfe3g4u.fsf@nanos.tec.linutronix.de> In-Reply-To: <87ftfe3g4u.fsf@nanos.tec.linutronix.de> From: Atish Patra Date: Thu, 13 Feb 2020 11:01:35 -0800 Message-ID: Subject: Re: [PATCH v8 10/11] irqchip/sifive-plic: Initialize the plic handler when cpu comes online To: Thomas Gleixner Cc: Atish Patra , "linux-kernel@vger.kernel.org List" , Albert Ou , Jason Cooper , Vincent Chen , Michael Ellerman , Anup Patel , Daniel Lezcano , Heiko Carstens , Mike Rapoport , Mao Han , Geert Uytterhoeven , "Eric W. Biederman" , Paul Walmsley , Marc Zyngier , Marek Szyprowski , Palmer Dabbelt , linux-riscv , Borislav Petkov , Allison Randal , Kees Cook 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 Thu, Feb 13, 2020 at 3:02 AM Thomas Gleixner wrote: > > 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. > Sure. Will do that. > > + struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu); > > this_cpu_ptr*&...) > > The callback is guaranteed to run on the plugged in CPU. > Ah yes. I will change it to this_cpu_ptr. Thanks. > > - threshold = 0xffffffff; > > + plic_handler_init(handler, PLIC_DISABLE_THRESHOLD); > > Thanks, > > tglx > -- Regards, Atish