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=-6.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 A8D37C433DB for ; Wed, 3 Feb 2021 18:05:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B5A564F92 for ; Wed, 3 Feb 2021 18:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231675AbhBCSFH (ORCPT ); Wed, 3 Feb 2021 13:05:07 -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-Google-Smtp-Source: ABdhPJxQOdRcU5ihhtNjMKJJpTN75hiZpojKFrv2qs72Sy7gA8yZBnbJKaVP5dqo7dqqriM+Ja5srnywPI9TIMX4WQE= 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 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.5 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 40A59C433DB for ; Wed, 3 Feb 2021 18:05:07 +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 A1A8B64DAE for ; Wed, 3 Feb 2021 18:05:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1A8B64DAE 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=gF7T0rsfPZZXsdcvbaJa00HQnb1uNBC+psu7XFivsFw=; b=gEqp9QonXiBr/S76KB6EMDHQe lpNUkm6q2I5HrGLM6l7TaSuR+4Fcs07uSh1B4njKCK9szuf4SBnAwmX53BSHUTG0UPuuHP61BfdEa vtFy8SmL8cFD4RvTTCjybDAOSNPd05w18CF6DxCygghLqBHphAjL2nNdxCoe1ZydtaMwEAXGNMn6+ 3oNJCgaBWFR5GkOxjF9RX1d7Jbrv5tuKlXxhL456J2b4/WAsxc7L1GFfS6hTNFcrJ+2CkRihIa0tI aMsuCJXgKtjhpL/vhrWF8WUi0Aj7E15dOGBK2z6zeL+Iyw1PHv2/6MuFhGSqU4Hiw7g1lr9PEsr41 aQXKXpKPQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7MVB-0003Pa-QR; Wed, 03 Feb 2021 18:03:41 +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 1l7MV9-0003PD-IE for linux-arm-kernel@lists.infradead.org; Wed, 03 Feb 2021 18:03:40 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2D8FD64F92 for ; 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-f48.google.com with SMTP id g10so736577eds.2 for ; Wed, 03 Feb 2021 10:03:37 -0800 (PST) X-Gm-Message-State: AOAM531RS8kjTU1K+rXXYyUOSUFPnzGHb6f66NplszxEF9Swbb1dUhT6 1em60+geWRpiYe7RRQjAG+aOg23Jb4BaHp8Amw== X-Google-Smtp-Source: ABdhPJxQOdRcU5ihhtNjMKJJpTN75hiZpojKFrv2qs72Sy7gA8yZBnbJKaVP5dqo7dqqriM+Ja5srnywPI9TIMX4WQE= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210203_130339_773286_8E4CF50C X-CRM114-Status: GOOD ( 31.67 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel