public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND 0/2] drivers: base: Add tests showing devm handling inconsistencies
@ 2023-06-02 15:20 Maxime Ripard
  2023-06-02 15:20 ` [PATCH RESEND 1/2] drivers: base: Add basic devm tests for root devices Maxime Ripard
  2023-06-02 15:20 ` [PATCH RESEND 2/2] drivers: base: Add basic devm tests for platform devices Maxime Ripard
  0 siblings, 2 replies; 10+ messages in thread
From: Maxime Ripard @ 2023-06-02 15:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki
  Cc: Brendan Higgins, David Gow, linux-kselftest, kunit-dev,
	linux-kernel, Maxime Ripard

Hi,

This follows the discussion here:
https://lore.kernel.org/linux-kselftest/20230324123157.bbwvfq4gsxnlnfwb@houat/

This shows a couple of inconsistencies with regard to how device-managed
resources are cleaned up. Basically, devm resources will only be cleaned up
if the device is attached to a bus and bound to a driver. Failing any of
these cases, a call to device_unregister will not end up in the devm
resources being released.

We had to work around it in DRM to provide helpers to create a device for
kunit tests, but the current discussion around creating similar, generic,
helpers for kunit resumed interest in fixing this.

This can be tested using the command:
./tools/testing/kunit/kunit.py run --kunitconfig=drivers/base/test/

Let me know what you think,
Maxime

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
Maxime Ripard (2):
      drivers: base: Add basic devm tests for root devices
      drivers: base: Add basic devm tests for platform devices

 drivers/base/test/.kunitconfig           |   2 +
 drivers/base/test/Kconfig                |   4 +
 drivers/base/test/Makefile               |   3 +
 drivers/base/test/platform-device-test.c | 278 +++++++++++++++++++++++++++++++
 drivers/base/test/root-device-test.c     | 120 +++++++++++++
 5 files changed, 407 insertions(+)
---
base-commit: a6faf7ea9fcb7267d06116d4188947f26e00e57e
change-id: 20230329-kunit-devm-inconsistencies-test-5e5a7d01e60d

Best regards,
-- 
Maxime Ripard <mripard@kernel.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-06-08  8:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-02 15:20 [PATCH RESEND 0/2] drivers: base: Add tests showing devm handling inconsistencies Maxime Ripard
2023-06-02 15:20 ` [PATCH RESEND 1/2] drivers: base: Add basic devm tests for root devices Maxime Ripard
2023-06-02 18:02   ` kernel test robot
2023-06-02 21:09   ` Daniel Latypov
2023-06-03 14:43   ` Greg Kroah-Hartman
2023-06-04  8:31     ` Maxime Ripard
2023-06-07 19:14       ` Greg Kroah-Hartman
2023-06-08  7:59         ` Maxime Ripard
2023-06-02 15:20 ` [PATCH RESEND 2/2] drivers: base: Add basic devm tests for platform devices Maxime Ripard
2023-06-03 14:38   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox