Revert "drm: kms_helper: don't lose hotplug event"
authorDave Airlie <airlied@redhat.com>
Fri, 28 Jun 2013 10:31:34 +0000 (20:31 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 28 Jun 2013 10:31:34 +0000 (20:31 +1000)
This reverts commit 160954b7bca43da7cd3cfbce310e6df919a8216e.

This was rearming the workqueue with a 0 timeout, causing
a WARN_ON, and possible loop.

Daniel writes:
"I've looked a bit into this and I think we need to have a separate
work struct for recovering these lost hotplug events since the
continuous self-rearming case is a real risk (e.g. if a connector
flip-flops all the time). At least I don't see a sane way to block out
re-arming with the current code in a simple way. So reverting the
offender seems like the right thing and I'll go back to the drawing
board for 3.12."

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_crtc_helper.c
include/drm/drm_crtc.h

index f6829ba58e868d9ddf4b8587c93d2c2e3d98f763..738a4294d820e164d7534f830dd4eed7c880aa4d 100644 (file)
@@ -122,7 +122,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
        int count = 0;
        int mode_flags = 0;
        bool verbose_prune = true;
-       enum drm_connector_status old_status;
 
        DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
                        drm_get_connector_name(connector));
@@ -138,32 +137,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
                if (connector->funcs->force)
                        connector->funcs->force(connector);
        } else {
-               old_status = connector->status;
-
                connector->status = connector->funcs->detect(connector, true);
-
-               /*
-                * Normally either the driver's hpd code or the poll loop should
-                * pick up any changes and fire the hotplug event. But if
-                * userspace sneaks in a probe, we might miss a change. Hence
-                * check here, and if anything changed start the hotplug code.
-                */
-               if (old_status != connector->status) {
-                       DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n",
-                                     connector->base.id,
-                                     drm_get_connector_name(connector),
-                                     old_status, connector->status);
-
-                       /*
-                        * The hotplug event code might call into the fb
-                        * helpers, and so expects that we do not hold any
-                        * locks. Fire up the poll struct instead, it will
-                        * disable itself again.
-                        */
-                       dev->mode_config.delayed_event = true;
-                       schedule_delayed_work(&dev->mode_config.output_poll_work,
-                                             0);
-               }
        }
 
        /* Re-enable polling in case the global poll config changed. */
@@ -1011,11 +985,7 @@ static void output_poll_execute(struct work_struct *work)
        struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work);
        struct drm_connector *connector;
        enum drm_connector_status old_status;
-       bool repoll = false, changed;
-
-       /* Pick up any changes detected by the probe functions. */
-       changed = dev->mode_config.delayed_event;
-       dev->mode_config.delayed_event = false;
+       bool repoll = false, changed = false;
 
        if (!drm_kms_helper_poll)
                return;
index 663c3ab47752151aac0456b77097262690b27749..fa12a2fa4293a399c42bb1aadc9e359a8e4f71be 100644 (file)
@@ -811,7 +811,6 @@ struct drm_mode_config {
        /* output poll support */
        bool poll_enabled;
        bool poll_running;
-       bool delayed_event;
        struct delayed_work output_poll_work;
 
        /* pointers to standard properties */