Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1348589imm; Sat, 4 Aug 2018 01:24:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcLsIfnpMVzOW29zuwgo9Ee/2xejwkWlYImxHOkw2nnxLkyW2BY42NvciUPwEoELMBLAewQ X-Received: by 2002:a62:401:: with SMTP id 1-v6mr8138114pfe.28.1533371075112; Sat, 04 Aug 2018 01:24:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533371075; cv=none; d=google.com; s=arc-20160816; b=GOspFVC4gkkRA6RaPlVMeJ+XqQKL7PmtMn7uR574Z5VvbmjeUKAiB7eh6L5LDV20yI 9MqrVrAZtih3tbfqsvP/ZClHgipsQEnRVuKhPdCKE9rjftyPfIOFa2ILazdW6weUVCqL ITj4y8Qqq6MyKEuV2S0xxKIHv09mlO0bk1mHw+RoFCfMGbbHUPdeGrB1eCfku5mJakFi IVUqW+zf2AIVnDS59qzJGgKyUocws+Dr7PbaFoSnMvPX8riEGrdVoryYrJH5eX9OFq3H KX1UJ/HWEO8/Fuhro/nCm13jvHo6Y7muFpPH/dQ67n/q9qlM6DueG+tUXvO/cOf+K/6y opbQ== 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=zuH45eV8g3jL25hbXcRUakFxl3qoecQ0TM6pAFPYkCk=; b=0IZRSDzpmTxZeq+ogM2bD89I7ja5EGVfEBEGbpY/RBYe1J1GFABgml11VG7gfDHJn4 r84gtERyEKaTdjNToVFmAzNb2yOWf7G8r4a4Q/yGD4v21HafHnXJ2grYES6XgqBy4lbP k55MdxS4AE2H5xAdDTgLHnfkvUfl8oLTPOZxMzx+LO9JN5ccVCFabPam/XDm3wELTj2R 1SqJnDO6PsNz66DdB4kz4U23Ct+et078ajgvwZaN3dBXC1SIxTZaNX3Oi2oV7wJn2jHO 3sKCdkA28ft8jKkHqlhvmOBGS2zV+T8OhcQJkMRDre4laRGIObvrCZ6NCxek0kEYLFq4 7sQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="j/uYPHtp"; 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 o12-v6si5044934pgn.556.2018.08.04.01.24.19; Sat, 04 Aug 2018 01:24:35 -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="j/uYPHtp"; 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 S1727038AbeHDKXU (ORCPT + 99 others); Sat, 4 Aug 2018 06:23:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36832 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbeHDKXT (ORCPT ); Sat, 4 Aug 2018 06:23:19 -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=zuH45eV8g3jL25hbXcRUakFxl3qoecQ0TM6pAFPYkCk=; b=j/uYPHtpkEKHpWP5Ay3nO/ZoZ OgDhPt+eit0nH5572w+eb4tkmoWGx0cCtpWBjoJW9YrC/CZXXrLczOnpz6bLZc+kV0XR2nS77fFa9 GzFIToKtqCeynCk6T56GbKVB1+78M7a3Vf7uKG6+Ec6r0B1+ovJqA4DRG6jzkzOS0MRpX5wZorvTn wlJD/tgSncchobDOiZrvj6SLxrmXu/Tc1WoWfd7SmYhJBZcfZQavwv1R0BaI1wXKFQ+mrXWL+s0Vg VHOs+9ErMZHYtlqG+rlFwyFwnn444jRAhaBZv27hIn4mvVgfHu7sjOygjzxFfgswlvVi0nqPSXDEC yEzl+SQMg==; Received: from [46.125.249.69] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1flrqM-0003dA-Np; Sat, 04 Aug 2018 08:23:23 +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 v3 Date: Sat, 4 Aug 2018 10:23:11 +0200 Message-Id: <20180804082319.5711-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.3 Gitweb: http://git.infradead.org/users/hch/riscv.git/shortlog/refs/heads/riscv-irq-simple.3 Changes since v2: - actually use SEIE instead of STIE in the plic driver - rename the default compat string for the plic to sifive,u5-plic - various spelling fixes - drop a superflous derefence in the plic driver that is taken care of by the following loop - drop the patch to document the enable method - not relevant for the rest of the series - drop the patches for the per-hart timebase frequency - not relevant for the rest of the series. - use riscv_of_processor_hart in the timer driver 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