Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1115432rdb; Wed, 6 Dec 2023 09:00:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtcytmqk9ou6eNKqiaPE2uVOLMGFpdyhT37zqdF4HAo/5ywEWM9Ph06iTXGjEqCc4tuAlh X-Received: by 2002:a05:6a20:c5a9:b0:18c:1e48:366b with SMTP id gn41-20020a056a20c5a900b0018c1e48366bmr683538pzb.48.1701882050927; Wed, 06 Dec 2023 09:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701882050; cv=none; d=google.com; s=arc-20160816; b=NwJttkWvTE/LwfIWvJ+KlATs0i/KWTycMTPTWCUZMOLQzSuxfUMmcQ5laPBjqQnWT/ 4y+SwoMuYF4KXIJeidmaNg9OzjKjxWiG0B6/QBmzEOxTaODYb6sz8CU91g9jY5rZKTwA 1mMvZ9Bdz+vLY/tXbOosSM9UarKj6HJX209dilHeBGs6AukXAflUeo73zjhOVKx0qImI VnLAna7Os4biPoiI/lhkXOc6he6pHA1fh3eHHiVXnHs4/K+Z4k6bR7UUSpjFDEkiktHO lirUzKa44HotehcFIAOWf+IELNYvUDyvhYJLVAoatmnhqKR4lbIhxHjSiaAC9/6XtjKG NlIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=U3GFB3XRs31peCSwO/dZwiMSeRgrx6J1Mcg/F+kUZxw=; fh=YXH7DR+/BAzqplfD+ZB+8py4jCB0MJCEu2MxE4Khpqw=; b=NkVd/5ht0FrDvZ00D0tCR1YizSYea1/jKsHj8a9NrZ/AgLmJJgcHaBfl/Zvt8mFxIv VkF2c35pUstKloTrbiM+UtFCI9uaXOmtxabX3mT+XBe/VVAHzGYIjXg+W5bnLGEdS93J Sz7BXBccPJfhh1l0fANjvpm5/Ih63q9TvNdXCNlWkl3XZHKXJ0bjSlKLzlC84d6LOXHY 9K0aT8vWSXCc1Q8YzCYn4ikeaHB7YECTmIWoTkPVlofdS9JEvWIqE/TrxX9V9YnDpe1K EWw+2z8dBumKPN88BDnNaGT4WF4TXVYG6aS1F9gwaSGSidbOiEgG17Qi0AndlGKbvCGa hSBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MJOLyo52; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id s13-20020a65644d000000b0058556a636dbsi166030pgv.434.2023.12.06.09.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 09:00:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MJOLyo52; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8A4C48084040; Wed, 6 Dec 2023 09:00:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229549AbjLFQ7v (ORCPT + 99 others); Wed, 6 Dec 2023 11:59:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjLFQ7t (ORCPT ); Wed, 6 Dec 2023 11:59:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09F13C9 for ; Wed, 6 Dec 2023 08:59:56 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62A39C433C8; Wed, 6 Dec 2023 16:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701881995; bh=xdGLbLZlKz6hqDzxxH4MqX0sG3ItG6KAFGtCvH4gnsg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=MJOLyo52HSa1ezkiZilGDaJk8L3Ol+4TVWOFf2jN/7JZLdwsFDlmL2DvKVIonkRdi 3fh5GT7VbTejQ/xnXDT4CHQXfs6JwDdajAVQGRpWv+BrPWR7T16yt2bI4sh8QmVU/U NEO/F5c0EVGAgGrAcr3sMeLNty1noQR5qil2W0V/kYk4ci4M97mv8ecRo/e3l1V5zV qQ3TqEMfeJaGNX2XEBnCPKj/J36uThgLrbIM6SOC3ilUXEAdNQ0LdOvybK/ykg4Dw2 rC8p+XzXdMWcPRwjqqjvFnFbWkbQLhfKpf7lnFWNAdDNZK7wI9Ib3eWTm5C1dlEzeU 1tWiAKmXvvduw== Date: Wed, 6 Dec 2023 10:59:53 -0600 From: Bjorn Helgaas To: Frank Li Cc: imx@lists.linux.dev, Richard Zhu , Lucas Stach , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , "open list:PCI DRIVER FOR IMX6" , "moderated list:PCI DRIVER FOR IMX6" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list Subject: Re: [PATCH 4/9] PCI: imx6: Using "linux,pci-domain" as slot ID Message-ID: <20231206165953.GA717921@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 06 Dec 2023 09:00:14 -0800 (PST) On Wed, Dec 06, 2023 at 11:50:16AM -0500, Frank Li wrote: > On Wed, Dec 06, 2023 at 10:36:56AM -0600, Bjorn Helgaas wrote: > > In subject, maybe you mean "Use 'linux,pci-domain' as slot ID"? > > "Using" is the wrong verb form here. > > > > On Wed, Dec 06, 2023 at 10:58:58AM -0500, Frank Li wrote: > > > Avoid use get slot id by compared with register physical address. If there > > > are more than 2 slots, compared logic will become complex. > > > > But this doesn't say anything about "linux,pci-domain", and I don't > > see anything about a register physical address in the patch. > > > > Maybe this commit log was meant for a different patch? I'm confused. > > > > > Signed-off-by: Frank Li > > > --- > > > drivers/pci/controller/dwc/pci-imx6.c | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c > > > index 62d77fabd82a..239ef439ba70 100644 > > > --- a/drivers/pci/controller/dwc/pci-imx6.c > > > +++ b/drivers/pci/controller/dwc/pci-imx6.c > > > @@ -33,6 +33,7 @@ > > > #include > > > #include > > > > > > +#include "../../pci.h" > > > #include "pcie-designware.h" > > > > > > #define IMX8MQ_GPR_PCIE_REF_USE_PAD BIT(9) > > > @@ -1333,6 +1334,11 @@ static int imx6_pcie_probe(struct platform_device *pdev) > > > "Failed to get PCIEPHY reset control\n"); > > > } > > > > > > + /* Using linux,pci-domain as PCI slot id */ > > > + imx6_pcie->controller_id = of_get_pci_domain_nr(node); > > > + if (imx6_pcie->controller_id) > > > + imx6_pcie->controller_id = 0; > > > > I don't understand what this is doing. It looks the same as just: > > Good capture. It should be > if (imx6_pcie->controller_id < 0) > imx6_pcie->controller_id = 0; > > for only one PCI controller case. I just tested first one slot before send > patch, so not met problem. > > Previously, we use below logic > if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) > imx6_pcie->controller_id = 1; > > It is not good to depend on register's base address. If there are 3 > controllers, check logic will becomoe ugly. Makes sense. If the previous code depended on the base address, this patch would make more sense if it contained both the addition of the of_get_pci_domain_nr() call and the removal of the base address code. > > Maybe this is a typo? As written, it doesn't look like there's any > > point in calling of_get_pci_domain_nr(). > > > > > switch (imx6_pcie->drvdata->variant) { > > > case IMX7D: > > > if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) > > > -- > > > 2.34.1 > > >