From patchwork Fri Sep 1 14:04:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13372648 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BBC48CA0FE8 for ; Fri, 1 Sep 2023 14:03:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0608910E7D9; Fri, 1 Sep 2023 14:03:52 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id A59D210E7D9 for ; Fri, 1 Sep 2023 14:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693577030; x=1725113030; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bNiEa0jL19K8lIItY6lSay6eWCAU+ZIE8PmKYRxuxwU=; b=hT493RhnZ7ykmVU+7pfNFzKe6oA/Bpp/jdNr+fAhB9ZMv9CnPdLeevzL pWIEM+ZJCp2YUE9wPoFkYatiY+0Yei/8hcNfMoXLXdWUq5PrZnN1XpC0U ZqmAXurv49b0LNbfoRH3cIrPVMoF1tWzwlSO1go3Tblc4VOtt5nZEbcYJ kHTbsUaCZm0LnOmf8vZpd1/BGnl+WO+YT/zyGOLCJ4HzxlDyAs5MMqKjS E/Tw3tmqoEsBtKjxVFK+c1yBVmMIeaqEOoXwOs1vMswaLCVk/XGuK4cg1 h46dc9GOvuKDTeSBM6ylVChAXH1pgo6O22dwQ34hoyj44aFMMaWMGO8Aa w==; X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="375126740" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="375126740" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 07:03:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="854714922" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="854714922" Received: from ideak-desk.fi.intel.com ([10.237.72.78]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 07:03:46 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Date: Fri, 1 Sep 2023 17:04:02 +0300 Message-Id: <20230901140403.2821777-1-imre.deak@intel.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/2] drm/i915: Schedule the HPD poll init work on an unbound workqueue X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tejun Heo , stable@vger.kernel.org, Heiner Kallweit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Disabling HPD polling from i915_hpd_poll_init_work() involves probing all display connectors explicitly to account for lost hotplug interrupts. On some platforms (mostly pre-ICL) with HDMI connectors the I2C EDID bit-banging using udelay() triggers in turn the workqueue: i915_hpd_poll_init_work [i915] hogged CPU for >10000us 4 times, consider switching to WQ_UNBOUND warning. Fix the above by scheduling i915_hpd_poll_init_work() on a WQ_UNBOUND workqueue. It's ok to use a system WQ, since i915_hpd_poll_init_work() is properly flushed in intel_hpd_cancel_work(). The connector probing from drm_mode_config::output_poll_work resulting in the same warning is fixed by the next patch. Cc: Tejun Heo Cc: Heiner Kallweit CC: stable@vger.kernel.org # 6.5 Suggested-by: Tejun Heo Suggested-by: Heiner Kallweit Reported-by: Heiner Kallweit Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9245 Link: https://lore.kernel.org/all/f7e21caa-e98d-e5b5-932a-fe12d27fde9b@gmail.com Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_hotplug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c index e8562f6f8bb44..accc2fec562a0 100644 --- a/drivers/gpu/drm/i915/display/intel_hotplug.c +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c @@ -774,7 +774,7 @@ void intel_hpd_poll_enable(struct drm_i915_private *dev_priv) * As well, there's no issue if we race here since we always reschedule * this worker anyway */ - queue_work(dev_priv->unordered_wq, + queue_work(system_unbound_wq, &dev_priv->display.hotplug.poll_init_work); } @@ -803,7 +803,7 @@ void intel_hpd_poll_disable(struct drm_i915_private *dev_priv) return; WRITE_ONCE(dev_priv->display.hotplug.poll_enabled, false); - queue_work(dev_priv->unordered_wq, + queue_work(system_unbound_wq, &dev_priv->display.hotplug.poll_init_work); } From patchwork Fri Sep 1 14:04:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13372649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6738BCA0FE1 for ; Fri, 1 Sep 2023 14:04:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA35510E7E0; Fri, 1 Sep 2023 14:03:53 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id C5BD810E7DF; Fri, 1 Sep 2023 14:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693577030; x=1725113030; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zXfCtoMrzbDTA4n+1nOcRqiErSkQmB5TanHacVFv9Go=; b=WVF44kXrF/33Oxoy+bTq+e6Wz5Mv0urUPaVPepN2OQRtxgu26EHzRNOX FgBo8qtg1mpmOGAvWbD0svIWg89Uunp7xeiJfYAVlX3rg+XSGw33mWjrI jwFgasRCS8imLRf2bk0dhyU4wZ6uiHVWCN8XMFOF6zjZN4vclAH/uM37P AHUtJ629JZz4osGl7svsjozei/5dCGiqG4AlowdbsWV+wKvh/uY87W4O+ x8gJgt0CjPB0H8cJdGS0xgQPwBqTu0yYWmdnUg8Op9iLFKTrVEtCsBTtA wD2ompa4PRuow/DnwFkkW5H9B8c5TKQjUr0/uxDey1JFURdchWaZAAyEC A==; X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="375126750" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="375126750" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 07:03:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="854714924" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="854714924" Received: from ideak-desk.fi.intel.com ([10.237.72.78]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 07:03:47 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Date: Fri, 1 Sep 2023 17:04:03 +0300 Message-Id: <20230901140403.2821777-2-imre.deak@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230901140403.2821777-1-imre.deak@intel.com> References: <20230901140403.2821777-1-imre.deak@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/2] drm: Schedule the HPD poll work on the system unbound workqueue X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tejun Heo , dri-devel@lists.freedesktop.org, stable@vger.kernel.org, Heiner Kallweit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On some i915 platforms at least the HPD poll work involves I2C bit-banging using udelay()s to probe for monitor EDIDs. This in turn may trigger the workqueue: output_poll_execute [drm_kms_helper] hogged CPU for >10000us 4 times, consider switching to WQ_UNBOUND warning. Fix this by scheduling drm_mode_config::output_poll_work on a WQ_UNBOUND workqueue. Cc: Tejun Heo Cc: Heiner Kallweit CC: stable@vger.kernel.org # 6.5 Cc: dri-devel@lists.freedesktop.org Suggested-by: Tejun Heo Suggested-by: Heiner Kallweit Reported-by: Heiner Kallweit Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9245 Link: https://lore.kernel.org/all/f7e21caa-e98d-e5b5-932a-fe12d27fde9b@gmail.com Signed-off-by: Imre Deak --- drivers/gpu/drm/drm_probe_helper.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 3f479483d7d80..72eac0cd25e74 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -279,7 +279,8 @@ static void reschedule_output_poll_work(struct drm_device *dev) */ delay = HZ; - schedule_delayed_work(&dev->mode_config.output_poll_work, delay); + queue_delayed_work(system_unbound_wq, + &dev->mode_config.output_poll_work, delay); } /** @@ -614,7 +615,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, */ dev->mode_config.delayed_event = true; if (dev->mode_config.poll_enabled) - mod_delayed_work(system_wq, + mod_delayed_work(system_unbound_wq, &dev->mode_config.output_poll_work, 0); } @@ -838,7 +839,8 @@ static void output_poll_execute(struct work_struct *work) drm_kms_helper_hotplug_event(dev); if (repoll) - schedule_delayed_work(delayed_work, DRM_OUTPUT_POLL_PERIOD); + queue_delayed_work(system_unbound_wq, + delayed_work, DRM_OUTPUT_POLL_PERIOD); } /**