Commit bab87ef4 authored by Imre Deak's avatar Imre Deak

drm/i915: Disable hotplug detection handlers during driver init/shutdown

As described in the previous two patches an unexpected connector
detection can happen during the init/shutdown sequences. Prevent these
by returning the connector's current status from the detection handlers.

Link: https://patchwork.freedesktop.org/patch/msgid/20240104083008.2715733-10-imre.deak@intel.comReviewed-by: default avatarJouni Högander <jouni.hogander@intel.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
parent cd572b3b
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "intel_ddi.h" #include "intel_ddi.h"
#include "intel_ddi_buf_trans.h" #include "intel_ddi_buf_trans.h"
#include "intel_de.h" #include "intel_de.h"
#include "intel_display_driver.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_fdi.h" #include "intel_fdi.h"
#include "intel_fdi_regs.h" #include "intel_fdi_regs.h"
...@@ -846,6 +847,9 @@ intel_crt_detect(struct drm_connector *connector, ...@@ -846,6 +847,9 @@ intel_crt_detect(struct drm_connector *connector,
if (!intel_display_device_enabled(dev_priv)) if (!intel_display_device_enabled(dev_priv))
return connector_status_disconnected; return connector_status_disconnected;
if (!intel_display_driver_check_access(dev_priv))
return connector->status;
if (dev_priv->display.params.load_detect_test) { if (dev_priv->display.params.load_detect_test) {
wakeref = intel_display_power_get(dev_priv, wakeref = intel_display_power_get(dev_priv,
intel_encoder->power_domain); intel_encoder->power_domain);
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include "intel_cx0_phy.h" #include "intel_cx0_phy.h"
#include "intel_ddi.h" #include "intel_ddi.h"
#include "intel_de.h" #include "intel_de.h"
#include "intel_display_driver.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_dp.h" #include "intel_dp.h"
#include "intel_dp_aux.h" #include "intel_dp_aux.h"
...@@ -5646,6 +5647,9 @@ intel_dp_detect(struct drm_connector *connector, ...@@ -5646,6 +5647,9 @@ intel_dp_detect(struct drm_connector *connector,
if (!intel_display_device_enabled(dev_priv)) if (!intel_display_device_enabled(dev_priv))
return connector_status_disconnected; return connector_status_disconnected;
if (!intel_display_driver_check_access(dev_priv))
return connector->status;
/* Can't disconnect eDP */ /* Can't disconnect eDP */
if (intel_dp_is_edp(intel_dp)) if (intel_dp_is_edp(intel_dp))
status = edp_detect(intel_dp); status = edp_detect(intel_dp);
...@@ -5746,6 +5750,10 @@ intel_dp_force(struct drm_connector *connector) ...@@ -5746,6 +5750,10 @@ intel_dp_force(struct drm_connector *connector)
drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s]\n", drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s]\n",
connector->base.id, connector->name); connector->base.id, connector->name);
if (!intel_display_driver_check_access(dev_priv))
return;
intel_dp_unset_edid(intel_dp); intel_dp_unset_edid(intel_dp);
if (connector->status != connector_status_connected) if (connector->status != connector_status_connected)
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "intel_crtc.h" #include "intel_crtc.h"
#include "intel_ddi.h" #include "intel_ddi.h"
#include "intel_de.h" #include "intel_de.h"
#include "intel_display_driver.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_dp.h" #include "intel_dp.h"
#include "intel_dp_hdcp.h" #include "intel_dp_hdcp.h"
...@@ -1410,6 +1411,9 @@ intel_dp_mst_detect(struct drm_connector *connector, ...@@ -1410,6 +1411,9 @@ intel_dp_mst_detect(struct drm_connector *connector,
if (drm_connector_is_unregistered(connector)) if (drm_connector_is_unregistered(connector))
return connector_status_disconnected; return connector_status_disconnected;
if (!intel_display_driver_check_access(i915))
return connector->status;
return drm_dp_mst_detect_port(connector, ctx, &intel_dp->mst_mgr, return drm_dp_mst_detect_port(connector, ctx, &intel_dp->mst_mgr,
intel_connector->port); intel_connector->port);
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "i915_reg.h" #include "i915_reg.h"
#include "intel_connector.h" #include "intel_connector.h"
#include "intel_de.h" #include "intel_de.h"
#include "intel_display_driver.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_dvo.h" #include "intel_dvo.h"
#include "intel_dvo_dev.h" #include "intel_dvo_dev.h"
...@@ -328,6 +329,9 @@ intel_dvo_detect(struct drm_connector *_connector, bool force) ...@@ -328,6 +329,9 @@ intel_dvo_detect(struct drm_connector *_connector, bool force)
if (!intel_display_device_enabled(i915)) if (!intel_display_device_enabled(i915))
return connector_status_disconnected; return connector_status_disconnected;
if (!intel_display_driver_check_access(i915))
return connector->base.status;
return intel_dvo->dev.dev_ops->detect(&intel_dvo->dev); return intel_dvo->dev.dev_ops->detect(&intel_dvo->dev);
} }
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "intel_cx0_phy.h" #include "intel_cx0_phy.h"
#include "intel_ddi.h" #include "intel_ddi.h"
#include "intel_de.h" #include "intel_de.h"
#include "intel_display_driver.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_dp.h" #include "intel_dp.h"
#include "intel_gmbus.h" #include "intel_gmbus.h"
...@@ -2505,6 +2506,9 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) ...@@ -2505,6 +2506,9 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
if (!intel_display_device_enabled(dev_priv)) if (!intel_display_device_enabled(dev_priv))
return connector_status_disconnected; return connector_status_disconnected;
if (!intel_display_driver_check_access(dev_priv))
return connector->status;
wakeref = intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); wakeref = intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
if (DISPLAY_VER(dev_priv) >= 11 && if (DISPLAY_VER(dev_priv) >= 11 &&
...@@ -2533,6 +2537,9 @@ intel_hdmi_force(struct drm_connector *connector) ...@@ -2533,6 +2537,9 @@ intel_hdmi_force(struct drm_connector *connector)
drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s]\n", drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s]\n",
connector->base.id, connector->name); connector->base.id, connector->name);
if (!intel_display_driver_check_access(i915))
return;
intel_hdmi_unset_edid(connector); intel_hdmi_unset_edid(connector);
if (connector->status != connector_status_connected) if (connector->status != connector_status_connected)
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "intel_backlight.h" #include "intel_backlight.h"
#include "intel_connector.h" #include "intel_connector.h"
#include "intel_de.h" #include "intel_de.h"
#include "intel_display_driver.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_drrs.h" #include "intel_drrs.h"
#include "intel_lvds_regs.h" #include "intel_lvds_regs.h"
...@@ -683,6 +684,9 @@ intel_panel_detect(struct drm_connector *connector, bool force) ...@@ -683,6 +684,9 @@ intel_panel_detect(struct drm_connector *connector, bool force)
if (!intel_display_device_enabled(i915)) if (!intel_display_device_enabled(i915))
return connector_status_disconnected; return connector_status_disconnected;
if (!intel_display_driver_check_access(i915))
return connector->status;
return connector_status_connected; return connector_status_connected;
} }
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "intel_connector.h" #include "intel_connector.h"
#include "intel_crtc.h" #include "intel_crtc.h"
#include "intel_de.h" #include "intel_de.h"
#include "intel_display_driver.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_fdi.h" #include "intel_fdi.h"
#include "intel_fifo_underrun.h" #include "intel_fifo_underrun.h"
...@@ -2139,6 +2140,9 @@ intel_sdvo_detect(struct drm_connector *connector, bool force) ...@@ -2139,6 +2140,9 @@ intel_sdvo_detect(struct drm_connector *connector, bool force)
if (!intel_display_device_enabled(i915)) if (!intel_display_device_enabled(i915))
return connector_status_disconnected; return connector_status_disconnected;
if (!intel_display_driver_check_access(i915))
return connector->status;
if (!intel_sdvo_set_target_output(intel_sdvo, if (!intel_sdvo_set_target_output(intel_sdvo,
intel_sdvo_connector->output_flag)) intel_sdvo_connector->output_flag))
return connector_status_unknown; return connector_status_unknown;
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "intel_crtc.h" #include "intel_crtc.h"
#include "intel_de.h" #include "intel_de.h"
#include "intel_display_irq.h" #include "intel_display_irq.h"
#include "intel_display_driver.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_dpll.h" #include "intel_dpll.h"
#include "intel_hotplug.h" #include "intel_hotplug.h"
...@@ -1723,6 +1724,9 @@ intel_tv_detect(struct drm_connector *connector, ...@@ -1723,6 +1724,9 @@ intel_tv_detect(struct drm_connector *connector,
if (!intel_display_device_enabled(i915)) if (!intel_display_device_enabled(i915))
return connector_status_disconnected; return connector_status_disconnected;
if (!intel_display_driver_check_access(i915))
return connector->status;
if (force) { if (force) {
struct drm_atomic_state *state; struct drm_atomic_state *state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment