Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp492791pxb; Wed, 3 Feb 2021 10:08:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzhF/lVER5NBbgKHANLvqdoBfdm0dou52bUzde0LrZ+xEJOqKz2NbZoP59G2SEcP/WOWF6 X-Received: by 2002:a05:6402:270e:: with SMTP id y14mr4253454edd.322.1612375715370; Wed, 03 Feb 2021 10:08:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612375715; cv=none; d=google.com; s=arc-20160816; b=YrXSnWJoU0Xf0gsAaARw7hfM3duyI0YlZU4/Irgx2GzCbDCDCSgLUBCQKHCnYnLndk 3YImGbgst5cLM/EAKuNAbr7RxHwhc8FgaCEMa9uaAbLQCTfB3k5B3GSxBHGjrNkGjnSM LqlWQ1Sp7HnnDBQR2eCgx6QlvH0+DhCpES3guD4WEXJ2quk42l9QDroay+HAXRJNTtRZ MfaizM0eIwGwXtYT4/7dCKIPcvT9q73TfakwUvxTv4Ym1iFoKctE9BgL1mHAT9Vfm5cD +NFutBnh5mWkLtx/Aowm6uUhQXUcnE7LvYkvkPioInlA/k3o4w8mA8rN/c2c8arM4vax 010Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TTIVkRkgnia8XYsvPhgMP4dcZLIvLYeoer++KNF+4rs=; b=0ZsyHL+9AWn7QSQdZAf4r2wVTWv49PXytBxXDRXnoHJykJJ5Z/ScHRKFMoIavEKJxL SNk/QYRvYHTs1vPcebKz41Wk4HoimpH92df9SYHJEclGUxiNz+xatDPWK/+CuNXYYTh+ 06UuqLAgD+X936n8q40/F+x7EIsA34r/l09a4ImjhSlxjQCyHW4luZg1rcLWycGx8pU1 gVoMJg3dFnfNRQHL8E2U04hmcyGrz5jVko/GYJh85yTBRVM05wjBmTM23IG06p+C1yuN 3OzwxxmOkD1zwW+r8zrrxMS/CO+IYNyf8tLxdFJ4hBDsw7Zd/UR6gmj/pVMC00QViqBy W1tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYS54+dI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si2242218edz.361.2021.02.03.10.08.06; Wed, 03 Feb 2021 10:08:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYS54+dI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232649AbhBCSFA (ORCPT + 99 others); Wed, 3 Feb 2021 13:05:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:55454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232365AbhBCSET (ORCPT ); Wed, 3 Feb 2021 13:04:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1D81E64F8D; Wed, 3 Feb 2021 18:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612375417; bh=TTIVkRkgnia8XYsvPhgMP4dcZLIvLYeoer++KNF+4rs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oYS54+dIHjSdivO0SPEZDbzsIoTD9T/Q7HDyQiU3A7INrXlaJGLAhh9FW5sMlpECi Ac5Mhm1hFoodp8OS5zWB9vAsfWzWvo6RCwSB2Bwfa9ZpOJ44mtjOQSHAF003t4jVW/ 4zClHT6oE3Ip9kFDavAr0mWqRdeNuxIEUgNX9jnr0CcEAlgeyYZq1JzVPd+oKnB55X w2dnwHvMaxMzshQIJu3oi8H2bZs5T+0SelFtkKkZC60L1bpO6ir3Jy1ZRRLvS1D5S5 xomF7Jqiao2CdmNiqh4yrStDX/joqdokmn3PBXRx2ZF3pPZEjgob8dpF4KELKywWOl dv0IyS2oUJp4w== Received: by mail-ed1-f50.google.com with SMTP id s5so677223edw.8; Wed, 03 Feb 2021 10:03:37 -0800 (PST) X-Gm-Message-State: AOAM530oLRsJpdme7CgYWLWFtGI0OZzW8eawl93jwmshdh15q9vSk6a5 D+Iqv0rZk2adbPWOHL2gb+br/tncLyVMxBAjNw== X-Received: by 2002:aa7:c7c8:: with SMTP id o8mr4345989eds.137.1612375415522; Wed, 03 Feb 2021 10:03:35 -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: Wed, 3 Feb 2021 12:03:23 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ARM: dts: zynq: Add address-cells property to interrupt controllers To: Andre Przywara Cc: Michal Simek , "linux-kernel@vger.kernel.org" , Michal Simek , git , devicetree@vger.kernel.org, linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). The #address-cells the fix here addresses is the [parent intc phandle]'s for [ac parent intc] cells. This default is 0 (see newaddrsize in of_irq_parse_raw()). So really, we only need to be checking for #address-cells in nodes with interrupt-map. Rob