Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp588966pxb; Thu, 15 Apr 2021 01:38:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTEhqgllDRYpdajLwi2SFnVuEtwne1ymxB+H5svpkg+IEx8CHfeB7WOi26rgzagXHrkRI4 X-Received: by 2002:a17:906:5495:: with SMTP id r21mr2265534ejo.471.1618475911255; Thu, 15 Apr 2021 01:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618475911; cv=none; d=google.com; s=arc-20160816; b=vWoYiwXL3S6JmbejXZAw9R1QQ6JItbHrrFnymBn7t4d3c2ifr7GGRUc9qsKMOQdSHv p/vDQuZzPTIGdgzwqNDKDqei5htgKIAmCs+mcnx8IX50oVOyr4anxAEv5gPy7849s5DJ k9NQOPKmNVHuEyMokCR9BvnCTMC7HI4Ppw2qKU1kC782KPdtAkY+cUOB7DFopvEP1Rcq FAX8BU8tqU6AFj2tjnfTIOvy5hC2mJt36hroNPpuo2ZeBbvAKlsGhOcYQ5cRZV+MJf9N /J/tFFdy04NKwzBLojsq3lFpJKhS1brDJGIYzE7NhLka1hootwU/OzGQ50+uUdwNro4w qNiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zd1URExrViRvUENCIYD2e7Nl7RcTUxhxs7IWe0uMRME=; b=PDjpFqyk+5gjb9bZ+TZVW/yOgbbZdbQTCRCtfsmHEd/ihBvNRhk+9FFmVZ4YA13J00 XMCJJ2cOKc2qhGjDcEu+zhXYxc3/L6baULGihxtlOiT5NsNtoV4DIF6cEjq9vHo7SeQu 5TlqXWuoPFKCZCgih0r35gP3ZV7xZ0N4ap5R+SMUtbDRYf9TIx6shtzEdSNV8+gJ89RC L+Wdc6n+lmLq6ZSDRG0PpcOfI5yDp0S2tgaPw4XOYXMADpGPE1N1EOu4dwnvZ89XsKbC ELx3dfIr+YjSmWvvkb0k2b39VH/CSEv0imAiVdhFYbHaizGK2c88jht1QRRqc7DOi+S8 hXOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Dv7GhPqi; 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 m20si1636886eja.616.2021.04.15.01.38.08; Thu, 15 Apr 2021 01:38:31 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Dv7GhPqi; 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 S231553AbhDOIhG (ORCPT + 99 others); Thu, 15 Apr 2021 04:37:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:33828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbhDOIhG (ORCPT ); Thu, 15 Apr 2021 04:37:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6BCD06105A; Thu, 15 Apr 2021 08:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618475803; bh=/z+DiHu2gjNfvnCahqiPqFCMARaDeKT5rduKLDW4FxE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Dv7GhPqiIkzwF+Zzu5K10tkK+CLz2K3U6KV+1DIlhZd6qXlcGZYn8Qy7hPi5L9a9P zd7++dShkgUxSg/kPLJCb1RfzNqrZF5sOuLDgziYKFAKKZqSYQT7gkl0uGt/pGn8Ox Ze+yrvYtLmk8YfuvaatCsPfSf8uo7dx3pqqLE5XM3wDM1yx5OVQTFfR/FNqPnK4wtY iX8TU8f2DB2bShDCrZpjOA3l3oKlNO57g0PGtabvG51coLC3iW+1Q5honqq/13Gs4e 4U/M+GLGPzLxmtZLA0XIgqyK+GJD+Y4xmdyIAMNHHeiBMJ6RXJLCWQRuCEeZx+6yaE t1p+NqY0iLbMw== Received: by pali.im (Postfix) id 12F6DAF7; Thu, 15 Apr 2021 10:36:40 +0200 (CEST) Date: Thu, 15 Apr 2021 10:36:40 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Rob Herring Cc: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Marek =?utf-8?B?QmVow7pu?= , 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: <20210415083640.ntg6kv6ayppxldgd@pali> References: <20210412123936.25555-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Armada 37xx has only one PCIe controller, so assign for it PCI domain 0 in > > Device Tree. > > > > After this change PCI domain on Armada 37xx is always zero, even after > > repeated unbind and bind operations. > > > > Signed-off-by: Pali Rohár > > Fixes: 526a76991b7b ("PCI: aardvark: Implement driver 'remove' function and allow to build it as module") > > --- > > arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi > > index 7a2df148c6a3..f02058ef5364 100644 > > --- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi > > +++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi > > @@ -495,6 +495,7 @@ > > <0 0 0 2 &pcie_intc 1>, > > <0 0 0 3 &pcie_intc 2>, > > <0 0 0 4 &pcie_intc 3>; > > + linux,pci-domain = <0>; > > max-link-speed = <2>; > > phys = <&comphy1 0>; > > pcie_intc: interrupt-controller { > > -- > > 2.20.1 > >