Bug#1110563: Warning cause and a potential fix

dqs105 dqs105 at dqsmcsrv.com
Mon May 4 13:32:36 BST 2026


The warning seems to come from nvidia-drm/nvidia-drm-helper.h:165:

...
#define nv_drm_for_each_connector(connector, conn_iter, dev) \
 >> WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));   \ <<
     list_for_each_entry(connector, &(dev)->mode_config.connector_list, 
head)
#endif
...

and is a result of wrongly determined "NV_DRM_CONNECTOR_LIST_ITER_PRESENT"
macro.

The following patch may fix the warnings:

--- a/conftest.sh
+++ b/conftest.sh
@@ -4281,8 +4281,14 @@
              #
              CODE="
              #include <drm/drm_connector.h>
-            int conftest_drm_connector_list_iter(void) {
+            void conftest_drm_connector_list_iter(struct drm_device *dev) {
                  struct drm_connector_list_iter conn_iter;
+                struct drm_connector *connector;
+                drm_connector_list_iter_begin(dev, &conn_iter);
+                drm_for_each_connector_iter(connector, &conn_iter) {
+                    (void)connector;
+                }
+                drm_connector_list_iter_end(&conn_iter);
              }"

              compile_check_conftest "$CODE" 
"NV_DRM_CONNECTOR_LIST_ITER_PRESENT" "" "types"

The original test code fails because the compiler treated "function declared
int but have no return value" as an error.

I don't think the patch will introduce issues, as 
"drm_for_each_connector_iter"
seems the standard way of iterating through connectors since kernel version
4.9.0-rc8.



More information about the pkg-nvidia-devel mailing list