Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1061587rdh; Fri, 27 Oct 2023 03:48:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyP7HtSUcr5sOcF4VgQTrheG/HcOwAA2rpwciUOmp9n1soaA3KF6PLtdi0ghjXE83kcauR X-Received: by 2002:a25:b0a7:0:b0:d81:917c:69b with SMTP id f39-20020a25b0a7000000b00d81917c069bmr2221314ybj.10.1698403738941; Fri, 27 Oct 2023 03:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698403738; cv=none; d=google.com; s=arc-20160816; b=q27g6396g/Zf8LWAR5AKr55KvgFx2TWIynDoeG5vBMVX8GNWcN3PcMgeWy84ule75z 14+m+eTHbn1hbhHcUw7ztb6vaoZii9Of4RIxYg0m651T6jL5K0P5Sd9yxiPf5q1kgW66 ENKWkvEOtUmOJBsJwXImJ8XlhVPOUupjtTLxCWATom7MCojA/lPTieFsbVimGHNY8KWr FY67NKokTgpJQwNbtNbxwqrNdVfoAezusbGuiZ/CiCNc1U+FVFmwIpvRvBEiwHKWsxJK gb5OCn6jqmBl3lacn7s/T97PwsjPKQQXJqOicEqZhK/gZU7t8XIWY+DAVJPcErAGPgXD gQRg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=E+aquFmoTNS6VPVchT9bUz4G7G0+6Kdbb42OvWWIeDE=; fh=UniV0BFFJx0Ti47/gRT4pIgk9+zI2IjygxKueIxmEaU=; b=F3qsOEoyFN804YNQ5AjrE6zJBBn1l7SC9qUIre+8n05NTUOdvFRabkdlgc0nHj6kkn bW5T7efpC0hNfmm8qrU/hCU7M9iN2UtsHfGBes1pwoIkrRaMzRK/4J3asf9qdR1fmfqh Bf3yNXug6T/WnmhOBm7ZbMwNAOSwTH60GJA7rQJLlkEACcwLT0Ww0jurCypRc0LnE+4v Cz1HIHSK0JhqWnb0Gnqc8zSk4C3BfA3FmLx4DRaQ3LM9asEiBE0OA+XQzsocbtDLYma/ cXwaosNUZQGd8nZYZ9c/vW3FsD+gNZ/+lZX1FE8el2XC8lkiAoy3XoAN9/8vADTJbwtF Jvlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CDSQ5ljs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id q5-20020a25bfc5000000b00da086d7a8b0si2230961ybm.339.2023.10.27.03.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 03:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CDSQ5ljs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 468B582589BD; Fri, 27 Oct 2023 03:48:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345614AbjJ0Ksl (ORCPT + 99 others); Fri, 27 Oct 2023 06:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345488AbjJ0Ksl (ORCPT ); Fri, 27 Oct 2023 06:48:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7C9218A; Fri, 27 Oct 2023 03:48:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1405CC433C8; Fri, 27 Oct 2023 10:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698403718; bh=pdqyUpjnJETQTTg6qumMQ/p4tHoLqFJ17ihizDcU5q4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CDSQ5ljsEcWX+HUq4rJfeBOytD0XpDlZRJ1xeD5gRtzx9dZO/vzijYCroJKiY7Kd6 twy4kIYSJWoczXhGWP7Xn/K2tKcxNJtJTdrCVuMdVFALdlbWYcgP1NZa0w7PlxyAlN KLuSX4RSNL3ZK+ShiIE0u1N0dpOh34vDbRYorrlo= Date: Fri, 27 Oct 2023 12:48:35 +0200 From: Greg Kroah-Hartman To: =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado Cc: Shuah Khan , Bjorn Helgaas , devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, Rob Herring , linux-kselftest@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 2/2] kselftest: devices: Add board file for google,spherion Message-ID: <2023102747-conclude-backside-a579@gregkh> References: <20231024211818.365844-1-nfraprado@collabora.com> <20231024211818.365844-3-nfraprado@collabora.com> <2023102546-filled-onboard-3dfb@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 27 Oct 2023 03:48:56 -0700 (PDT) On Wed, Oct 25, 2023 at 08:32:42AM -0400, N?colas F. R. A. Prado wrote: > On Wed, Oct 25, 2023 at 12:32:15PM +0200, Greg Kroah-Hartman wrote: > > On Tue, Oct 24, 2023 at 05:18:00PM -0400, N?colas F. R. A. Prado wrote: > > > Add the list of devices expected to be probed from the USB and PCI > > > busses on the google,spherion machine. The USB host controller at > > > 11200000 is shared between two busses, for USB2 and USB3, so an > > > additional match is used to select the USB2 bus. > > > > > > Signed-off-by: N?colas F. R. A. Prado > > > --- > > > > > > tools/testing/selftests/devices/boards/google,spherion | 3 +++ > > > 1 file changed, 3 insertions(+) > > > create mode 100644 tools/testing/selftests/devices/boards/google,spherion > > > > > > diff --git a/tools/testing/selftests/devices/boards/google,spherion b/tools/testing/selftests/devices/boards/google,spherion > > > new file mode 100644 > > > index 000000000000..ba86ffcfe43c > > > --- /dev/null > > > +++ b/tools/testing/selftests/devices/boards/google,spherion > > > @@ -0,0 +1,3 @@ > > > +usb camera 11200000,PRODUCT=.*/2/.* 1.4.1 1 0,1 > > > +usb bluetooth 11200000,PRODUCT=.*/2/.* 1.4.2 1 0,1 > > > +pci wifi 11230000 0.0/0.0 > > > > USB busses (and PCI ids) are not determinisitic and can, and will, > > change values randomly. So while it is nice to test "did the devices > > show up properly", you can not do that based on bus ids at all, sorry. > > > > Unless I'm reading these values wrong? What are the fields > > representing? Perhaps a comment at the top to describe them so that we > > know how to parse them? > > Hi Greg, > > I have described the fields in the commit message of patch 1. Here they are: > > usb [,] > > pci That's not a good place to document them, we'll never find them, and I obviously missed it as well. Please put it in a comment at the top of this file _AND_ in a comment in the script that parses these files. > I'm aware that bus IDs are assigned at runtime, and that's exactly why I've > avoided those in the test definitions, instead describing the hardware topology, > which won't ever change. > > And just to be extra clear, by hardware topology I mean: > > For USB, we find the USB bus based on the address of its controller (and > optionally its productID if two busses share the same controller for USB2 and > USB3), What exactly do you mean by "address" of a controller? That will be unique per bus-type that the controller lives on, right? > and then find the device by following the ports at each hub. The > configuration number and interfaces then describe what interfaces to check for > presence and driver binding. Ok, good, hub and port locations _should_ be stable, but note they have changed at times so you will have to deal with that for the next 20+ years, are you ok with that? > For PCI, we find the controller again based on its address, and follow the > device-function pairs at each level in the topology until we arrive at the > desired device. "address"? What exactly do you mean by this value? For PCI, that will change. > We don't rely on the USB bus number, nor on the PCI domain and bus number, since > these are all assigned at runtime. You are relying on a specific sysfs tree as well, are you able to handle it when new devices get added to the middle of a device path? That sometimes happens in sysfs too. thanks, greg k-h