Message ID | 20231127233558.868365-1-nfraprado@collabora.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3545609vqx; Mon, 27 Nov 2023 15:36:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF267dHDtx9xDwEfZdltLL6DP4yFeICxsYPbbmS5/O8Vj5XYTuR93bdbeJ6pSqmTNM/1EiF X-Received: by 2002:a05:6808:e83:b0:3b5:6432:e0eb with SMTP id k3-20020a0568080e8300b003b56432e0ebmr16012271oil.38.1701128174599; Mon, 27 Nov 2023 15:36:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701128174; cv=none; d=google.com; s=arc-20160816; b=zsPTPBCbFsnkIklL6ZLfLedF3ntR3F7MP2xYsFh8C1WvGubMViWbnuHVl9jk+MHfgw BF+jhU3iSxM4g5EY6U7THQe/QQkK/gObK9/Y6pFMk6/CeNRK2vuJO5OlU2iAwfMEF01h 8pgvLPNSHD13CO3WZlqJONNMLYreyTqUV5ZIW7mgNkRrgzx9icmY8VA59g5Z9i2c0xt+ dDaxOzqwiDz2BALbuS/Q1lE73B04qELomg116994fRu9F8z0O0dyEZoSYA2mkVMPfy14 RK+IndGBkWNQ0tboxM/gPXhIG6KekDL/bWL3TjOjDowCA7vSSLchmgp6Bo9oTS4OJ77q 76yw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=SjNKM+yqg8+qP4Z113hm5utSeixEc991fLWZ6ZzN7l8=; fh=PT/fWAWUJUNvRr+2iNVO8+Jh8Gwj1ty5Hf/jdhUuinE=; b=lR6+VP3oDwugbfNoO5yMD2LwkF3y5fPeamO2F8UYWsqIwoSCypcq09ch2i50ETAq6o RqkEMLTuvfJ6GXNsAgPQOFK4FC4B3n8yIACsSfhvoW4uri404mJJXdofbP0LfUpY+u64 wPH1OFE3IUBfuFhke0hTQ6HWNFhDh/aSatmkx/ZpoakFn7BUPbemlz2tqy9uYqRyYPdK akgzXWmwBMVqN9k0vwEEy86dtbWSusOuTAGoNUFJh/7Ns8MgHY8LoLCVovlrWc/HcK0N PGvoi6RcXcs7jmo7kFDd1YDbCmRk+9Im7JtWjBvaAAq8t4+p7PrB7S57M/DjiPGIn6lA 9WQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=H9emDfZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u7-20020a63d347000000b005c1b2f29f24si10663021pgi.512.2023.11.27.15.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 15:36:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=H9emDfZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 15E13806B568; Mon, 27 Nov 2023 15:36:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232953AbjK0XgE (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Mon, 27 Nov 2023 18:36:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbjK0XgC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 27 Nov 2023 18:36:02 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FEF81AD; Mon, 27 Nov 2023 15:36:08 -0800 (PST) Received: from notapiano.myfiosgateway.com (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1075566022D1; Mon, 27 Nov 2023 23:36:02 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701128167; bh=YEe8v7wDFFs3gQgZ9RcTV5I1wDd3U2Sg4ahCaTkprQo=; h=From:To:Cc:Subject:Date:From; b=H9emDfZbsGRiS+F7o/zTjCwpKOs9ATigOjvWWhy0SbmNQ69YCARc1007iQcAPpPaJ d68ud9ABQ5h4isZTQstZd7TVlnqHPX+5aKqTnST515c8vuv+CdsdgBAmIu2PRQ1o6J KHiWC5kJd7I4I0SWI99sgftn5KTtNDda51pfVjMR/5HjQAbu2WG3eegfZxZQSDEHBg kZ8kQDTJOOkQrAGLZQgsBlcTnAYqgwoEJxwEdYGzT7sispRNN7BzmSS8D9wQbZhQW9 HeRoF10/cE7rO/VNqgF7DVIO74rsHEBCma2H6cqN+If86xm+TY7TP7x8AYbEHmH/Pq IWg9QJj2qfGZQ== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com> To: Shuah Khan <shuah@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Bjorn Helgaas <bhelgaas@google.com> Cc: Saravana Kannan <saravanak@google.com>, Rob Herring <robh+dt@kernel.org>, kernelci@lists.linux.dev, David Gow <davidgow@google.com>, Guenter Roeck <groeck@chromium.org>, linux-kselftest@vger.kernel.org, linux-usb@vger.kernel.org, kernel@collabora.com, Dan Carpenter <dan.carpenter@linaro.org>, Tim Bird <Tim.Bird@sony.com>, linux-pci@vger.kernel.org, Doug Anderson <dianders@chromium.org>, devicetree@vger.kernel.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>, linux-kernel@vger.kernel.org Subject: [RFC PATCH v2 0/2] Add test to verify probe of devices from discoverable busses Date: Mon, 27 Nov 2023 18:34:05 -0500 Message-ID: <20231127233558.868365-1-nfraprado@collabora.com> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 27 Nov 2023 15:36:13 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783762176618038453 X-GMAIL-MSGID: 1783762176618038453 |
Series |
Add test to verify probe of devices from discoverable busses
|
|
Message
Nícolas F. R. A. Prado
Nov. 27, 2023, 11:34 p.m. UTC
Hi, v1 [1] was discussed during Plumbers [2], where a lot of feedback was given. I hope to justify the changes in v2 and address the feedback here. One feedback from Shuah was that keeping per-platform files with the USB/PCI devices to test as part of the kselftest tree wasn't maintainable. One proposed alternative was to generate a list of probed devices on a known-good kernel and use that as a reference. However you need someone to look at that generated reference to be able to say it is a good one, and you need to save it to ensure it will be reproducible later anyway, so that wouldn't actually solve the problem. It is a matter of hand-crafting vs generating the test definitions, but they will need to be vouched by someone and stored somewhere in both cases. So for this v2, in patch 2 I just have a sample test definition, and the per-platform test definitions would be added to a separate repository. The other feedback received was that the BIOS might reconfigure the PCI topology (at least on x86), meaning that relying on a sequence of device and function numbers (eg 1d.0/02.0/0.0) as a stable description of a device on the platform is not possible. I couldn't verify whether this is really the case (if you have any more insight into this, please let me know), but with that in mind, here in v2 I have taken a different approach. Here I'm using the device's properties which are used for driver matching (the same that show on modalias) to identify a device in a stable way. This approach has some drawbacks compared to the one on v1. For one it doesn't uniquely identify a device, so if there are multiple of the same device on a platform they have to be checked as a group. Also the test definition isn't as human-readable. I'm adding in CC the people I recognized at the Plumbers session that were interested in this work. Feel free to add anyone missing. Thanks, Nícolas [1] https://lore.kernel.org/all/20231024211818.365844-1-nfraprado@collabora.com [2] https://www.youtube.com/watch?v=oE73eVSyFXQ&t=9377s Original cover letter: This is part of an effort to improve detection of regressions impacting device probe on all platforms. The recently merged DT kselftest [3] detects probe issues for all devices described statically in the DT. That leaves out devices discovered at run-time from discoverable busses. This is where this test comes in. All of the devices that are connected through discoverable busses (ie USB and PCI), and which are internal and therefore always present, can be described in a per-platform file so they can be checked for. The test will check that the device has been instantiated and bound to a driver. Patch 1 introduces the test. Patch 2 adds the test definitions for the google,spherion machine (Acer Chromebook 514) as an example. This is the sample output from the test running on Spherion: TAP version 13 Using board file: boards/google,spherion 1..3 ok 1 usb.camera ok 2 usb.bluetooth ok 3 pci.wifi Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0 [3] https://lore.kernel.org/all/20230828211424.2964562-1-nfraprado@collabora.com/ Changes in v2: - Changed approach of encoding stable device reference in test file from HW topology to device match fields (the ones from modalias) - Better documented test format Nícolas F. R. A. Prado (2): kselftest: Add test to verify probe of devices from discoverable busses kselftest: devices: Add sample board file for google,spherion tools/testing/selftests/Makefile | 1 + tools/testing/selftests/devices/.gitignore | 1 + tools/testing/selftests/devices/Makefile | 8 + .../selftests/devices/boards/google,spherion | 12 ++ .../devices/test_discoverable_devices.sh | 160 ++++++++++++++++++ 5 files changed, 182 insertions(+) create mode 100644 tools/testing/selftests/devices/.gitignore create mode 100644 tools/testing/selftests/devices/Makefile create mode 100644 tools/testing/selftests/devices/boards/google,spherion create mode 100755 tools/testing/selftests/devices/test_discoverable_devices.sh