From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F05FDC433E0 for ; Thu, 4 Feb 2021 20:10:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9021664F45 for ; Thu, 4 Feb 2021 20:10:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9021664F45 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=B9ZNBZZXzI0J4az8IvNJmTcWQyFIKa9yV3ZNN/GRPF4=; b=aT7EtSKs6r4GwgyYVFsa3j8bh H7MRWieQJ3Kbv+BCEDt36/BbZS5lkBcSjFR7JzJXeEnIf3J4dXMeTn2raviWYmNbowVMnURZoxViJ ywMkyUN+tZH2mW0B4LTUScZiopk47Ky0hNCLacbydFyHIxADC/XbifjN/ep4Ad3iae8Hpcq4oce5k 01gTh74q2LZDXMUj5gIxYPxNswFiBiAAMnWFp5fIDjyOgWvhqkwu+Hm95aIqOBMehQK+1iXJfN5Lz Tx4C+c+0Jz7CK6X2nI/e504zcVmYJNJX6pjQ8c1uXhpZSafjNSbC77uoMbjekt4p9vOwXdXnwwjYy nw9bvPVzA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7kwI-0005SH-57; Thu, 04 Feb 2021 20:09:18 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7kwG-0005Rs-1M for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2021 20:09:16 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6AE1260203 for ; Thu, 4 Feb 2021 20:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612469354; bh=ZbLhFh9ekMPZ7GsNUm17lM69d0KfshZaVXI3G/nk2ms=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Npo7RmNAZ6aSCRqxm4nVlbaC/27YVRcbCPdd/fbIg19/B+FHezlIum4hWxlFIF7ON HMOxuGrqn9JuVV79dSuBTZghrifXAnGKneLW7L/czTVKPl1MzkLQbuw3PahK1Amqy2 cnBZC/y1Ot1iy8ll6/IASEqB/ZdXLA7vrWkAmhvhtZHqT0hFRmnEt66ImRMlB13Icx NtJeNk/LaUOIDjpJBVB9ebf1u9+lZOn+UsBT1S/liZzVG46TrZcZ4mHf1BkmjlJL5G 2cvkY+S7xZ8ThK83wbkfkmvi5O4WLdd7xBdUeGvpLT+Ss3FBG7ySG8TNHT77tD85JA NkkFlyHwtO0Lg== Received: by mail-ed1-f44.google.com with SMTP id s5so5809499edw.8 for ; Thu, 04 Feb 2021 12:09:14 -0800 (PST) X-Gm-Message-State: AOAM533cSe0grqPtqju2CSQG2CftPg2dT4IgBYDVMvq5IW0ShltiMX2P QerdoekOsrKeF20bvZcUaq/fl3aPat7KRHKDCA== X-Google-Smtp-Source: ABdhPJyUV5HEhzX+4uiSU3UPrmRnNReleaqLxoxL2nV/uRrWwsFnvLuMCAGXLzBp06xeHA/+3g2JdEtwmOqvoL43N+E= X-Received: by 2002:aa7:c906:: with SMTP id b6mr311329edt.194.1612469352891; Thu, 04 Feb 2021 12:09:12 -0800 (PST) MIME-Version: 1.0 References: <91e3405245c89f134676449cf3822285798d2ed2.1612189652.git.michal.simek@xilinx.com> <210b0e5a-767b-c285-62e2-23de19bd3cf1@xilinx.com> <20210203144344.4e261aea@slackpad.fritz.box> In-Reply-To: From: Rob Herring Date: Thu, 4 Feb 2021 14:09:01 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ARM: dts: zynq: Add address-cells property to interrupt controllers To: Andre Przywara X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210204_150916_234651_43258E57 X-CRM114-Status: GOOD ( 35.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Michal Simek , Michal Simek , "linux-kernel@vger.kernel.org" , git , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Feb 3, 2021 at 12:03 PM Rob Herring wrote: > > On Wed, Feb 3, 2021 at 10:49 AM Rob Herring wrote: > > > > On Wed, Feb 3, 2021 at 8:44 AM Andre Przywara wrote: > > > > > > On Wed, 3 Feb 2021 15:15:19 +0100 > > > Michal Simek wrote: > > > > > > > On 2/3/21 3:12 PM, Rob Herring wrote: > > > > > On Wed, Feb 3, 2021 at 1:01 AM Michal Simek wrote: > > > > >> > > > > >> > > > > >> > > > > >> On 2/1/21 6:41 PM, Rob Herring wrote: > > > > >>> On Mon, Feb 1, 2021 at 8:27 AM Michal Simek wrote: > > > > >>>> > > > > >>>> The commit 3eb619b2f7d8 ("scripts/dtc: Update to upstream version > > > > >>>> v1.6.0-11-g9d7888cbf19c") updated dtc version which also contained DTC > > > > >>>> commit > > > > >>>> "81e0919a3e21 checks: Add interrupt provider test" > > > > >>>> where reasons for this checking are mentioned as > > > > >>>> "A missing #address-cells property is less critical, but creates > > > > >>>> ambiguities when used in interrupt-map properties, so warn about this as > > > > >>>> well now." > > > > >>>> > > > > >>>> Add address-cells property to gic and gpio nodes to get rid of this warning. > > > > >>>> The similar change has been done for ZynqMP too. > > > > >>> > > > > >>> FYI, we're going to make this check dependent on having an > > > > >>> interrupt-map property. So adding these isn't necessary. > > > > >> > > > > >> Good to know. Is there going to be report if interrupt-map doesn't > > > > >> exist? Which can end up with reverting these changes? > > > > > > > > > > You mean a warning if '#address-cells' is present and interrupt-map is > > > > > not? No, that would cause lots of warnings. > > > > > > > > yep. > > > > > > Why would we do that? That sounds dangerous and would be broken if the > > > IRQ controller is in a generic .dtsi (as it usually is), but the > > > interrupt map is only in *some* of the board .dts files. > > > > > > What is the problem of just putting #address-cells = <0>; in the > > > IRQ controller node, after checking that there currently no interrupt > > > maps in use and no IRQ children? And be safe for good? That's 16 bytes > > > in the DTB, IIUC. > > > > Because I don't think we need a bunch of warning fix patches to add > > these everywhere. Also, the need for #address-cells pretty much makes > > no sense on any modern system. It is a relic from days when the bus > > (address) topology and interrupt topology were related. > > > > > Because otherwise we have that lovely ambiguity between the > > > implicit default #address-cells = 2; and the assumed default of 0. > > > > > > And that's why I think we also cannot *automatically* add an #ac = <0>; > > > property, because that would change behaviour. > > > > I'd rather try to limit where we assume the default of 2. My guess is > > that's only some combination of old PowerPC and/or Sparc and no FDT > > based DT. > > Actually, after reviewing of_irq_parse_raw() again, I think you're > mixing the 2 different #address-cells involved. Let's review which > #*-cells applies to parts of interrupt-map: > > interrupt-map = <[ac current node or parent] [ic current node] [parent > intc phandle] [ac parent intc] [ic parent intc]>; > > For [ac current node or parent], we start in the 'interrupt-map' node > (because it's the interrupt parent). From there, we walk up the tree > to find #address-cells. Worst case is we find none and take the > default of 2. First, dtc has pretty much always made no root > #address-cells a warning. Second, Linux has notion of a default and > that varies by arch and isn't used here. Only Sparc defaults to 2 (see > of_private.h) which means we should never hit the default on PowerPC > or Arm (or anything else). Actually, Sparc doesn't even use this code. Turns out PowerPC is a bit more complicated. I traced where the '2' in this code came from. PowerPC had a mixture of the default being 1 or 2. For the interrupt parsing code, it was 1 (from prom_n_addr_cells()) before commit 0ebfff1491ef and 2 (hardcoded) after it. That's not the only place that a default was set. The early_init_dt_scan_root() function at that time defaulted to 2. Now it's 1 as we added per arch default defines which used the '1' from prom_n_addr_cells() (now of_n_addr_cells()). So in conclusion, PowerPC has had a mixture of defaults and no one cared since 2006 when it changed. I'm inclined to rip out these defaults and just fail. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel