Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3730822imj; Tue, 19 Feb 2019 08:28:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IaMSZxcyNOzQLyufrFbel/YC01VXE2kBdoDBeB2XikaU/xazBqx2+YObjc49C6XZ9ZI9l87 X-Received: by 2002:a63:515d:: with SMTP id r29mr24119375pgl.350.1550593710847; Tue, 19 Feb 2019 08:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550593710; cv=none; d=google.com; s=arc-20160816; b=S30XtyPFsVfU2Ndas8pklpKi87gGcP7xof9SZl2Aysjs5zJVe5AiCGnsAXYxYP6lV3 2iJOT4BFS1wfXtc5W+mE0vNSl+Bse4mfaLMHjKvfxUBH5anYdW0G23bDkme4cWRGzQZk 8y8yh91fkEWNoOPObW19H3a0zu016NPh8O4oucQtUHaWPeDM2zjkbcpV6K9wg5r0PDmM +1cQqWW+u4mx7ochnfW04Xd6c0tqYpFZIoocHY5P6GidTPmfyGL79lUeBY6NNTb7qw1z uw4mqVcioY4wrcy3HXyLHtf8wxbu7F9uzI2h3Pac6/XQWXufg3+1FZOUN/QGX8hvFxSF kVpw== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=yjsZJ+6TA9HmzAn0DApVjGsAMpucY7r2oqX/Ztz+ADA=; b=ON8gep96kwqZb/ZvDriYWqjbvWjseiquCOXNnaAaOaIMpjKbpBNHjxq6qK5dqMPHT3 sHtsorvtya3diYU1a6rLQblR0qiUm4sHlZvYQdKUcixbQQT9r3zsd86KIfYXq0yrBpog 86Zq1Iky1oXSJbONoPLTH5z8yQGx9UCCu0IW7ezJoMWJZA/u8E5wFIPyDcGZl4w7ZsRF wDRTHnuBn5q5YJeotkSyzVRl+733GbSNXwLgZs9k962+wI3tdIOt+mHEkuGiVNprB9QP a+5ptClh4aCOKLgdHaUB7kiqXbNYI03GjntnVF6gZohyTq3pZzHZJ/IapXO36aLFdVbE IifQ== 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 ci1si15441045plb.352.2019.02.19.08.28.14; Tue, 19 Feb 2019 08:28:30 -0800 (PST) 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 S1729018AbfBSQ1W (ORCPT + 99 others); Tue, 19 Feb 2019 11:27:22 -0500 Received: from foss.arm.com ([217.140.101.70]:47160 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726110AbfBSQ1V (ORCPT ); Tue, 19 Feb 2019 11:27:21 -0500 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 6AE75EBD; Tue, 19 Feb 2019 08:27:21 -0800 (PST) Received: from why.wild-wind.fr.eu.org (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 700EA3F690; Tue, 19 Feb 2019 08:27:20 -0800 (PST) Date: Tue, 19 Feb 2019 16:27:16 +0000 From: Marc Zyngier To: Thomas Bogendoerfer Cc: Thomas Gleixner , Subject: Re: [PATCH v2 09/10] genirq/irqdomain: fall back to default domain when creating hierarchy domain Message-ID: <20190219162716.04b0a54b@why.wild-wind.fr.eu.org> In-Reply-To: <20190219155728.19163-10-tbogendoerfer@suse.de> References: <20190219155728.19163-1-tbogendoerfer@suse.de> <20190219155728.19163-10-tbogendoerfer@suse.de> Organization: ARM Ltd X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Feb 2019 16:57:23 +0100 Thomas Bogendoerfer wrote: Hi Thomas, > When creating hierarchy domains use irq_default_domain as parent, if no > parent was given by the caller. This avoids adding helper code for > querying the underlying platform irq domain. > > Signed-off-by: Thomas Bogendoerfer > --- > kernel/irq/irqdomain.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c > index 8b0be4bd6565..617c482d0778 100644 > --- a/kernel/irq/irqdomain.c > +++ b/kernel/irq/irqdomain.c > @@ -1021,7 +1021,10 @@ struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent, > else > domain = irq_domain_create_tree(fwnode, ops, host_data); > if (domain) { > - domain->parent = parent; > + if (parent) > + domain->parent = parent; > + else > + domain->parent = irq_default_domain; > domain->flags |= flags; > } > I'm really not keen on this. The whole "default domain" made sense at a distant point in time (when irqdomains were new and platform code was blissfully ignoring it), but it really looks like a sore spot in the hierarchy code, which assumes that you always know what you're building your hierarchy on top of. It also create a small issue in the sense that you can create a root domain using irq_domain_create_hierarchy() by passing NULL as the parent. With this patch, the new domain now points to the default one, with unexpected consequences. So let's come back to first principles: How comes you can't obtain the parent domain at creation time? Because I'd rather give you a way to retrieve it instead if this. M. (who wish he had an IP27!) -- Without deviation from the norm, progress is not possible.