Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1780594imm; Thu, 27 Sep 2018 02:21:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV63aXybW39mIuJA2CBMqhQY+IUrtKpUy3SwHaGCSVWs3kfDwY/sQ4KQ+1Uq+fclB/gbWIpdM X-Received: by 2002:a17:902:7689:: with SMTP id m9-v6mr9858557pll.295.1538040075111; Thu, 27 Sep 2018 02:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538040075; cv=none; d=google.com; s=arc-20160816; b=eGdwsj0PR66sN9CFoEEWMOzcrliLnMXwsI7N/MQDWTZ1gq7nHA0z8EkSDgCYP4bAWs O2bw8bj20g+L72e+3/Sdgr2SZ9zogYGRmzXoBngl3yexhprXggf8JA40j+feDSP69EE3 w17LeV7zfoD/oxZDSVyCnqwTK/AJQ/Gi3LTUvVrAjhHTp0m/xYgtBg4cDirRpv/TeR19 F1Lm+7DftBXgF35RmhsbslOn5vlg695fV5Ox0o5wieHHTLrfnDw8NcGyxwFhi0VH65q1 zHxa2QGPOcpJM00hd4s9kgVyryPXQYE+2zkg/cGaZIZTs2lYp4kVDLTl6vdOQp3lK4Bq bygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=03dY/KPhveVlipSQ2lFMSbdeKEGwOMYA+n4gLSpvDwY=; b=WwUV7CQlgE/sqL8sAw1EQpwqPXgZAiXiCdl4uxuE68wiMYTuYo3vtB7D2KXUxGnod/ CiCQxMOPJQWGoAsllr+J63Musqze+HSskrmVTI86F6QFrITX7k7onxEZaGPXjnD4fARn Qv98H1lUOVlspZysLycvNv7z6c96yQUOHPskAblkFrGIZQDeJgCgRTUffwXQeFOs2952 IndX2RikOF9mi/SxoOuHYF8Iyq/7T6sJ239OGsNdTspzJM9WzXwErKHxi01mtKZGoGzp ASWTa1InRwS6sM69RpG5dpG4ILKKLzx+eby2/fi/YOxjGEIvQjPQYdZs8QWuwMc1vAGb QXkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12-v6si1443916plk.196.2018.09.27.02.20.59; Thu, 27 Sep 2018 02:21:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728957AbeI0Phj (ORCPT + 99 others); Thu, 27 Sep 2018 11:37:39 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56304 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727362AbeI0Phj (ORCPT ); Thu, 27 Sep 2018 11:37:39 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E10C6111C; Thu, 27 Sep 2018 09:20:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lyude Paul , Karol Herbst , Daniel Vetter , Lukas Wunner , Peter Ujfalusi , Ben Skeggs Subject: [PATCH 4.14 43/64] drm/nouveau/drm/nouveau: Fix bogus drm_kms_helper_poll_enable() placement Date: Thu, 27 Sep 2018 11:04:00 +0200 Message-Id: <20180927090256.075490040@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090249.801943776@linuxfoundation.org> References: <20180927090249.801943776@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lyude Paul commit d77ef138ff572409ab93d492e5e6c826ee6fb21d upstream. Turns out this part is my fault for not noticing when reviewing 9a2eba337cace ("drm/nouveau: Fix drm poll_helper handling"). Currently we call drm_kms_helper_poll_enable() from nouveau_display_hpd_work(). This makes basically no sense however, because that means we're calling drm_kms_helper_poll_enable() every time we schedule the hotplug detection work. This is also against the advice mentioned in drm_kms_helper_poll_enable()'s documentation: Note that calls to enable and disable polling must be strictly ordered, which is automatically the case when they're only call from suspend/resume callbacks. Of course, hotplugs can't really be ordered. They could even happen immediately after we called drm_kms_helper_poll_disable() in nouveau_display_fini(), which can lead to all sorts of issues. Additionally; enabling polling /after/ we call drm_helper_hpd_irq_event() could also mean that we'd miss a hotplug event anyway, since drm_helper_hpd_irq_event() wouldn't bother trying to probe connectors so long as polling is disabled. So; simply move this back into nouveau_display_init() again. The race condition that both of these patches attempted to work around has already been fixed properly in d61a5c106351 ("drm/nouveau: Fix deadlock on runtime suspend") Fixes: 9a2eba337cace ("drm/nouveau: Fix drm poll_helper handling") Signed-off-by: Lyude Paul Acked-by: Karol Herbst Acked-by: Daniel Vetter Cc: Lukas Wunner Cc: Peter Ujfalusi Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -356,8 +356,6 @@ nouveau_display_hpd_work(struct work_str pm_runtime_get_sync(drm->dev->dev); drm_helper_hpd_irq_event(drm->dev); - /* enable polling for external displays */ - drm_kms_helper_poll_enable(drm->dev); pm_runtime_mark_last_busy(drm->dev->dev); pm_runtime_put_sync(drm->dev->dev); @@ -412,6 +410,11 @@ nouveau_display_init(struct drm_device * if (ret) return ret; + /* enable connector detection and polling for connectors without HPD + * support + */ + drm_kms_helper_poll_enable(dev); + /* enable hotplug interrupts */ drm_connector_list_iter_begin(dev, &conn_iter); nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) {