Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp690186imm; Wed, 25 Jul 2018 04:38:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe0M2ro9buzF9+tRkz3TS8x0qG2vvcPCsMBEwRTVLc9rUKPqkaQzpV2skVhMa7F5ZwblgFG X-Received: by 2002:a63:e0b:: with SMTP id d11-v6mr20338160pgl.134.1532518702675; Wed, 25 Jul 2018 04:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532518702; cv=none; d=google.com; s=arc-20160816; b=oBwCntj5El1XQFLJjPJ01Eje5Veq6FcUyD3rhQeziV3iI6n8rclkwawTcUQzjioivC +mEbaPxddSNP5tHaDOjLv3ebK/M3UY8RGwya/29meOAgV5eUoRKwNS/Vno0vyEqsjcqa G7jfGGRqy+kMcp4JkdvkGlWDMsYSRvuoiQt6Tug+L7sF+nXz+6ufqgGzeIsurJsusUK8 hIVSEk3Q/MwxG/+djV471nLT47DSBbohB5ZcRKNnbuQ6J/9QOInz2NuS6BGO0BO4bvX+ dnE8aE3YzIrnuooDrnB0r4lGqNbLNpHOGQoMxKSe/q9yj126SOyAtHOU71icrd3kyfPC z2HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=n28BNKpFTenhpynlOKuipi3KYARS69gcdFGIlqZgo3o=; b=UZFiV68iyc24XG/inK8AMEi9DVLJKwmy9wLvNj6YLsBsIE2DUUrUKdo0fsCuWPoAHz 3i9ReHrXeUrCGIanOnyDYbMgKSuSI+fAX5S43N6Qwv7MbMPkQeol56NFnQKUeV/GVKfU AYFEoWB3dr516bp6dp3S5cYDwm8hxUdgsHy3agoglFL53dTOeQ2qb2t3ouEsdpTOsYN7 Kp/CvcadaZQXcTZiKl/qg4wMLS1m6Iv80Z3wXSPnpa+kFweLhkq1Pwv1wkNyXmudz4OB QrxJUErkuCi9uGCmwZkURtu5D2dUKNCiO84kmC7FMTpZ8C1z3fq2DlhzcVZF9bQt01Ms BlGw== 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 q90-v6si14097558pfa.272.2018.07.25.04.38.06; Wed, 25 Jul 2018 04:38:22 -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 S1728791AbeGYMsb (ORCPT + 99 others); Wed, 25 Jul 2018 08:48:31 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37156 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728670AbeGYMsb (ORCPT ); Wed, 25 Jul 2018 08:48:31 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DA96F80D; Wed, 25 Jul 2018 04:37:14 -0700 (PDT) Received: from [10.4.13.119] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC69D3F575; Wed, 25 Jul 2018 04:37:12 -0700 (PDT) Subject: Re: [PATCH 3/6] irqchip: RISC-V Local Interrupt Controller Driver To: Christoph Hellwig Cc: tglx@linutronix.de, 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 References: <20180725093649.32332-1-hch@lst.de> <20180725093649.32332-4-hch@lst.de> <20180725112457.GA24502@lst.de> From: Marc Zyngier Organization: ARM Ltd Message-ID: <53518395-83bb-9c2f-bd96-287cc83a1c63@arm.com> Date: Wed, 25 Jul 2018 12:37:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180725112457.GA24502@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/07/18 12:24, Christoph Hellwig wrote: > On Wed, Jul 25, 2018 at 12:18:39PM +0100, Marc Zyngier wrote: >> This feels odd. It means that you cannot have the following sequence: >> >> local_irq_disable(); >> enable_irq(x); // where x is owned by a remote hart >> >> as smp_call_function_single() requires interrupts to be enabled. >> >> More fundamentally, why are you trying to make these interrupts look >> global while they aren't? arm/arm64 have similar restrictions with GICv2 >> and earlier, and treats these interrupts as per-cpu. >> >> Given that the drivers that deal with drivers connected to the per-hart >> irqchip are themselves likely to be aware of the per-cpu aspect, it >> would make sense to align things (we've been through that same >> discussion about the clocksource driver a few weeks back). > > Right now the only direct consumers are said clocksource, the PLIC > driver later in this series and the RISC-V arch IPI code. None of them > is going to do a manual enable_irq, so I guess the remote case of the > code is simply dead code. I'll take a look at converting them to > per-cpu. I guess the GICv2 driver is the best template? I think you can do a much better job than the GICv2 driver ;-). You have the chance of a clean slate, and no legacy (or ACPI) junk to deal with! I think this is just a matter of moving the HLIC declaration in DT to be outside of the cpu nodes (you just have a single HLIC node that is valid for all the CPUs in the system), and making the interrupts percpu_devid in your mapping function (see gic_irq_domain_map for reference). Thanks, M. -- Jazz is not dead. It just smells funny...