diff mbox series

[3/3] drm/todo: Add TODO entry for "lints"

Message ID 20240612143553.915966-3-mripard@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/todo: Create a TODO item for additional HDMI work | expand

Commit Message

Maxime Ripard June 12, 2024, 2:35 p.m. UTC
Having lints would prove beneficial to prevent the same dark patterns
from reoccuring over and over again in drivers.

Add a TODO entry for that.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 Documentation/gpu/todo.rst | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Comments

Dmitry Baryshkov June 12, 2024, 6:49 p.m. UTC | #1
On Wed, Jun 12, 2024 at 04:35:53PM +0200, Maxime Ripard wrote:
> Having lints would prove beneficial to prevent the same dark patterns
> from reoccuring over and over again in drivers.
> 
> Add a TODO entry for that.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  Documentation/gpu/todo.rst | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 94139c652663..16a9a24b33a6 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -717,10 +717,38 @@ doesn't or document it if it does would be of great help.
>  
>  Contact: Maxime Ripard <mripard@kernel.org>
>  
>  Level: Intermediate
>  
> +Create lints for KMS drivers
> +----------------------------
> +
> +Over time, we've accumulated a list of dark patterns in KMS drivers that
> +should be avoided. However, none of them are published anywhere, and not
> +all reviewers are aware of them. It creates a situation where we have
> +more drivers with problematic / deprecated code, even though we know
> +that they shouldn't.
> +
> +We should create a set of coccinelle scripts that match these patterns,
> +and make new drivers run that list. And possibly integrate them in CI.
> +
> +These patterns include:
> +
> +  - Drivers using kzalloc() or devm_kzalloc() to allocate their memory,
> +    instead of drmm_kzalloc().
> +
> +  - Drivers not protecting their device resources (MMIO, clocks,
> +    regulators, etc.) by drm_dev_enter() and drm_dev_exit().
> +
> +  - Drivers using drm_dev_unregister() instead of drm_dev_unplug().
> +
> +  - Drivers not calling drm_atomic_helper_shutdown() at shutdown

- Drivers setting state->allow_modeset manually.

> +
> +Contact: Maxime Ripard <mripard@kernel.org>
> +
> +Level: Intermediate
> +
>  Enable trinity for DRM
>  ----------------------
>  
>  And fix up the fallout. Should be really interesting ...
>  
> -- 
> 2.45.2
>
diff mbox series

Patch

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 94139c652663..16a9a24b33a6 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -717,10 +717,38 @@  doesn't or document it if it does would be of great help.
 
 Contact: Maxime Ripard <mripard@kernel.org>
 
 Level: Intermediate
 
+Create lints for KMS drivers
+----------------------------
+
+Over time, we've accumulated a list of dark patterns in KMS drivers that
+should be avoided. However, none of them are published anywhere, and not
+all reviewers are aware of them. It creates a situation where we have
+more drivers with problematic / deprecated code, even though we know
+that they shouldn't.
+
+We should create a set of coccinelle scripts that match these patterns,
+and make new drivers run that list. And possibly integrate them in CI.
+
+These patterns include:
+
+  - Drivers using kzalloc() or devm_kzalloc() to allocate their memory,
+    instead of drmm_kzalloc().
+
+  - Drivers not protecting their device resources (MMIO, clocks,
+    regulators, etc.) by drm_dev_enter() and drm_dev_exit().
+
+  - Drivers using drm_dev_unregister() instead of drm_dev_unplug().
+
+  - Drivers not calling drm_atomic_helper_shutdown() at shutdown
+
+Contact: Maxime Ripard <mripard@kernel.org>
+
+Level: Intermediate
+
 Enable trinity for DRM
 ----------------------
 
 And fix up the fallout. Should be really interesting ...