Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1472814rdh; Mon, 25 Sep 2023 14:02:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIgnVSHr7kQa4ma8AlFiMYAc3V5rcw3hTw0acOzdm2VNANB+UelhatrrR5olOkkVlqXVBi X-Received: by 2002:a1f:4c41:0:b0:48f:e0c4:1a1 with SMTP id z62-20020a1f4c41000000b0048fe0c401a1mr4648954vka.12.1695675722459; Mon, 25 Sep 2023 14:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695675722; cv=none; d=google.com; s=arc-20160816; b=dY2kE3Uo3Zym+WYTYajFJqc/tbcl3MBoUCUzWJSEFKZ/uzyGxoh1wRLxEruhpc6qq5 0eegYRkD7OT3/62OT67bZkYaP70dxF+C/3itAls111HmlFWqFO1PWlKj8gTAjeifGwNt 3fTH4gM8TtdWnatWGhm3vO7myeTwMfprw26g3K5hgzgXnrVEtxpN9W49b9Jci3+PvzW8 o6zZx/Tf2i1E4WHpvYWxJq8QRxqt4Nq1wjeTiBfp3/LPPHeg+T2YUkYk8BArnIoE/n/4 JD2k/wEXDPVcagp2nt8kurgpSUmC6cabh96nXVXK6/wufTgLFWN4+r4f8qZNnlFyOyez 9eNg== 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=df+hhupkKUPOCtNQfjuHQM39kta9RjPk/8X762Oizek=; fh=9MGv7YQUmVE5emCVkJ+3ACi12HMYxsP9CRM6tyK4U0Q=; b=iqBqDauTykjeDlD2xr7ffkVHR00iG2E78ygrpg2QELWXA2/ycgIM/b+eO9uZi79k8F yHdm6mAElnxM77H47fK4gPRXa7oAznNci8VYwDIOCK+OBLeX8Hjj7KOok6mQWbh48kQG HQg4k8RC708YieEXFFzmkCrKTao1ynUk98jHzkdUveoydspikB4r6+u3nfdntRrS2DvE KqLEX8DOL54+Qw74UQdkkJmzKSnSsqHfKaxECk4MY55DcmGQhd1YjL9jO7nT5FXLBvCs BPUEo2q0nFgsWeKO9938rPI4qVqQw51+Ds+vtfoVvvd0wO69CLFmSNhAauPA5SLoZBCe eJjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Yj7TZPGy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id o19-20020a056a0015d300b0068e3efe866esi11818880pfu.146.2023.09.25.14.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 14:02:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Yj7TZPGy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id E31F2802F68B; Mon, 25 Sep 2023 08:58:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232936AbjIYP6W (ORCPT + 99 others); Mon, 25 Sep 2023 11:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232660AbjIYP6T (ORCPT ); Mon, 25 Sep 2023 11:58:19 -0400 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 B9CE6B8; Mon, 25 Sep 2023 08:58:11 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2001:b07:646b:e2:e4be:399f:af39:e0db]) (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: laura.nao) by madras.collabora.co.uk (Postfix) with ESMTPSA id 7587266072FC; Mon, 25 Sep 2023 16:58:08 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695657489; bh=/jor1FFC8SKohb/3sjU4fNSEVcDdd5txHAwwx7fIBc0=; h=From:To:Cc:Subject:Date:From; b=Yj7TZPGyFSKyYUXBAftWJ3qbMbHh0mNoeK4uMfrKq9i3JM/0QRIIHCkI+AyPTbQAl P/89sJTx9UWu7mnSpcKa03WHuHHuo6EjAquah4HRMEB+hajtAU9dLrsPklof/fEIRg ZQ35ITZn9dbYss1m75f6PsBPGP+sLgA7pCL1hdhhYs4RGi70xIteGWNGIE4gKwmYcW nHLW++Y1ii3M7l7DeJ0upjzB84UscOnXAhY1RtHIBSlWqBE1AnIyuEoTZeyMulbfVW SYEmByZhyhfZlKGQCMwcE6GeryzXqOtL9oFmtKW5PCkq/3IqiXEYKFfS9WNxwC3TN3 8TjP9ypoHuQhw== From: Laura Nao To: rafael@kernel.org, lenb@kernel.org, shuah@kernel.org Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kselftest@vger.kernel.org, groeck@chromium.org, broonie@kernel.org, robh+dt@kernel.org, kernelci@lists.linux.dev, kernel@collabora.com, Laura Nao Subject: [RFC PATCH 0/2] Add a test to verify device probing on ACPI platforms Date: Mon, 25 Sep 2023 17:58:04 +0200 Message-Id: <20230925155806.1812249-1-laura.nao@collabora.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 25 Sep 2023 08:58:38 -0700 (PDT) Regressions that prevent a driver from probing a device can significantly affect the functionality of a platform. A kselftest to verify if devices on a DT-based platform are probed correctly was recently introduced [1], but no such generic test is available for ACPI platforms yet. bootrr [2] provides device probe testing, but relies on a pre-defined list of the peripherals present on each DUT. On ACPI based hardware, a complete description of the platform is provided to the OS by the system firmware. ACPI namespace objects are mapped by the Linux ACPI subsystem into a device tree in /sys/devices/LNXSYSTEM:00; the information in this subtree can be parsed to build a list of the hw peripherals present on the DUT dynamically. This series adds a test to verify if the devices declared in the ACPI namespace and supported by the kernel are probed correctly. This work follows a similar approach to [1], adapted for the ACPI use case. The first patch introduces a script that builds a list of all ACPI device IDs supported by the kernel, by inspecting the acpi_device_id structs in the sources. This list can be used to avoid testing ACPI-enumerated devices that don't have a matching driver in the kernel. This script was highly inspired by the dt-extract-compatibles script [3]. In the second patch, a new kselftest is added. It parses the /sys/devices/LNXSYSTEM:00 tree to obtain a list of all platform peripherals and verifies which of those, if supported, are correctly bound to a driver. Feedback is much appreciated, Thank you, Laura [1] https://lore.kernel.org/all/20230828211424.2964562-1-nfraprado@collabora.com/ [2] https://github.com/kernelci/bootr [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/dtc/dt-extract-compatibles Laura Nao (2): acpi: Add script to extract ACPI device ids in the kernel kselftest: Add test to detect unprobed devices on ACPI platforms MAINTAINERS | 2 + scripts/acpi/acpi-extract-ids | 60 +++++++++++++++ tools/testing/selftests/Makefile | 1 + tools/testing/selftests/acpi/.gitignore | 2 + tools/testing/selftests/acpi/Makefile | 23 ++++++ .../selftests/acpi/test_unprobed_devices.sh | 75 +++++++++++++++++++ 6 files changed, 163 insertions(+) create mode 100755 scripts/acpi/acpi-extract-ids create mode 100644 tools/testing/selftests/acpi/.gitignore create mode 100644 tools/testing/selftests/acpi/Makefile create mode 100755 tools/testing/selftests/acpi/test_unprobed_devices.sh -- 2.30.2