Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp593514pxb; Thu, 15 Apr 2021 01:47:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvAMFawT2CHlDuB2qFwzcK5pMwPEk7/s3VUVDLCn8zl8YHUnDT5zBH8M6BpgGYCX+Bcyix X-Received: by 2002:a17:906:4b59:: with SMTP id j25mr2224441ejv.313.1618476422408; Thu, 15 Apr 2021 01:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618476422; cv=none; d=google.com; s=arc-20160816; b=CROF9cAaw05mH4k8fNPZr6LKUhXtDuWNMzRa1oOunfQ3Xn6y+2xZcz0ATkBeWkqksg ODM55fZ/7Mbn4/2D4nVQCy0rYcuUL1apREbCodHwkLoRXdm7YYgXUvxCW+yPxDQjzDXP 5H16FiHyqWUK2CfXTIJdX5F/ua0Qf9lAgTmY3wEhjbTUTkwYLPGBx8Pxjr7zM5+nMZ7D z6zE2WxDL6n3pwueUba/hI72tiXcA1dCRNcprEobogMD8AOlHai2jBW+RJLkov7Of/FF 4KUndkuGwrfUGPL5TUOsLxvKIeKmgAT02RpGAPP0oVDpPmWb+WBfcbhC3Kkw+jIPZmbJ VEUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=o4A8GeGfqPqmu1JUDYb+tSJsv8bp00lnxQMVcFYI5EE=; b=dTzbkLkMzrLcAA3dwK3v6nEVks7+Gv3Jsp3zEJzq1TyQxJ1zPqjbOKVfoQtvJlOez8 X1GHnkIVWqCus0STpDvX+v9Bkd8Rk01kiuD/muTaMGiKITVK73hRZYDitxbsCie8uz8l B3pkcmPi8hO9uQQHjOmtp2VTrMcKAJLCXq4BgxdHiXcR+RN/shvE8UR+0pKcNmbyAdbz Nd1bIdEuEK2siXSeEFHrH6mCsupcxNRkeZ2cIVY4rwnDIjxtQDTQhuOpdm4LDQf+FZOd 17YI7esrZECdzT+DV/rtz3Na8INaxElEZdLhC3UkQolf4WLqy4PtfX+5zeBC5n3yos9n ToQA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi22si1782484edb.191.2021.04.15.01.46.40; Thu, 15 Apr 2021 01:47:02 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231536AbhDOIqH convert rfc822-to-8bit (ORCPT + 99 others); Thu, 15 Apr 2021 04:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231251AbhDOIqF (ORCPT ); Thu, 15 Apr 2021 04:46:05 -0400 Received: from mail.nic.cz (lists.nic.cz [IPv6:2001:1488:800:400::400]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BC18C061574; Thu, 15 Apr 2021 01:45:42 -0700 (PDT) Received: from thinkpad (unknown [IPv6:2a0e:b107:ae1:0:3e97:eff:fe61:c680]) by mail.nic.cz (Postfix) with ESMTPSA id 820CC140A70; Thu, 15 Apr 2021 10:45:38 +0200 (CEST) Date: Thu, 15 Apr 2021 10:45:37 +0200 From: Marek Behun To: Pali =?UTF-8?B?Um9ow6Fy?= Cc: Rob Herring , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , linux-arm-kernel , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , PCI Subject: Re: [PATCH] arm64: dts: marvell: armada-37xx: Set linux,pci-domain to zero Message-ID: <20210415104537.403de52e@thinkpad> In-Reply-To: <20210415083640.ntg6kv6ayppxldgd@pali> References: <20210412123936.25555-1-pali@kernel.org> <20210415083640.ntg6kv6ayppxldgd@pali> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-100.0 required=5.9 tests=SHORTCIRCUIT, USER_IN_WELCOMELIST,USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Apr 2021 10:36:40 +0200 Pali Rohár wrote: > On Tuesday 13 April 2021 13:17:29 Rob Herring wrote: > > On Mon, Apr 12, 2021 at 7:41 AM Pali Rohár wrote: > > > > > > Since commit 526a76991b7b ("PCI: aardvark: Implement driver 'remove' > > > function and allow to build it as module") PCIe controller driver for > > > Armada 37xx can be dynamically loaded and unloaded at runtime. Also driver > > > allows dynamic binding and unbinding of PCIe controller device. > > > > > > Kernel PCI subsystem assigns by default dynamically allocated PCI domain > > > number (starting from zero) for this PCIe controller every time when device > > > is bound. So PCI domain changes after every unbind / bind operation. > > > > PCI host bridges as a module are relatively new, so seems likely a bug to me. > > Why a bug? It is there since 5.10 and it is working. > > > > Alternative way for assigning PCI domain number is to use static allocated > > > numbers defined in Device Tree. This option has requirement that every PCI > > > controller in system must have defined PCI bus number in Device Tree. > > > > That seems entirely pointless from a DT point of view with a single PCI bridge. > > If domain id is not specified in DT then kernel uses counter and assigns > counter++. So it is not pointless if we want to have stable domain id. What Rob is trying to say is that - the bug is that kernel assigns counter++ - device-tree should not be used to fix problems with how kernel does things - if a device has only one PCIe controller, it is pointless to define it's pci-domain. If there were multiple controllers, then it would make sense, but there is only one