Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3914059imu; Fri, 18 Jan 2019 21:29:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN7IpVh09j1bk/k1y4GZB4hzc1cqOUgnttw+W4KJCXSuZjDb1p3x3Nag6IlWeay0KgmevYta X-Received: by 2002:a17:902:c5:: with SMTP id a63mr22151012pla.267.1547875799691; Fri, 18 Jan 2019 21:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547875799; cv=none; d=google.com; s=arc-20160816; b=efRj2bG51QqYdu6Gm+JwiygbDvkR54F25CEjcBzgOTvMqiv5pdF49Gk0g4NITQSg+P NyAh0dpwCFFHKJM0dW9RwKqccNrHGOgsmVI6HmFNPruz2BhAoHGK/48qf4TX7oYLQNtX F36s7Kr5D42Yjb5pPaV3LlyKRkDI773WJPZMYc0lla66MyCOL8ER2+Q6+9pU+Pes/g9V fmN34ndDO93mzBjeDI3szNCo/WxzwaYWSWEKgekxPWkyVhGTWDARkrye8FCaEfLl8gtg +5OZdV7P2gQOJM8p+US+ruo1MG20WYtc6fRbqjbJJ8DQBN9xy+iLFWdMJ6VVzgJYn458 Ppwg== 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=S5WLHKm1UldARquTGB6XuPGzuMNSMkWoRTMN9CVKI/w=; b=vbeuyWTweCKnWcx6SiwZl7bQOq0hF+bPsjX37xIWEz3fGcpqYOKYXOKhNCtlcuusMp Z1q8RhyglRv5UuNpwcFrdiwupn6vXvCoTxL+inuUPisPuylLqEj1B7agCgxWoJFgAOc5 JkqJhxOy35F7YPaR2FZ2BYR823+Pe+qMI9JaQkNyuTH2VCD7gzqPEKm/woQiS/nXHsaK Un2ZY28l33EBz8FZz5erqbL/NItBRdFTtws2SIl4ZkdKTpxZg1hL3rrCIwFQqWcmNXzb U3dh3ShDs/Rtb+xHtHY5FDAFJS8JQoZyAKiNDLDPurZHWjHYTLHNuO60RJgx9hvToZor +eig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=EKUexgRx; 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 d2si6495400pfe.159.2019.01.18.21.29.15; Fri, 18 Jan 2019 21:29:59 -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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=EKUexgRx; 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 S1726719AbfASF0N (ORCPT + 99 others); Sat, 19 Jan 2019 00:26:13 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44209 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbfASF0M (ORCPT ); Sat, 19 Jan 2019 00:26:12 -0500 Received: by mail-wr1-f65.google.com with SMTP id z5so17431594wrt.11 for ; Fri, 18 Jan 2019 21:26:11 -0800 (PST) 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=S5WLHKm1UldARquTGB6XuPGzuMNSMkWoRTMN9CVKI/w=; b=EKUexgRxQOa3l+/0BWMsjZDhFsahNG3htOdWMBQshY+zSyrbzlNtNVuLI8l1NMF64f ZuI9t8ruKJ6eIB6sUfg3Fu1I1XGrEOitLDS/vEB0xEy3gpMSTF4Yi6oTZyyNnREehEWr yhxzE6Viob6I87vxJH8ssA4IWjfqieA//B9EC2QWcAcYnUvaWafo91M/rWjiwUhnqMJK ABbzoU5leiZkmBka2yAUBTgX2aabrK+bZqYHdPyCxYJpSYEa9KB/0MDmCTKKs3yvswP5 55wCnt3VKdJhCQg3nn3LVnEdF2cZKtNOmrl9oys0wX73P5ibXAnriFnhT4a/cbsfi7Er qeDw== 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=S5WLHKm1UldARquTGB6XuPGzuMNSMkWoRTMN9CVKI/w=; b=mDWMcJlhN+X6Jf87UglEXSUO/bt/OcIphLEenpfl/R9sGNEousClw4Gtg3kS0uNYhB QXXznBA51wo1nH3WJQFe2JctIHPTtw/15Pj64hnIrF2M8pymnVke+t0yz1CV8vDpi/3W 92H+8deiPl7n7j5ye3okU/ZlK2OYR4lZum8IGv+GtTqhleHzFxIG8UKSiLT+VjiSsqk1 UIDpakfAILaIUIrkrRpQ1LnpGxrlqu7GxqN9cLzKyW4ZCI1XS0sBA/i0lbILj4LeBp31 vjZL0dlsLOI0Jrzg5Ors2QHqWw+raBxLjZdxDi/MnYTA6gmtdo1ZznEiQ3wK0wYhkBbO e48g== X-Gm-Message-State: AJcUukfKb0lObuZTmpTI7IaUkpmR0C9xlfVoycmmXlMFP2obOQwgw/pH 0OziDTQheXPkou5kL85CvrBcikZn1x5KlPJkldHdAA== X-Received: by 2002:adf:f5d1:: with SMTP id k17mr20570188wrp.59.1547875570759; Fri, 18 Jan 2019 21:26:10 -0800 (PST) MIME-Version: 1.0 References: <20181227111821.80908-1-anup@brainfault.org> <20181227111821.80908-5-anup@brainfault.org> <20190115155600.GC13095@infradead.org> In-Reply-To: <20190115155600.GC13095@infradead.org> From: Anup Patel Date: Sat, 19 Jan 2019 10:55:58 +0530 Message-ID: Subject: Re: [PATCH v4 4/5] irqchip: sifive-plic: Differentiate between PLIC handler and context To: Christoph Hellwig Cc: Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner , Jason Cooper , Marc Zyngier , Atish Patra , linux-riscv@lists.infradead.org, "linux-kernel@vger.kernel.org List" 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 Tue, Jan 15, 2019 at 9:26 PM Christoph Hellwig wrote: > > On Thu, Dec 27, 2018 at 04:48:20PM +0530, Anup Patel wrote: > > We explicitly differentiate between PLIC handler and context because > > PLIC context is for given mode of HART whereas PLIC handler is per-CPU > > software construct meant for handling interrupts from a particular > > PLIC context. > > > > To achieve this differentiation, we rename "nr_handlers" to "nr_contexts" > > and "nr_mapped" to "nr_handlers" in plic_init(). > > Not sure what this differenciates that we previously didn't. As far > as I can tell it just is a slight naming cleanup. There is a disconnect between PLIC documentation and PLIC driver. If we have 8 HARTs then we can have 16 PLIC contexts whereas PLIC handlers (SW construct) are always same as number of HARTs. In other words, there will be separate PLIC context for M-mode and S-mode of a HART. Linux runs in S-mode so we can only use PLIC context meant for S-mode. This means per-CPU handlers in PLIC driver only handle PLIC S-mode context of a HART. This patch makes PLIC driver more readable and matching PLIC HW documentation by differentiating between PLIC handler and PLIC context. Regards, Anup