Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5375427rdb; Wed, 13 Dec 2023 07:05:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGc8z1mVUnTUr26l2H+Twm0W5+L0MrfuLvZUCFzNgOSKWo6z2WmY+7hBFgFnOG5VignXu2K X-Received: by 2002:a17:902:d2c1:b0:1d0:a7b7:74c2 with SMTP id n1-20020a170902d2c100b001d0a7b774c2mr4739262plc.43.1702479908046; Wed, 13 Dec 2023 07:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702479908; cv=none; d=google.com; s=arc-20160816; b=q8bMRGJmhc5noabidC8XM4Kc9bsozXhdDHJUIMKQpBStj2YSnZAsBPJ8rEHiKpkdFf HO1eTVAJ2TIsrJSbguazFR0y16Jnq9sJ35W3o4dShfWLggsh0vIQjYU0mmNWgUxUUY5w 9HuWP9Q05UoHRgM7WcyzHDzf04msu+erD1q1ETdcmSEJM+ff8AWQLvGD5APGsMQiP3j8 Z9CKlbt9J7l1i+yeHha26KdEg73Nmc7vYx4AL4uBkBMF8smdcOuqkHQPTv6A6eEJbZqZ yR0YH+LIEp1x4plM87vBkhGU+PqiyHAsrRs8rUAi2XdZaNeL2mODfy/rOGWB3XDMTWvA BznQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nLxZSg/yD+znXZHWu4Vars8EQtCSP3KKevIj0nvJOvg=; fh=ik18VXN6BSATvj1oh0eZyOCtggo4fzpHsUkWDFyapHw=; b=DvI55yriNwqYT5DZt7GA4phKFGt6I8ZXuQGWNhvLO2l01wf64Cck5794sPsxTCtxlo CKYl8uoXo+HR6FLGUmvbTf6pPIqJqsZaInv2seJDn8OWLuOdxIhA+ojPJBuBDVlMbQ6H tJY8RMxV9tUkdhEF+4+4rVHvHCNKavl+ni84cbRSGfFgFjWGDRfhYcnwE5ASDi0Yzsj5 A6echquTDCgcfRMeVW2jkQXiL4pX9KgfywsXgZlts1hLlSAauZpOZpUtT5q5eO4Brac2 3VuF8XlRJqBDmMlsmFjYinmOdrLsoNwco7OWsllsYdKKLylcsDlG/l0g4JVTtLW5s07i th+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FXfv4/Lq"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f12-20020a17090274cc00b001d0be32b0cfsi9715127plt.33.2023.12.13.07.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:05:08 -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=@kernel.org header.s=k20201202 header.b="FXfv4/Lq"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E6F008031AE4; Wed, 13 Dec 2023 07:05:05 -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 S1442122AbjLMPEv (ORCPT + 99 others); Wed, 13 Dec 2023 10:04:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442104AbjLMPEs (ORCPT ); Wed, 13 Dec 2023 10:04:48 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0158A0 for ; Wed, 13 Dec 2023 07:04:54 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23D54C433C7; Wed, 13 Dec 2023 15:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702479894; bh=nLxZSg/yD+znXZHWu4Vars8EQtCSP3KKevIj0nvJOvg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FXfv4/LqeVxml8cC8xOBVkj+C55XQsUDotUQ7wQUxQWoFbyIib8cxLn83khaDCc4k TILfe0piJJA6WNjTiLEbHky3WCF3flzGtV+5xo0vYZQlBu4zRP3y29JPvzgpQlvpSX vVpfhuu6luVuxCbLAUa4tNmNKCq0zOs07W4sF7mJyieBq7NX65GCPoLpF+ROydPe0K Zz1W/D9mBRGgS/BsylPZd0XI4b2QIJ7IMKiVxK6Ho3Fi47X9WIOzlsYqJJ9ZFxueeg udiK2Vi7fEU/qhifgMPuGQMc57/j6njhGJ4fwgdvcWN7OvaGicgLZv7oDBpNVisLX/ WMtM18XMSrccg== Date: Wed, 13 Dec 2023 16:04:52 +0100 From: Maxime Ripard To: davidgow@google.com Cc: Rae Moar , Brendan Higgins , Greg Kroah-Hartman , Matti Vaittinen , Stephen Boyd , Shuah Khan , Jonathan Corbet , Kees Cook , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, linux-sound@vger.kernel.org Subject: Re: [PATCH v2 0/4] kunit: Add helpers for creating test-managed devices Message-ID: <7rgeotye4grxdtbxip53fykjm4a3sudochsfzdvkmyqltvj7zv@qekkt42x2j25> References: <20231208-kunit_bus-v2-0-e95905d9b325@google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="znksof6fizamytva" Content-Disposition: inline In-Reply-To: <20231208-kunit_bus-v2-0-e95905d9b325@google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: 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]); Wed, 13 Dec 2023 07:05:06 -0800 (PST) --znksof6fizamytva Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi David, On Fri, Dec 08, 2023 at 06:09:28PM +0800, davidgow@google.com wrote: > KUnit tests often need to provide a struct device, and thus far have > mostly been using root_device_register() or platform devices to create > a 'fake device' for use with, e.g., code which uses device-managed > resources. This has several disadvantages, including not being designed > for test use, scattering files in sysfs, and requiring manual teardown > on test exit, which may not always be possible in case of failure. >=20 > Instead, introduce a set of helper functions which allow devices > (internally a struct kunit_device) to be created and managed by KUnit -- > i.e., they will be automatically unregistered on test exit. These > helpers can either use a user-provided struct device_driver, or have one > automatically created and managed by KUnit. In both cases, the device > lives on a new kunit_bus. >=20 > This is a follow-up to a previous proposal here: > https://lore.kernel.org/linux-kselftest/20230325043104.3761770-1-davidgow= @google.com/ >=20 > (The kunit_defer() function in the first patch there has since been > merged as the 'deferred actions' feature.) >=20 > My intention is to take this whole series in via the kselftest/kunit > branch, but I'm equally okay with splitting up the later patches which > use this to go via the various subsystem trees in case there are merge > conflicts. Could you take (and apply eventually) that patch as part of your series? https://lore.kernel.org/linux-kselftest/20231205090405.153140-1-mripard@ker= nel.org/ Thanks Maxime --znksof6fizamytva Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZXnIFAAKCRDj7w1vZxhR xbTWAQC3bH552498SP6tLXv7kKo878Z61Buc15OZAdQwh4kdXQEA9UZqLQkvJTrT kQ13+qYaarJ8Jpvwt41WGCqAxaRt7gw= =yRUg -----END PGP SIGNATURE----- --znksof6fizamytva--