Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp381323pxt; Thu, 5 Aug 2021 01:56:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlYp/4bCaG/BRJqR+vLiW7D0b7xlyobTUudVvWrLDg6PkKLlxlPYxnMwWsAnKj/7mf01Ix X-Received: by 2002:a50:fb05:: with SMTP id d5mr5012480edq.5.1628153777915; Thu, 05 Aug 2021 01:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628153777; cv=none; d=google.com; s=arc-20160816; b=xnPOxh7oSRlZUSDoFFD1xVM6efEgdASZHNf70KXyFW5yAJfw5RtJN2t0n4eChH+WPs WZzGuM6hx2Ak+CsWE+EET0r35CVaR3N5PYwWdmILYl+SQTwTrKcZTMyJeeemM8KsHNDy yEUzZa+wMTFj7+Zi81Va8ak6NwA6qRav4I3Ue5U6WYsKSHAc0bfDf9jWqxVsRAhql1fp ZmW2hW9MbFw64qtlomE4bAUxPJokb40znCu2Gdn2iTG4lx3YTSltwBUHOXT5sJvQyyTs mJmz3WyPuKO7pRTobvhxIRidAuROBSD6QhMYQSKcwIkFiBKKOmT9lvfqKLlrV1MFGs4S b/Jg== 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 :dkim-signature; bh=4BRr8F4o/Sq1UrjmaQLObzN4rSZku1az99Xl8bAZIKk=; b=Z9ciwAHCuBGRALdkK5UqUxKq0p3IzsX2Q5S+AOM7/+MzgXGl0DM7D3Nqobv2aBTGIX soOr5qjx1Z2puNtYOywUZXdGn4oqx6WlyFvlWlxyKFZ9FtDQku7muhhQJpE7z2eehOT1 LOLoV5ZrIX1z0Oz1PQjMWqTtBB9S7HlYN4hn1PaBdkFeW9fYAUTOdihPktQkh4U4NoXu Oi4xFqrk30KEWKC8c6P8MmjooTwfHbKCI0cSk3KHqcgETaYXUgBBQHPh+L5/oV3vfPOd UEX7e9REyNSdUC0NNfHNG3H5Y0lOualax2wv0XUZ1tXghPZTsdqEa04jKM8ukmDfVz2V bmww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SDorkv9x; 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 m1si5936398ejj.198.2021.08.05.01.55.42; Thu, 05 Aug 2021 01:56:17 -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=SDorkv9x; 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 S238146AbhHEHqh (ORCPT + 99 others); Thu, 5 Aug 2021 03:46:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:55302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbhHEHqg (ORCPT ); Thu, 5 Aug 2021 03:46:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D52D260E52; Thu, 5 Aug 2021 07:46:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628149582; bh=OQMzqlGLWysC7ViHpXfROhIRuImNOkl09B3GGvOiqas=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SDorkv9xbBYyu3KWS0FiKrw4oVXd1LFxiQINqV1GlwB8jZ+N/rMt02PgyHEf+DWaP DElXbggoFPpU6MC/ltSfIKr5GnuCqBBvw/LgLu7hoa/8Z6+APi7Cr3yprOG7YAMT4s SdNY2+8nGDNSolxZbB0Se0QoDaSFK7O3+xWtdq7pD6pp0q23xztx4NFEeR3k2nGqW+ fa+Rlsa/5bc7XRqjvDFFPpYfoIKdc05ONNudZqtn6ZP4IyjcrHC6X5yYB9UACqdzAT o8kF98IkUQmDnXH8E+0mkJHs1KpSYamQFHLeGsue7YmgJH7G56xRt5+JdXUWvskAe7 HHHIuitj7oNsg== Date: Thu, 5 Aug 2021 09:46:12 +0200 From: Mauro Carvalho Chehab To: Rob Herring Cc: Linuxarm , mauro.chehab@huawei.com, Binghui Wang , Gustavo Pimentel , Jingoo Han , Xiaowei Song , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , PCI , linux-phy@lists.infradead.org Subject: Re: [PATCH v3 0/4] DT schema changes for HiKey970 PCIe hardware to work Message-ID: <20210805094612.2bc2c78f@coco.lan> In-Reply-To: References: <20210804085045.3dddbb9c@coco.lan> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, 4 Aug 2021 10:28:53 -0600 Rob Herring escreveu: > On Wed, Aug 04, 2021 at 08:50:45AM +0200, Mauro Carvalho Chehab wrote: > > Em Tue, 3 Aug 2021 16:11:42 -0600 > > Rob Herring escreveu: > > > > > On Mon, Aug 2, 2021 at 10:39 PM Mauro Carvalho Chehab > > > wrote: > > > > > > > > Hi Rob, > > > > > > > > That's the third version of the DT bindings for Kirin 970 PCIE and its > > > > corresponding PHY. > > > > > > > > It is identical to v2, except by: > > > > - pcie@7,0 { // Lane 7: Ethernet > > > > + pcie@7,0 { // Lane 6: Ethernet > > > > > > Can you check whether you have DT node links in sysfs for the PCI > > > devices? If you don't, then something is wrong still in the topology > > > or the PCI core is failing to set the DT node pointer in struct > > > device. Though you don't rely on that currently, we want the topology > > > to match. It's possible this never worked on arm/arm64 as mainly > > > powerpc relied on this. > > > > > > I'd like some way to validate the DT matches the PCI topology. We > > > could have a tool that generates the DT structure based on the PCI > > > topology. > > > > The of_node node link is on those places: > > > > $ find /sys/devices/platform/soc/f4000000.pcie/ -name of_node > > /sys/devices/platform/soc/f4000000.pcie/of_node > > /sys/devices/platform/soc/f4000000.pcie/pci0000:00/0000:00:00.0/of_node > > /sys/devices/platform/soc/f4000000.pcie/pci0000:00/0000:00:00.0/pci_bus/0000:01/of_node > > /sys/devices/platform/soc/f4000000.pcie/pci0000:00/pci_bus/0000:00/of_node > > Looks like we're missing some... > > It's not immediately obvious to me what's wrong here. Only the root > bus is getting it's DT node set. The relevant code is pci_scan_device(), > pci_set_of_node() and pci_set_bus_of_node(). Give me a few days to try > to reproduce and debug it. I added a printk on both pci_set_*of_node() functions: [ 4.872991] (null): pci_set_bus_of_node: of_node: /soc/pcie@f4000000 [ 4.913806] (null): pci_set_of_node: of_node: /soc/pcie@f4000000 [ 4.978102] pci_bus 0000:01: pci_set_bus_of_node: of_node: /soc/pcie@f4000000/pcie@0,0 [ 4.990622] (null): pci_set_of_node: of_node: /soc/pcie@f4000000/pcie@0,0 [ 5.052383] pci_bus 0000:02: pci_set_bus_of_node: of_node: (null) [ 5.059263] (null): pci_set_of_node: of_node: (null) [ 5.085552] (null): pci_set_of_node: of_node: (null) [ 5.112073] (null): pci_set_of_node: of_node: (null) [ 5.138320] (null): pci_set_of_node: of_node: (null) [ 5.164673] (null): pci_set_of_node: of_node: (null) [ 5.233759] pci_bus 0000:03: pci_set_bus_of_node: of_node: (null) [ 5.240539] (null): pci_set_of_node: of_node: (null) [ 5.310545] pci_bus 0000:04: pci_set_bus_of_node: of_node: (null) [ 5.324719] pci_bus 0000:05: pci_set_bus_of_node: of_node: (null) [ 5.338914] pci_bus 0000:06: pci_set_bus_of_node: of_node: (null) [ 5.345516] (null): pci_set_of_node: of_node: (null) [ 5.415795] pci_bus 0000:07: pci_set_bus_of_node: of_node: (null) It sounds that the parent is missing when pci_set_bus_of_node() is called on some places. I'll try to identify why. Thanks, Mauro