Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1578007rdb; Wed, 20 Sep 2023 13:10:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeEQw1xpUMD/2GoBvH/Ppuk26iYcVecgrfOTqhk8DLJM1dQgwnk1PG4r5KinodnyXeGpQa X-Received: by 2002:a17:90a:c245:b0:268:3f6d:9751 with SMTP id d5-20020a17090ac24500b002683f6d9751mr3923158pjx.23.1695240657403; Wed, 20 Sep 2023 13:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695240657; cv=none; d=google.com; s=arc-20160816; b=JUSgVO6Vc4K3vZhJnTllr4kRB0KVPyEyzX45fEKG5dubTJzWCaQ70FzwwYw5h0RxBk 8GrlJ945rQEJDVN1xM4wzcxQTLsSJzyWIuivhM72de9191HOfSYVyhug9krEYGepgXuJ QJrxvvqO8PsU6aQGiSkliNb2DZtGfMo1coD/+tJaAMoOuoQWlSuFSRoLumoAa9xFLvQN 3K0e/1Eib7AwsNE2RLlrwNDuP3B1kbXvDb2TtAwaFW6qnUKtYY2wL5LDrCytGFpsTa9b tWhwvIJmT22jglpTsk6L+/mYVcmIMzg6+AMryW85pX6L8cBRgpa7Q//53YNfTujZXRKZ 8rrA== 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=hUw7nhxrzFWgyzIsD+p89MxDjK+LVTjHRSKe59+bfok=; fh=ASJe5AGQII/MTtDbMy/y94gaPd10Vl/TXyrAKYx4zuo=; b=XBa5mveckFDFg1x7OVIu+iMQ5KgPjyboH0JHP2sEM3qbs4prkY/SfXPW+gX8zYPV9D HYZkdgoEAKgZ6GB+Wm8OTMBxi87M1AfRPlp3ii8Gnfma1ZPzjGQ1rk8hMsc+aw28R6Se MY8xprozszEuKiQwq3mMhBFVFfX91CW24qsjPbdlR1yn62RIQd7Vw5s6ychpkmEAi9Fa f9X/7zmz1+NuLfQ+val1uhS6UW7VlJFAh4w1RWNbi70j+7U5EpaXX4Nk1bcqJyhS73T4 6hWY2wP2Ao8NbEyBcn7BXoMJD8CoVv3qCT0zeUozR+Ed52SLHzune08IuEnAd1MD1GC0 Q/lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mh0SXSCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id o7-20020a17090aac0700b00276b35bc424si13319pjq.26.2023.09.20.13.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 13:10:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mh0SXSCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 131EC8032A2A; Wed, 20 Sep 2023 12:57:01 -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 S230117AbjITT4q (ORCPT + 99 others); Wed, 20 Sep 2023 15:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229840AbjITT4m (ORCPT ); Wed, 20 Sep 2023 15:56:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EBD2A9; Wed, 20 Sep 2023 12:56:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3492C433C9; Wed, 20 Sep 2023 19:56:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695239791; bh=hql+kAlfoekBXt3vTaUlDPCPrQsmIUz1/+7V8SFb+1I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mh0SXSCxI277x52AMsLpiUAKi4OdbN74SkXCBJ1erB5G8Q0U2erESV4xVcreGe11C tcD53cdu3OKl0FXCrQ8Z74MgPvufYKrCm2YDaM+dGTQlluoWt3+4N/vi1R8ArBeLdO ls5lfikybrVorW2FfJniAfC61bNdClvNxrJ2DMPOGFZOVsUWmDGFcNd7sh7ueaze6X naMurG4DY98f98wj3qaet6ZTTU685zfen0JwbYjmajv48va87B4Yzzr8e92YcoUYOM w7Oo+YettRVEEFb4TGfNjyc58RZkr2ptyRjdIdIPeq7Cnc+IaywoU85brGfJ32D2kj 01FyucPY3x0yQ== Received: (nullmailer pid 2823556 invoked by uid 1000); Wed, 20 Sep 2023 19:56:29 -0000 Date: Wed, 20 Sep 2023 14:56:29 -0500 From: Rob Herring To: =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado Cc: Frank Rowand , Shuah Khan , Mark Brown , kernelci@lists.linux.dev, kernel@collabora.com, Guenter Roeck , Bjorn Andersson , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v3 0/3] Add a test to catch unprobed Devicetree devices Message-ID: <20230920195629.GA2784994-robh@kernel.org> References: <20230828211424.2964562-1-nfraprado@collabora.com> <97c368a1-9c76-490a-848e-eacd6411e810@notapiano> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <97c368a1-9c76-490a-848e-eacd6411e810@notapiano> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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]); Wed, 20 Sep 2023 12:57:01 -0700 (PDT) On Wed, Sep 20, 2023 at 10:03:06AM -0400, N?colas F. R. A. Prado wrote: > On Mon, Aug 28, 2023 at 05:13:09PM -0400, N?colas F. R. A. Prado wrote: > > > > Regressions that cause a device to no longer be probed by a driver can > > have a big impact on the platform's functionality, and despite being > > relatively common there isn't currently any generic test to detect them. > > As an example, bootrr [1] does test for device probe, but it requires > > defining the expected probed devices for each platform. > > > > Given that the Devicetree already provides a static description of > > devices on the system, it is a good basis for building such a test on > > top. > > > > This series introduces a test to catch regressions that prevent devices > > from probing. > > > > Patches 1 and 2 extend the existing dt-extract-compatibles to be able to > > output only the compatibles that can be expected to match a Devicetree > > node to a driver. Patch 2 adds a kselftest that walks over the > > Devicetree nodes on the current platform and compares the compatibles to > > the ones on the list, and on an ignore list, to point out devices that > > failed to be probed. > > > > A compatible list is needed because not all compatibles that can show up > > in a Devicetree node can be used to match to a driver, for example the > > code for that compatible might use "OF_DECLARE" type macros and avoid > > the driver framework, or the node might be controlled by a driver that > > was bound to a different node. > > > > An ignore list is needed for the few cases where it's common for a > > driver to match a device but not probe, like for the "simple-mfd" > > compatible, where the driver only probes if that compatible is the > > node's first compatible. > > > > The reason for parsing the kernel source instead of relying on > > information exposed by the kernel at runtime (say, looking at modaliases > > or introducing some other mechanism), is to be able to catch issues > > where a config was renamed or a driver moved across configs, and the > > .config used by the kernel not updated accordingly. We need to parse the > > source to find all compatibles present in the kernel independent of the > > current config being run. > > > > [1] https://github.com/kernelci/bootrr > > > > Changes in v3: > > - Added DT selftest path to MAINTAINERS > > - Enabled device probe test for nodes with 'status = "ok"' > > - Added pass/fail/skip totals to end of test output > > > > Changes in v2: > > - Extended dt-extract-compatibles script to be able to extract driver > > matching compatibles, instead of adding a new one in Coccinelle > > - Made kselftest output in the KTAP format > > > > N?colas F. R. A. Prado (3): > > dt: dt-extract-compatibles: Handle cfile arguments in generator > > function > > dt: dt-extract-compatibles: Add flag for driver matching compatibles > > kselftest: Add new test for detecting unprobed Devicetree devices > > > > MAINTAINERS | 1 + > > scripts/dtc/dt-extract-compatibles | 74 +++++++++++++---- > > tools/testing/selftests/Makefile | 1 + > > tools/testing/selftests/dt/.gitignore | 1 + > > tools/testing/selftests/dt/Makefile | 21 +++++ > > .../selftests/dt/compatible_ignore_list | 1 + > > tools/testing/selftests/dt/ktap_helpers.sh | 70 ++++++++++++++++ > > .../selftests/dt/test_unprobed_devices.sh | 83 +++++++++++++++++++ > > 8 files changed, 236 insertions(+), 16 deletions(-) > > create mode 100644 tools/testing/selftests/dt/.gitignore > > create mode 100644 tools/testing/selftests/dt/Makefile > > create mode 100644 tools/testing/selftests/dt/compatible_ignore_list > > create mode 100644 tools/testing/selftests/dt/ktap_helpers.sh > > create mode 100755 tools/testing/selftests/dt/test_unprobed_devices.sh > > Hi Rob, > > gentle ping on this series. > > I take it you'll be merging this through your tree, so I've added Shuah's R-b > that she supplied on v2 for the kselftest patch. Sorry, now applied. If you send something before or in the merge window, it is best to rebase and resend after rc1 comes out. Rob