Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp726851ybt; Wed, 17 Jun 2020 12:18:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIy5obD93YgAehEjMlfxNHQYEQ0fmzFUCOPzyGAUp+yMF2wICWrubX7n+1HplsUXRl3pyv X-Received: by 2002:a17:906:aad8:: with SMTP id kt24mr579322ejb.527.1592421501959; Wed, 17 Jun 2020 12:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592421501; cv=none; d=google.com; s=arc-20160816; b=Zuteyt3Z0XzjZODuJC5OsO0iqH8XtVOPCDCgK65rf6GyVYB+UG4xPftNKSPqAA/zu+ +rJpSJazXN7WvXWA8KsrNyokLQitx+O28+S1VeG1QZ/brjDmtO9WRQcoCT+SruyW/oXv aWvfy1Z9MQIGhS+yo58bBtH9KZcvb+korIxeDgNl48ruF00vjg8e2RIbZT39S21/9nZN 6neiH4unB6I4NfxdNG5KjrVNZQOZgjMrWRvMSX4DXaMgdx7qxuPBGiYLxicAJGzRSDHZ bfh5an5kqsg5k1CgrkmWT43DE/7GNqBv4P6VGY6pYLr5hG4flyQLBg3OffJ/URP7ZLxB 7JqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=ZPbvhQewfct/OWm/F6unqEiZClSVxgiyqi8wr4cCpBQ=; b=PmiZo61mcKX68CKhCEROJw/EEhWSVwMwFwQ+vXjceAr//w2tCaHUdxPqkmYesaOmiv IBcdTV+eQd/rxCu38UtZrp8RaLlvs1SiaItlV7S+YeOQKnI8vL/DxAWTDB8D25+UUV4M MTPScf2kZuUPfQpy+rt6ljM8PMK3LHntKsRWzCEf7nDl5N/btWDrwCRM9bAs973Z9txr 74bOIxk5m/jGVYLFjyetaNKo90JCSjEWzluqdI6j2/Q4VmRPGkBQzs8r8VhOonWq3joS Z7yqya6+Kh2mt21hTjtQn7FZWKbFRFCu5o6XOMBoOKWE4VGCY5Z0lWg/sm9FsWzkn4uw xOew== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q25si586432edb.587.2020.06.17.12.17.58; Wed, 17 Jun 2020 12:18:21 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726840AbgFQTPX (ORCPT + 99 others); Wed, 17 Jun 2020 15:15:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:60036 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbgFQTPV (ORCPT ); Wed, 17 Jun 2020 15:15:21 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B724AAE2C; Wed, 17 Jun 2020 19:15:22 +0000 (UTC) Message-ID: <954083bf13bd7c24c31c9673269ea0eedb925f43.camel@suse.de> Subject: Re: [PATCH v4 4/5] dm: pci: Assign controller device node to root bridge From: Nicolas Saenz Julienne To: Simon Glass Cc: Matthias Brugger , U-Boot Mailing List , Bin Meng , Marek Vasut , lk , Marek Szyprowski , Sylwester Nawrocki , Mark Kettenis Date: Wed, 17 Jun 2020 21:15:16 +0200 In-Reply-To: References: <20200612164632.25648-1-nsaenzjulienne@suse.de> <20200612164632.25648-5-nsaenzjulienne@suse.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-C+TXhUdXAiW5aA7sAVb3" User-Agent: Evolution 3.36.3 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-C+TXhUdXAiW5aA7sAVb3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2020-06-16 at 17:31 -0600, Simon Glass wrote: > Hi Nicolas, > > On Tue, 16 Jun 2020 at 08:09, Nicolas Saenz Julienne > wrote: > > On Tue, 2020-06-16 at 07:43 -0600, Simon Glass wrote: > > > Hi Nicolas, > > > > > > On Fri, 12 Jun 2020 at 10:47, Nicolas Saenz Julienne > > > wrote: > > > > There is no distinction in DT between the PCI controller device and= the > > > > root bridge, whereas such distinction exists from dm's perspective.= Make > > > > sure the root bridge ofnode is assigned to the controller's platfor= m > > > > device node. > > > > > > > > This permits setups like this to work correctly: > > > > > > > > pcie { > > > > compatible =3D "..."; > > > > ... > > > > dev { > > > > reg =3D <0 0 0 0 0>; > > > > ... > > > > }; > > > > }; > > > > > > > > Without this the dev node is assigned to the root bridge and the > > > > actual device search starts one level lower than expected. > > > > > > > > Signed-off-by: Nicolas Saenz Julienne > > > > --- > > > > drivers/pci/pci-uclass.c | 15 ++++++++++++++- > > > > 1 file changed, 14 insertions(+), 1 deletion(-) > > > > > > Can you update the tests to handle this case please? > > > > I'd be glad to, but I'm not familiar with the test FW in u-booy, coud g= ive > > me > > some pointers on where/how to test this? > > > > Yes it is at test/dm/pci.c and the device tree is test.dts > > 'make qcheck' to run all tests. To run one test, build for sandbox and > then something like > > u-boot -T -c "ut dm pci_swapcase" > > for example. > > You can perhaps use an existing PCI controller in test.dts but feel > free to add one more if you need it for your test. Make sure that you > don't break other tests. Thanks for the info. Actually adding the tests made me doubleguess myself, and now I'm pretty su= re that what I shoudl've done in DT is the following: &pcie0 { pci@0 { #address-cells =3D <3>; #size-cells =3D <2>; ranges; reg =3D <0 0 0 0 0>; usb@1,0 { reg =3D <0x10000 0 0 0 0>; resets =3D <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>; }; }; }; (with "lspci -tv": [0000:00]---00.0-[01]----00.0 VIA Technologies, Inc. VL= 805 USB 3.0 Host Controller) With this the patch above isn't needed, which is great. I'll send this to upstream Linux just to get a confirmation this is correct= , although if you have any comments it'll be appreciated. Regards, Nicolas --=-C+TXhUdXAiW5aA7sAVb3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl7qa8QACgkQlfZmHno8 x/5HKAf/VE3jKjTDXedZWguvOmcbQ8MamvcvMoG7eMXVYZq2CyuZx3el/7OD1kQc mJh2y045Kjs60uOf64auqvVtx3r+2WwUC35EiRi7rBFUL4OEtM+JnOxsI4i/pBVT y4/xy1Z6XQ4/9h1uWyU98zQir6mNb9JHQ/uf8hR/yoilHcArwUSrnSQgGn3P/5XX UhV34+3/pryJNKlfk+WrzD/k1BrA744X49gdRfdsNuDxq/KrTdGWUL1022J1Gbr3 G8rD6YmZNO6I2+JnwUZgfOljakBM7C7B8GROZ92SbJjSMtbWJ26ADSaSCNikIzHB MLLejB5M91/NeW1QwqJU1hdDi50IUA== =TJ4O -----END PGP SIGNATURE----- --=-C+TXhUdXAiW5aA7sAVb3--