Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1208956ybh; Sat, 3 Aug 2019 20:39:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZdb/pqICJA5MPtYdlvpRK7dNO/RoKF6ZPY3aXes6H+gKKEDth8GHCgrNwjS2SIoSQzI6j X-Received: by 2002:a17:902:e512:: with SMTP id ck18mr131291153plb.53.1564889995830; Sat, 03 Aug 2019 20:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564889995; cv=none; d=google.com; s=arc-20160816; b=O4VdJxmcyW/CeGR2zS3dqI06BuNp/vgdRRQHUSXKXm+w+twFdadJ7NXXYLBJgNtJUl GldcFxj8YIJY87mW/XIReYL3aCtVUkqXr4p3aROvu/Tu8FfK+SbhCXtrlRCoRcB3+WSS 6s9zO8IMTA2mPBrCJazpcJF6KJipzWWrmOJnzyiA37lnewqzW5JmdMlgVYexgbFQdUu5 XztXvCCZUTXzgwkSxGFwyJCXcxSeBe+jyzCWd1nBmfp10p8hVuK3BjGEBkit+ZKogqko pecEzled0Cc1vuysZIb7QIeRbfoRN8c/N24sMOjuoYrzl4g9B1ypo13VTVF1j+dk9FXX +Rcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:user-agent :references:in-reply-to:subject:cc:to:from:message-id:date; bh=okOcnsHn3gYJbTwCBv7zZ1hWoaAA+MXyItl/fkPUAe0=; b=qwFYvXaRy2fKfrWz+snaakam0aaF7AiyMTHJbjh3RKpPCg0K1sReHgb+tRXnxcum+Z ms/TJQ9doGiykYAI/wxqUEvTGgnD9kVuFTWyxT7g5HoF04NKVwAhlIL4qCkoiwBGe/TU dhcIWCwsxQ8Y0laRU8XY24K9fBJKeMVuWDrWj51uWOyEp8YeoOuomIPqd5tsgYV4Eogz CbUQVstnufwtfUDVi25PTMMxIky5O2IGoWtY7VmHryr1JPNUEsyRd4z0fAIQyHjuyxWa lEE3Cfcd/FD+H3MIkSn+T5/5HTRvdPIAdwXO+PEJdFi/hnJ0jrUrMQZKU581EclAIwCu w21A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v24si43171355pgk.509.2019.08.03.20.39.40; Sat, 03 Aug 2019 20:39:55 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388054AbfHCJMx (ORCPT + 99 others); Sat, 3 Aug 2019 05:12:53 -0400 Received: from foss.arm.com ([217.140.110.172]:59726 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387945AbfHCJMx (ORCPT ); Sat, 3 Aug 2019 05:12:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BCF71344; Sat, 3 Aug 2019 02:12:52 -0700 (PDT) Received: from big-swifty.misterjones.org (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 41F533F694; Sat, 3 Aug 2019 02:12:48 -0700 (PDT) Date: Sat, 03 Aug 2019 10:12:49 +0100 Message-ID: <86o916mx2m.wl-maz@kernel.org> From: Marc Zyngier To: Martin Blumenstingl Cc: tglx@linutronix.de, jason@lakedaemon.net, ralf@linux-mips.org, paul.burton@mips.com, jhogan@kernel.org, robh+dt@kernel.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, john@phrozen.org, Hauke Mehrtens Subject: Re: [PATCH 3/5] MIPS: lantiq: add an irq_domain and irq_chip for EBU In-Reply-To: References: <20190727175315.28834-1-martin.blumenstingl@googlemail.com> <20190727175315.28834-4-martin.blumenstingl@googlemail.com> <86y30imq9p.wl-marc.zyngier@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: Approximate MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Martin, On Thu, 01 Aug 2019 18:42:42 +0100, Martin Blumenstingl wrote: [...] > > > +static void ltq_ebu_irq_handler(struct irq_desc *desc) > > > +{ > > > + struct irq_domain *domain = irq_desc_get_handler_data(desc); > > > + struct irq_chip *irqchip = irq_desc_get_chip(desc); > > > + > > > + chained_irq_enter(irqchip, desc); > > > + > > > + generic_handle_irq(irq_find_mapping(domain, 0)); > > > > Having an irqdomain for a single interrupt is a bit over the top... Is > > that for the convenience of the DT infrastructure? > yes, I did it to get DT support > please let me know if there's a "better" way (preferably with another > driver as example) To be honest, the chained handler is what troubles me the most. You normally would use such a construct if you had a multiplexer. In your case, you have a 1:1 relationship between input and output. It is just that this irqchip allows the trigger to be adapted, which normally calls for a hierarchical implementation. In your case, with only a single interrupt, it doesn't matter much though. > > [...] > > > + irq_create_mapping(domain, 0); > > > > Why do you need to perform this eagerly? I'd expect this interrupt to > > be mapped when it is actually claimed by a driver. > I don't remember why I added it, it may be left-over from copying from > another driver > in v2 I'll try to drop it > > > > + > > > + irq_set_chained_handler_and_data(irq, ltq_ebu_irq_handler, domain); > > > > And there is no HW initialisation whatsoever? I'd expect, at the very > > least, the sole interrupt to be configured as disabled/masked. > I can add that. is there any "best practice" on what I should > initialize (just disable it or also set a "default" mode like > LEVEL_LOW)? Whichever default state makes sense. What you want to avoid is to boot the kernel with a screaming interrupt because some firmware has left it enabled. Thanks, M. -- Jazz is not dead, it just smells funny.