Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1339998imm; Wed, 1 Aug 2018 14:16:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc1YtLodV/DkPCcBGloynUqMzE8wNB2Ys7bSoUKgTDCtBo31xbdfMyLlu6a7+Og9XIbdOMS X-Received: by 2002:a63:a919:: with SMTP id u25-v6mr3678pge.211.1533158199561; Wed, 01 Aug 2018 14:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533158199; cv=none; d=google.com; s=arc-20160816; b=EKXoCQHCx+Tt5wQ2bgt9mBxd0h9U4oQM9fNhZ0SfbbyqXv0kNdyQuj+Tn80PNXDk3e z8jIUlNAKVRaqKdhaCZZmQ1Pb/GqHj5jYR5G8niQMegZm/Ge7eLCUpeOfL1wHKnn/V8S Twq9cc98WClI3yiZMjRPFznhGyY4EUCYocYtkOXiBXOm+kFrEut/GagjQdBcc5sjqcO+ 2thCX6Exji+LjsKc5YCA2FYSxc/ikS5ZcGNhblDXzyUqyqVnpjPPYpu/meeSRpkvo9jy jYFOKS+43JRjjIffGckUmv7IB+DLFwmN6/E4O+NO1pK6Hgepo4KAMn3JzpgJ1eLL16Ee 2TRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=z5CVn0CyM4Nj7WShVtvDqIcIbVSabOaZsLSAOvZaZLk=; b=M3EE589gv8GZ6zH4FCIlp5ZcBQ6ne5nvYj5vK2EiSxBmoznY/Kq6nWhr91tMWGzjQX XMluK5/qNZj9vacSpLUvEt+KrcnRkxNZM978lrerjjKRSDtkhsmTlBmJ7JaVLr6ahmFs q3hUxwK46FkY//ey7RpdkEOVkdWF4QeD4Xni9I3sHeuhr4Fdc8A5Gcf32Wbm0mV3dJ+K n+DUGHqDYTog296uPFm0TsyuBhal+GsesGLRLeaThtcbjcnz5wXDsiMH8o8FHJ3jqHFD JuyhLe8Rxksm3Pi6UHl4PtGZ8I2qlUx9bLx7fkkBONNyp7NhYQcMHS206g0zZBq0OwU6 eoBw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c62-v6si37048pfb.98.2018.08.01.14.16.25; Wed, 01 Aug 2018 14:16:39 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732378AbeHAXDB (ORCPT + 99 others); Wed, 1 Aug 2018 19:03:01 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45378 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732118AbeHAXDB (ORCPT ); Wed, 1 Aug 2018 19:03:01 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF2DD40201C4; Wed, 1 Aug 2018 21:15:19 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-11.bss.redhat.com [10.20.1.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 700A02026D68; Wed, 1 Aug 2018 21:15:19 +0000 (UTC) From: Lyude Paul To: nouveau@lists.freedesktop.org Cc: stable@vger.kernel.org, Lukas Wunner , Karol Herbst , Ben Skeggs , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 8/8] drm/nouveau: Call pm_runtime_get_noresume() from hpd handlers Date: Wed, 1 Aug 2018 17:14:58 -0400 Message-Id: <20180801211459.7731-9-lyude@redhat.com> In-Reply-To: <20180801211459.7731-1-lyude@redhat.com> References: <20180801211459.7731-1-lyude@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 01 Aug 2018 21:15:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 01 Aug 2018 21:15:19 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lyude@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We can't and don't need to try resuming the device from our hotplug handlers, but hotplug events are generally something we'd like to keep the device awake for whenever possible. So, grab a PM ref safely in our hotplug handlers using pm_runtime_get_noresume() and mark the device as busy once we're finished. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Cc: Lukas Wunner Cc: Karol Herbst --- drivers/gpu/drm/nouveau/nouveau_connector.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 8409c3f2c3a1..5a8e8c1ad647 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -1152,6 +1152,11 @@ nouveau_connector_hotplug(struct nvif_notify *notify) const char *name = connector->name; struct nouveau_encoder *nv_encoder; + /* Resuming the device here isn't possible; but the suspend PM ops + * will wait for us to finish our work before disabling us so this + * should be enough + */ + pm_runtime_get_noresume(drm->dev->dev); nv_connector->hpd_task = current; if (rep->mask & NVIF_NOTIFY_CONN_V0_IRQ) { @@ -1171,6 +1176,9 @@ nouveau_connector_hotplug(struct nvif_notify *notify) } nv_connector->hpd_task = NULL; + + pm_runtime_mark_last_busy(drm->dev->dev); + pm_runtime_put_autosuspend(drm->dev->dev); return NVIF_NOTIFY_KEEP; } -- 2.17.1