Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1781433imm; Thu, 27 Sep 2018 02:22:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV63cSzF0PoEh7azPUEJnd2+IVo0jvqUoZyXQw2fMm2MtB58nCFNFIR9bYVoHGkK25PXv+1pB X-Received: by 2002:a63:1e19:: with SMTP id e25-v6mr9343963pge.44.1538040137460; Thu, 27 Sep 2018 02:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538040137; cv=none; d=google.com; s=arc-20160816; b=Q/xi3BFKIx1CaMnWLzvemzBshHL0tJkeCUJomnNNttRinWUSiWU1DX1ArbUPWfIyDs Sf1Iq+SN5ln4wSm5rfPj7+osvT1IdoGn3I20/QSn77hBIwKMcNJe0C5dhrWYK4dih+xn V3TT8T3xvKiKdUEJFZl9omtXTNfa9unVd+/chemLxYBXqyWjl8jHDpBhjxnylS9Ksfqx PYPVh1VXvTP2d/x2HiWkM6hl29/6qi1s71jClbj+6LjUqlwq1uSPQyh1KTTa12O3A4kn 3/ZGkagDJbJMjyoHm9M+LHIO0MUtC6D7KfyXp81W4Z+FRBBcwF+oBrt2G8cM8Rqn3cUA GjWQ== 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=H29fae229KShgapDq0ix2yovpB12XDG48hxyqVYfEys=; b=06GNsbv5gJn9ON1iYekQivvdJ5HtmX7sHbFdlxNU6TAdbAFcf4q964/45j5yMNHIAZ +lGzo8OqZm83/Wq97Wy5Nfwi1uFB4d/wzUttpIwjaSzd74aaySQHLIlyH2ce/HgcTd3j xxjDBXUfJcBEP0GhmiKTTnqxaE6kB9OAMW2KrU57V9oH4TvoPpPVTZdJf02YuFR76Uyu OSpjL4Y+uYeK694pnPRwBP+CLoCg4mfYx3Fwjaugm7NzRzKQCu95tMYNJgLs3UyXNQqT LLYdn5+Nyptpnfqjc0nzt2DjBkc/kekNErsZu+APFM7q997qCBWoQ3xl6dwe0qZxyaYU Ievw== 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 x23-v6si1427720plr.57.2018.09.27.02.22.02; Thu, 27 Sep 2018 02:22:17 -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 S1728958AbeI0Pha (ORCPT + 99 others); Thu, 27 Sep 2018 11:37:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56298 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728085AbeI0Pha (ORCPT ); Thu, 27 Sep 2018 11:37:30 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4D4421117; Thu, 27 Sep 2018 09:20:11 +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.14 42/64] drm/nouveau/drm/nouveau: Dont forget to cancel hpd_work on suspend/unload Date: Thu, 27 Sep 2018 11:03:59 +0200 Message-Id: <20180927090255.948275442@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 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 @@ -426,7 +426,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); @@ -451,6 +451,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); } @@ -640,11 +643,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 @@ -64,7 +64,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 @@ -546,7 +546,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);