|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4 |
|
| #
86a5f32e |
| 16-Dec-2024 |
Brian Norris <[email protected]> |
drivers: base: test: Add ...find_device_by...(... NULL) tests
We recently updated these device_match*() (and therefore, various *find_device_by*()) functions to return a consistent 'false' value whe
drivers: base: test: Add ...find_device_by...(... NULL) tests
We recently updated these device_match*() (and therefore, various *find_device_by*()) functions to return a consistent 'false' value when trying to match a NULL handle. Add tests for this.
This provides regression-testing coverage for the sorts of bugs that underly commit 5c8418cf4025 ("PCI/pwrctrl: Unregister platform device only if one actually exists").
Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: Brian Norris <[email protected]> Acked-by: Shuah Khan <[email protected]> Reviewed-by: David Gow <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6, v6.7-rc5, v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1, v6.5, v6.5-rc7 |
|
| #
f71b144e |
| 16-Aug-2023 |
Maxime Ripard <[email protected]> |
drivers: base: test: Add missing MODULE_* macros for platform devices tests
Commit b4cc44301b9d ("drivers: base: Add basic devm tests for platform devices") introduced a new set of tests for platfor
drivers: base: test: Add missing MODULE_* macros for platform devices tests
Commit b4cc44301b9d ("drivers: base: Add basic devm tests for platform devices") introduced a new set of tests for platform devices that could be compiled as a module, but didn't have the usual module macros.
Make sure they're there.
Fixes: b4cc44301b9d ("drivers: base: Add basic devm tests for platform devices") Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3 |
|
| #
699fb50d |
| 20-Jul-2023 |
David Gow <[email protected]> |
drivers: base: Free devm resources when unregistering a device
In the current code, devres_release_all() only gets called if the device has a bus and has been probed.
This leads to issues when usin
drivers: base: Free devm resources when unregistering a device
In the current code, devres_release_all() only gets called if the device has a bus and has been probed.
This leads to issues when using bus-less or driver-less devices where the device might never get freed if a managed resource holds a reference to the device. This is happening in the DRM framework for example.
We should thus call devres_release_all() in the device_del() function to make sure that the device-managed actions are properly executed when the device is unregistered, even if it has neither a bus nor a driver.
This is effectively the same change than commit 2f8d16a996da ("devres: release resources on device_del()") that got reverted by commit a525a3ddeaca ("driver core: free devres in device_release") over memory leaks concerns.
This patch effectively combines the two commits mentioned above to release the resources both on device_del() and device_release() and get the best of both worlds.
Fixes: a525a3ddeaca ("driver core: free devres in device_release") Signed-off-by: David Gow <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/20230720-kunit-devm-inconsistencies-test-v3-3-6aa7e074f373@kernel.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| #
b4cc4430 |
| 20-Jul-2023 |
Maxime Ripard <[email protected]> |
drivers: base: Add basic devm tests for platform devices
Platform devices show some inconsistencies with how devm resources are released when the device has been probed and when it hasn't.
In parti
drivers: base: Add basic devm tests for platform devices
Platform devices show some inconsistencies with how devm resources are released when the device has been probed and when it hasn't.
In particular, we can register device-managed actions no matter if the device has be bound to a driver or not, but devres_release_all() will only be called if it was bound to a driver or if there's no reference held to it anymore.
If it wasn't bound to a driver and we still have a reference, devres_release_all() will never get called. This is surprising considering that if the driver isn't bound but doesn't have any reference to it anymore, that function will get called, and if it was bound to a driver but still has references, that function will get called as well.
Even if that case is fairly unusual, it can easily lead to memory leaks.
The plan is, with the next patch, to make it consistent and enforce that devres_release_all() is called no matter what situation we're in. For now, it just tests for the current behaviour and skips over the inconsistencies.
Reviewed-by: David Gow <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/20230720-kunit-devm-inconsistencies-test-v3-2-6aa7e074f373@kernel.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|