Skip to contentSkip to conversation

drm/bridge/lontium-lt9611uxc: fix provided connector suport

PATCH Applied Dmitry Baryshkov 2 participants 3 messages Jul 8, 2021 – Oct 6, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge/lontium-lt9611uxc: fix provided connector suport

- set DRM_CONNECTOR_POLL_HPD as the connector will generate hotplug events on its own

- do not call drm_kms_helper_hotplug_event() unless mode_config.funcs pointer is not NULL to remove possible kernel oops.

Fixes bc6fa8676ebb ("drm/bridge/lontium-lt9611uxc: move HPD notification out of IRQ handler")
---
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +6 -3
index 3cac16db970f..010657ea7af7 100644
@@ -167,9 +167,10 @@ static void lt9611uxc_hpd_work(struct work_struct *work)
 	struct lt9611uxc *lt9611uxc = container_of(work, struct lt9611uxc, work);
 	bool connected;
 
-	if (lt9611uxc->connector.dev)
-		drm_kms_helper_hotplug_event(lt9611uxc->connector.dev);
-	else {
+	if (lt9611uxc->connector.dev) {
+		if (lt9611uxc->connector.dev->mode_config.funcs)
+			drm_kms_helper_hotplug_event(lt9611uxc->connector.dev);
+	} else {
 
 		mutex_lock(&lt9611uxc->ocm_lock);
 		connected = lt9611uxc->hdmi_connected;
@@ -339,6 +340,8 @@ static int lt9611uxc_connector_init(struct drm_bridge *bridge, struct lt9611uxc
 		return -ENODEV;
 	}
 
+	lt9611uxc->connector.polled = DRM_CONNECTOR_POLL_HPD;
+
 	drm_connector_helper_add(&lt9611uxc->connector,
 				 &lt9611uxc_bridge_connector_helper_funcs);
 	ret = drm_connector_init(bridge->dev, &lt9611uxc->connector,
Signature · 1 line
2.30.2
#1 lore raw
Quoted 9 lines · Dmitry Baryshkov

- set DRM_CONNECTOR_POLL_HPD as the connector will generate hotplug events on its own

- do not call drm_kms_helper_hotplug_event() unless mode_config.funcs pointer is not NULL to remove possible kernel oops.

Fixes bc6fa8676ebb ("drm/bridge/lontium-lt9611uxc: move HPD notification out of IRQ handler")

---

Gracious ping for review. It would be really nice to get this patch into 5.16

Quoted 31 lines
  drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +6 -3
index 3cac16db970f..010657ea7af7 100644
@@ -167,9 +167,10 @@ static void lt9611uxc_hpd_work(struct work_struct *work)
  	struct lt9611uxc *lt9611uxc = container_of(work, struct lt9611uxc, work);
  	bool connected;
 
-	if (lt9611uxc->connector.dev)
-		drm_kms_helper_hotplug_event(lt9611uxc->connector.dev);
-	else {
+	if (lt9611uxc->connector.dev) {
+		if (lt9611uxc->connector.dev->mode_config.funcs)
+			drm_kms_helper_hotplug_event(lt9611uxc->connector.dev);
+	} else {
 
  		mutex_lock(&lt9611uxc->ocm_lock);
  		connected = lt9611uxc->hdmi_connected;
@@ -339,6 +340,8 @@ static int lt9611uxc_connector_init(struct drm_bridge *bridge, struct lt9611uxc
  		return -ENODEV;
  	}
 
+	lt9611uxc->connector.polled = DRM_CONNECTOR_POLL_HPD;
+
  	drm_connector_helper_add(&lt9611uxc->connector,
  				 &lt9611uxc_bridge_connector_helper_funcs);
  	ret = drm_connector_init(bridge->dev, &lt9611uxc->connector,
Signature · 2 lines
With best wishes
Dmitry
Applied
#2 lore raw
In reply to Dmitry Baryshkov

Applied to drm-misc-next

Quoted 43 lines · Dmitry Baryshkov

- set DRM_CONNECTOR_POLL_HPD as the connector will generate hotplug events on its own

- do not call drm_kms_helper_hotplug_event() unless mode_config.funcs pointer is not NULL to remove possible kernel oops.

Fixes bc6fa8676ebb ("drm/bridge/lontium-lt9611uxc: move HPD notification out of IRQ handler")
---
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +6 -4
index 3cac16db970f..010657ea7af7 100644
@@ -167,9 +167,10 @@ static void lt9611uxc_hpd_work(struct work_struct *work)
        struct lt9611uxc *lt9611uxc = container_of(work, struct lt9611uxc, work);
        bool connected;
 
-       if (lt9611uxc->connector.dev)
-               drm_kms_helper_hotplug_event(lt9611uxc->connector.dev);
-       else {
+       if (lt9611uxc->connector.dev) {
+               if (lt9611uxc->connector.dev->mode_config.funcs)
+                       drm_kms_helper_hotplug_event(lt9611uxc->connector.dev);
+       } else {
 
                mutex_lock(&lt9611uxc->ocm_lock);
                connected = lt9611uxc->hdmi_connected;
@@ -339,6 +340,8 @@ static int lt9611uxc_connector_init(struct drm_bridge *bridge, struct lt9611uxc
                return -ENODEV;
        }
 
+       lt9611uxc->connector.polled = DRM_CONNECTOR_POLL_HPD;
+
        drm_connector_helper_add(&lt9611uxc->connector,
                                 &lt9611uxc_bridge_connector_helper_funcs);
        ret = drm_connector_init(bridge->dev, &lt9611uxc->connector,
--

2.30.2