Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] drm/vkms: missing rcu_barrier() on module exit after call_rcu() in destroy - [Low] drm/vkms: missing @name_len in vkms_config_plane_set_name() kernel-doc - [Low] drm/vkms: duplicate include of vkms_config.h in vkms_plane.c --
commit f9614f6973483389b18d752f2c6d793287063437 Author: Louis Chauvet <[email protected]> drm/vkms: Introduce config for plane name This commit adds plane name configuration support to vkms_config_plane and passes the configured name to drmm_universal_plane_alloc() during plane initialization. > diff --git a/drivers/gpu/drm/vkms/vkms_config.c > b/drivers/gpu/drm/vkms/vkms_config.c > index e2b6567238987..56ab9ea6e1410 100644 > --- a/drivers/gpu/drm/vkms/vkms_config.c > +++ b/drivers/gpu/drm/vkms/vkms_config.c [ ... ] > @@ -436,25 +439,57 @@ struct vkms_config_plane __must_check > *vkms_config_create_plane(struct vkms_conf [ ... ] > +static void vkms_config_plane_rcu_free(struct rcu_head *head) > +{ > + struct vkms_config_plane *plane_cfg = > + container_of(head, struct vkms_config_plane, rcu); > + > + kfree(plane_cfg->name); > + kfree(plane_cfg); > +} > + > void vkms_config_destroy_plane(struct vkms_config_plane *plane_cfg) > { > xa_destroy(&plane_cfg->possible_crtcs); > list_del_rcu(&plane_cfg->link); > - kfree_rcu(plane_cfg, rcu); > + call_rcu(&plane_cfg->rcu, vkms_config_plane_rcu_free); > } > EXPORT_SYMBOL_IF_KUNIT(vkms_config_destroy_plane); [Severity: Medium] Can vkms_config_plane_rcu_free() run after the vkms module is unloaded? Replacing kfree_rcu() with call_rcu() queues a callback located in the vkms module text. When the module is unloaded, vkms_exit() drops the last reference to default_config: drivers/gpu/drm/vkms/vkms_drv.c:vkms_exit() { ... vkms_destroy(default_config); vkms_config_put(default_config); } vkms_config_put() -> vkms_config_release() -> vkms_config_destroy_plane() queues vkms_config_plane_rcu_free() right before vkms_exit() returns, without an rcu_barrier() to wait for pending callbacks before module text is unmapped. > diff --git a/drivers/gpu/drm/vkms/vkms_config.h > b/drivers/gpu/drm/vkms/vkms_config.h > index 8f038562afd4d..e428946cb70ea 100644 > --- a/drivers/gpu/drm/vkms/vkms_config.h > +++ b/drivers/gpu/drm/vkms/vkms_config.h [ ... ] > @@ -368,6 +370,26 @@ vkms_config_plane_set_default_pipeline(struct > vkms_config_plane *plane_cfg, > plane_cfg->default_pipeline = default_pipeline; > } > > +/** > + * vkms_config_plane_set_name() - Set the plane name > + * @plane_cfg: Plane to set the name to > + * @name: New plane name. The name is copied. > + * > + * Returns: -ENOMEM if the memory allocation failed, 0 in case of success > + */ > +int __must_check vkms_config_plane_set_name(struct vkms_config_plane > *plane_cfg, > + const char *name, size_t name_len); [Severity: Low] The kernel-doc comment for vkms_config_plane_set_name() is missing an entry for @name_len. > diff --git a/drivers/gpu/drm/vkms/vkms_plane.c > b/drivers/gpu/drm/vkms/vkms_plane.c > index fd3d34dcf0fe5..35aabec85b332 100644 > --- a/drivers/gpu/drm/vkms/vkms_plane.c > +++ b/drivers/gpu/drm/vkms/vkms_plane.c > @@ -12,6 +12,7 @@ > #include <drm/drm_gem_framebuffer_helper.h> > #include <drm/drm_print.h> > > +#include "vkms_config.h" > #include "vkms_drv.h" > #include "vkms_formats.h" [Severity: Low] This isn't a bug, but vkms_plane.c already includes "vkms_config.h" at the top of the file. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=17
