Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1776777imm; Thu, 27 Sep 2018 02:16:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV62hjcdYlZ1FiN028FBXlHqAcJ1zHcYVhpSnPd6+uC1GKDDVkoQPHzanegfYBuonC59Hsjqy X-Received: by 2002:a17:902:7d83:: with SMTP id a3-v6mr10091691plm.0.1538039817065; Thu, 27 Sep 2018 02:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039817; cv=none; d=google.com; s=arc-20160816; b=QdpRsVUzFoBjceui+v4qKqAUO5Ui7MM5Ut7ynndX4CgjYwVkrr6SxVGdSGrvszQr8Q LMbMieTLtPo8GS8EX2ik4vDTX/vZ8TeMAM4SU6k0VFf9K9krmoDpDpkGL4alBk4qvgbD I4Vaa7dG/k6wUnMlLkqSuInOUxgI7FzXM+UkGtqlcJZ2QMch/FlswG+YEZxJEl823uEL 4kO9f72HWmZz0dNJdqgXVC+K3AFPZBSR5jLPhiPNIbOMiPH8Qx1kycnWXebU93TUGfku /3ck/lMQgd9m8KIUQWaVOzX79R/tXqZnyc/JyzqEnh4L+xbsJ7gUgiWGKjy/vdDiTTYV ofbg== 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=E33T3yI0XLPkbaTm+51nvzTEw00TmxEyLvpXlInwoW8=; b=hts76YVvqchZQ42Hy7Er7HFhnWPVbSVe6Z0QpuAA1OGlDMwO2ZOMlh3+vUx2M3TNdL D2ZOw0Z4BRUcR8VDQahqCrLRt4wDn3kWoch/bX2pvJ4lsWyH/XwpulryuSDJiJvpRwqE kv+zbuQmKlCwxbZ0eoBVOujIF7OYrCr6SYVv/L+7py0Ns16ZJmeZ8Sy90QQZWf7wtC4R D4PFLzw2V5gFBBRviNzZEBnSHTorKZvkLFkdUDA5QjxT3tzmfGNKQWUuopw2UxcVmrcS lw5CWFX6I3WaxnkpwokGZIgODWL1+0+5wBsSk+jr2DHI0+D1QgaQw5/UPQ1wYwiiUkgQ 1oIw== 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 a20-v6si1511568pgi.184.2018.09.27.02.16.42; Thu, 27 Sep 2018 02:16:57 -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 S1728731AbeI0PdF (ORCPT + 99 others); Thu, 27 Sep 2018 11:33:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55664 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727589AbeI0PdE (ORCPT ); Thu, 27 Sep 2018 11:33:04 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2BDDC1120; Thu, 27 Sep 2018 09:15:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lyude Paul , Ben Skeggs Subject: [PATCH 4.18 66/88] drm/nouveau/drm/nouveau: Dont forget to cancel hpd_work on suspend/unload Date: Thu, 27 Sep 2018 11:03:47 +0200 Message-Id: <20180927090308.724680870@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 2f7ca781fd382cf8dde73ed36dfdd93fd05b3332 upstream. Currently, there's nothing in nouveau that actually cancels this work struct. So, cancel it on suspend/unload. Otherwise, if we're unlucky enough hpd_work might try to keep running up until the system is suspended. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_display.c | 9 ++++++--- drivers/gpu/drm/nouveau/nouveau_display.h | 2 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -425,7 +425,7 @@ nouveau_display_init(struct drm_device * } void -nouveau_display_fini(struct drm_device *dev, bool suspend) +nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime) { struct nouveau_display *disp = nouveau_display(dev); struct nouveau_drm *drm = nouveau_drm(dev); @@ -450,6 +450,9 @@ nouveau_display_fini(struct drm_device * } drm_connector_list_iter_end(&conn_iter); + if (!runtime) + cancel_work_sync(&drm->hpd_work); + drm_kms_helper_poll_disable(dev); disp->fini(dev); } @@ -618,11 +621,11 @@ nouveau_display_suspend(struct drm_devic } } - nouveau_display_fini(dev, true); + nouveau_display_fini(dev, true, runtime); return 0; } - nouveau_display_fini(dev, true); + nouveau_display_fini(dev, true, runtime); list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { struct nouveau_framebuffer *nouveau_fb; --- a/drivers/gpu/drm/nouveau/nouveau_display.h +++ b/drivers/gpu/drm/nouveau/nouveau_display.h @@ -62,7 +62,7 @@ nouveau_display(struct drm_device *dev) int nouveau_display_create(struct drm_device *dev); void nouveau_display_destroy(struct drm_device *dev); int nouveau_display_init(struct drm_device *dev); -void nouveau_display_fini(struct drm_device *dev, bool suspend); +void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime); int nouveau_display_suspend(struct drm_device *dev, bool runtime); void nouveau_display_resume(struct drm_device *dev, bool runtime); int nouveau_display_vblank_enable(struct drm_device *, unsigned int); --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -629,7 +629,7 @@ nouveau_drm_unload(struct drm_device *de nouveau_debugfs_fini(drm); if (dev->mode_config.num_crtc) - nouveau_display_fini(dev, false); + nouveau_display_fini(dev, false, false); nouveau_display_destroy(dev); nouveau_bios_takedown(dev);