Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1883558imm; Thu, 2 Aug 2018 02:39:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdae3fDGM+xJVbe0QqGdW19fW0pJkcv1/9xK6x8ajEBHkSIKLn/66dL4ncV61WRfpQrojKC X-Received: by 2002:a62:4add:: with SMTP id c90-v6mr2162543pfj.23.1533202782614; Thu, 02 Aug 2018 02:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533202782; cv=none; d=google.com; s=arc-20160816; b=dwSZKOiJQVQvMcjbVnUCSMN5S37pAI8VWvX/h89V/1CIJ+jNOy6M6YD0/pGoHxHnwE JGetaTzA5P5NUKzoThs5FXS7RfwcV8C+AIxb21ThQ3j2b1DoWXPtYu2xJeZUDEhFfqUr 8Heqo5gLb6E+a2yvqrMbK97PHMwJuLqSWyTh4wv3N+JbS8PSigQsE4hgqVbhRpueYm1x 91oUWjAmL4PlcN7P+VNvYaYbbFOhyIfW8oaybxqQmorQ4zbSPtpRcsRfTHeaI90ONity 6D4KPTzFe4l/MMZvlzY3zx5u6eZ7Z/JH6XCbfSEpx6SfPgSOVDveSBAiODDo3jNWWru3 +K7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=H6V+fhDd2pe4PmBex5E3j/rOX/zW03ZybUsMnCiKf5c=; b=Yoiy3R4cKGUX6W242dPmm9qAbwQ6Esd2k+Px8dMUN8rHYnTxMzVRCbANeerJJ7nxrp /+8lcOCvr+PFFHm0HVuRZ4U4nYKwVwDBhGzYOyYYiY5u9fUz6SSOsZhDGZ0QUvLKGhpQ 3iDev54KcOA4vlTgj+LpTwMKYfvslW3dy5zQGRqHepgYPJ+Lp6O4p6x6wz2K+kBKSQaU z1LHg9/0wxSeQ7qIioUrGBe6OkRTxMmYL1KxyG+Borepx5z9HukBep0pvyj6n1QStK58 HaPBAXS4ZkqEfaClkjJb5z0kZonZk3oNGKrOGDz5b3aQCKd0uMqBnhXzaCLpS9aXH+T4 ByNw== 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 g6-v6si1019385plo.280.2018.08.02.02.39.27; Thu, 02 Aug 2018 02:39:42 -0700 (PDT) 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 S1727517AbeHBL2k (ORCPT + 99 others); Thu, 2 Aug 2018 07:28:40 -0400 Received: from verein.lst.de ([213.95.11.211]:38796 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726238AbeHBL2k (ORCPT ); Thu, 2 Aug 2018 07:28:40 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 2CE5E68D64; Thu, 2 Aug 2018 11:43:00 +0200 (CEST) Date: Thu, 2 Aug 2018 11:43:00 +0200 From: Christoph Hellwig To: Thomas Gleixner Cc: Christoph Hellwig , Marc Zyngier , palmer@sifive.com, jason@lakedaemon.net, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, shorne@gmail.com, Palmer Dabbelt Subject: Re: [PATCH 3/6] irqchip: RISC-V Local Interrupt Controller Driver Message-ID: <20180802094300.GA14127@lst.de> References: <20180725093649.32332-1-hch@lst.de> <20180725093649.32332-4-hch@lst.de> <20180725112457.GA24502@lst.de> <20180802073452.GA11693@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 02, 2018 at 11:35:43AM +0200, Thomas Gleixner wrote: > On Thu, 2 Aug 2018, Christoph Hellwig wrote: > > The cpu local interrupt handling, which was irq-riscv-intc.c in this > > series and has been moved to arch/riscv/kernel/irq.c in my new series > > is split over a few control registers (CSRs in RISC-V speak): > > > > The exception handler, which includes the delivery of interrupts to > > the CPU is set up using the stvec CSR (Section 4.1.4). The vector mode > > mentioned there is not supported by Linux (and not by any hardware known > > to me), so ignore it. > > And even if it would be available then it would just avoid the software > decoding of the cause register. So no fundamental difference. > > > Once an exception has been triggered Linux reads the scause CSR > > (Section 4.1.10) to check the exception cause. If the interrupt > > bit is set we have three possible exception causes that matter for > > the kernel: Supervisor software interrupt, Supervisor timer interrupt, > > Supervisor external interrupt (ignore the user versions, I'm not even > > sure they are implementable, and they certainly are not at the moment). > > Yeah. I would upfront declare the user stuff broken and not supported. > > > To enable / disable any of these logical interrupt sources the sie > > CSR (Section 4.1.5) has a bit for each kind thast can be set/cleared. > > > > Also there is the sip CSR (also section 4.1.5) which tells if any of those > > is pending at the moment. > > So that's the low level per cpu interrupt/exception distribution mechanism, > i.e. a distinct per cpu 'vector' space with fixed functionality. It does > not make sense to actually handle that as an irq chip. It has absolutely no > relevance. The software interrupts are enabled when the CPU is started and > the external ones as well as they are gated by the PLIC. > > The only thing which might need to access the enable register is the local > timer interrupt. That really does not require an extra irq chip as the > enable/disable is really just at cpu up/down time and the magic happens on > the local CPU so no smp functional call hackery is required. > > The PLIC is the beast which wants a proper irqdomain/irqchip > implementation. And that is exactly what I've done in the repost. Local interrupt handling: http://git.infradead.org/users/hch/riscv.git/commitdiff/149ae0008effe80e1fb79444eb6a03c45bed29ba PLIC driver: http://git.infradead.org/users/hch/riscv.git/commitdiff/00f68341fa6dcda9b7c6c4da7eeb52d7ef933368 Clocksource: http://git.infradead.org/users/hch/riscv.git/commitdiff/51981cbba2fe2a118bb84b4c4aabb0f0d988ed2a I need to polish the DT binding a little more and will repost later today. > > Thanks, > > tglx ---end quoted text---