Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1777996imm; Thu, 27 Sep 2018 02:18:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV62l5QU24zWEeCnoKuEAMCFlYjXJlwTooBCdlNyqHaf0nsF8okiW9FvJGX2PJCD1Y/6+60U6 X-Received: by 2002:a63:c44a:: with SMTP id m10-v6mr9397344pgg.416.1538039901479; Thu, 27 Sep 2018 02:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039901; cv=none; d=google.com; s=arc-20160816; b=YvxFaQEB+iMhWVvIelUNOCHrWjYjZ6sVxAFO2n/SEib3uLszZrRnheHUYAJXLH8OyL FM7H/lOEoldYovMEOqBjn+wi614NGkCRhUlIdWoZ+BMuUp0od5S+jwthqqAHkMte6+Mf bUr2lONWRMIp4h1z0Mzi41nKrBECRTsvSFbQMUI7X2/40pHSbnUzGNTrUOlWta+8nGo+ Q2oTOonsdbERYznsVU4+8Lt3s1+PZjYh/J8A8WB+F16wqx4jlZtb3JoxetkPBm9AKRrl puX/4rNJYTli2HNgj9PORGqRrTzMOc+WR055sORVh9noXtlfH8jCTgM0nH0MLFHcFek+ zsUw== 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=D7mM0pYNR00BXnXXUS9UkttzaFRbbe/kjuICcq4ZXsc=; b=n6iNVuHcwXLxp/YPFpQcAqddg95E9Shnnot7eEFbkfA++z/l0Nh5BOfDUjdo0Tn52P wrHR1WW+J6IXMiazmpHc8Xv/CAulShsNv2SFi5QNLjD1MBpYryF510Sl6Vq4u77E6BG4 H1XAahvbDkkvKfCD9bsMN5nnUIJtm9kdthOfccRCrVGFUEX4sOzcO7iQg0LxC6ByTUQq /SxcFN/6fjhnrStjT0y3vKZhBupzwB55LMdYkrVam3CycaGHPf5ULs9CsVjOxvmoNHVP xE0clZosS0w4whQmqOgLodLqACD4J/kE7YsMmw/NvYf2Ps999Qymb24Ll10q7Y9xT1CM 7SKg== 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 j20-v6si1477697pgl.279.2018.09.27.02.18.06; Thu, 27 Sep 2018 02:18:21 -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 S1728751AbeI0PdS (ORCPT + 99 others); Thu, 27 Sep 2018 11:33:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55728 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727589AbeI0PdQ (ORCPT ); Thu, 27 Sep 2018 11:33:16 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E0A781120; Thu, 27 Sep 2018 09:15:58 +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.18 67/88] drm/nouveau/drm/nouveau: Fix bogus drm_kms_helper_poll_enable() placement Date: Thu, 27 Sep 2018 11:03:48 +0200 Message-Id: <20180927090308.841540319@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090300.631426620@linuxfoundation.org> References: <20180927090300.631426620@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.18-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 @@ -355,8 +355,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); @@ -411,6 +409,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) {