Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2004467imm; Thu, 2 Aug 2018 04:51:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcLpix+r6P/JNg94Rjf3vJVai38KpbPgd6T+TwPZm7JG/ppc2wgyFr8f//gfksfIqP3TNNR X-Received: by 2002:a63:6d0a:: with SMTP id i10-v6mr2285480pgc.215.1533210686921; Thu, 02 Aug 2018 04:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533210686; cv=none; d=google.com; s=arc-20160816; b=onPRRmxyb9Od1KPkBiMHqVeA6jWzpLOMvXMylLX9ftC/YU3OPJFpV9r0HRGQwzWwJh 43H2umaYkdDUxPpdUIGRNFCXKNENRIzKRRUpd2DkcKQ1uy0kUn7AUjoK9Oskw6HC2GZP Bhebqlgol1M6IJ6i3xJhKkM13HgDiSelF6M/xOaF3ftEjX3HqaTHOBMKcAxAvkpvyX/Q 0txybXT12BBdH5pZPISfAoxJlu7pkXJqMrJxSnIoiS9hKi9GJdsyTVINV5cZyGCfOiYi RkL7Xrn6JfycZxX5KaoMbvYWfn9c12dedx79sQLqDzQ9ctzUL3rprEzdHrSvqmeQrNNf XIBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=aHA6gJ2FWuxiQmv0T16TWa0X7hNjZi/xh46U2dJbhrw=; b=Dl+92HPO8+OhKcZfeUqkZ82iioR4Wj2/Rxc6mGHI7y+rgENG1uaM6j4GGch6ga7w+g LYjoLq3nzQFfZzPVDGvsDwv/rpmdEBR8p3Y8dDAylhSapNvO57rDJ1ySYf6rV1yq22eg F/ggfS1EMzO+9239DIs6Is3P735APatKb8EFubZsMVFuSRbFSJ0EPQq7Xca+elY8gfs+ s7er5wL5gjWjSLbvcj7/QxkLCRIoyRIAfCtIkYHe2GnE0fwAFiW8T3nsTaI4EOYREJun 5fle2rSBLpFeXh62FeP3mmBVcx+a0ePnQHVuYGENAEE4MQKj4QpPVzZhyjdQXcprf/CW cX8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=P27TN4r6; 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 u6-v6si1171253plr.437.2018.08.02.04.51.11; Thu, 02 Aug 2018 04:51:26 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=P27TN4r6; 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 S1732211AbeHBNlG (ORCPT + 99 others); Thu, 2 Aug 2018 09:41:06 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38728 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728685AbeHBNlG (ORCPT ); Thu, 2 Aug 2018 09:41:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aHA6gJ2FWuxiQmv0T16TWa0X7hNjZi/xh46U2dJbhrw=; b=P27TN4r60CRdLHz7woEZ/Am3+ CIyMkLiHptF7sC/zSR8nk3CYYBREtgBug3QwTNL9FJ5gZRZZwalofN+kqUxUBo0OcboDF/DCqy1bR 4Ke+54FYnDgcUKGPiFDmOn7/ZtkZ3TrS5JHsUmPWEiwtHLp7aRyd8OLTXbRhJPCNPXfxk+NtlX/ct oPBAKtEtspA/HV896MgJ7R3xRkADl1i+UvfRFQzYkc0iXl1utNRsZ7P+ZJgwMYZ3xyII+jQhwtlWs QS3fCL8vApjag/5No6Jq8yHGqHQtGstJp7yc2+fZne+JtjcQxAIWAamB8MSOkRpQC5IoQjfsDnPe4 DZH8YBRVQ==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1flC7P-00058M-Gt; Thu, 02 Aug 2018 11:50:12 +0000 From: Christoph Hellwig To: tglx@linutronix.de, palmer@sifive.com, jason@lakedaemon.net, marc.zyngier@arm.com, robh+dt@kernel.org, mark.rutland@arm.com Cc: anup@brainfault.org, atish.patra@wdc.com, devicetree@vger.kernel.org, aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, shorne@gmail.com Subject: simplified RISC-V interrupt and clocksource handling v2 Date: Thu, 2 Aug 2018 13:49:57 +0200 Message-Id: <20180802115008.4031-1-hch@lst.de> X-Mailer: git-send-email 2.18.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series tries adds support for interrupt handling and timers for the RISC-V architecture. The basic per-hart interrupt handling implemented by the scause and sie CSRs is extremely simple and implemented directly in arch/riscv/kernel/irq.c. In addition there is a irqchip driver for the PLIC external interrupt controller, which is called through the set_handle_irq API, and a clocksource driver that gets its timer interrupt directly from the low-level interrupt handling. Compared to previous iterations this version does not try to use an irqchip driver for the low-level interrupt handling. This saves a couple indirect calls and an additional read of the scause CSR in the hot path, makes the code much simpler and last but not least avoid the dependency on a device tree for a mandatory architectural feature. A git tree is available here (contains a few more patches before the ones in this series) git://git.infradead.org/users/hch/riscv.git riscv-irq-simple.2 Gitweb: http://git.infradead.org/users/hch/riscv.git/shortlog/refs/heads/riscv-irq-simple.2 Changes since v1: - rename the plic driver to irq-sifive-plic - switch to a default compatible of sifive,plic0 (still supporting the riscv,plic0 name for compatibility) - add a reference for the SiFive PLIC register layout - fix plic_toggle addressing for large numbers of hwirqs - remove the call to ack_bad_irq - use a raw spinlock for plic_toggle_lock - use the irq_desc cpumask in the plic enable/disable methods - add back OF contexid parsing in the plic driver - don't allow COMPILE_TEST builds of the clocksource driver, as it depends on - default the clocksource driver to y - clean up naming in the clocksource driver - remove the MINDELTA and MAXDELTA #defines - various DT binding fixes