Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4560815imm; Mon, 30 Jul 2018 17:41:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd2s+34mmu0XZ0bovkHnBQlasiA5O1R3WM3li1BTxbdbtxoDhgyxt8VNOD1/55IevEnrSnw X-Received: by 2002:a65:4c87:: with SMTP id m7-v6mr18007369pgt.98.1532997678818; Mon, 30 Jul 2018 17:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532997678; cv=none; d=google.com; s=arc-20160816; b=sINMpzVz/uKh9neVlbiImlfg04B9V5ftjNXBrcPKSoKh+WRZosjAnfT/1vUt3jsaTg pfPvTjQPvs+nrLwHVMCug1OSpdVuGg13dYTpLwtCTvemRmVaV9tTAQuHnHLAlnuwb7nm JhJ1FVV5NAsZnhz+JO5rrnivq6IlteNXnnSps34K9hu+AoBoU8nkmX3FAVpV0uwknAQH /3rWK0ygL+Jz+uY7UB4SWPxXnyizX40/qojLezXIkwWmB0cnf5XrrAfkmVfXA7gOk2uL kUtI9CJ96R9F5dnUCxW7/IxpSnlCyAyqXzV9juFgoVvIKlsCayfAyMJX/mu9S7A0UREJ o8hA== 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=cUODHA7heBNtCll5WYUIu5suZZkE0OJyt2VuHkzjdHjqURjlQg/4h18KzfItfkspkZ mC2H0TmJFsted9yAWTTdYMwT0TUEArO0JxSQOp2vrmx1UrqZu+7BsFPsKFTRrSfMNpwt NEg2eHeMbHGoVFagtO+Gg5Sgv6Pf67IcIEfMnu8vib8Ek05DECkiYZ6TSdRazO2WyG40 fOWcptJ9YEVoRGTP59YXnHIcKz0baKvw5NJelNOWhnXXGS2DUCzTXptPuinvEW/bHJ0J Xxu9mVSUf7BSE7+9T9TYkJ7aspNUnNGsyeKvW/FH+wvQQRp1IB4ccK8MWM7f5wMz3K2x DxvQ== 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 e3-v6si2212575pld.331.2018.07.30.17.41.04; Mon, 30 Jul 2018 17:41:18 -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 S1732302AbeGaCRl (ORCPT + 99 others); Mon, 30 Jul 2018 22:17:41 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37250 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732276AbeGaCRl (ORCPT ); Mon, 30 Jul 2018 22:17:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 24B6840241DE; Tue, 31 Jul 2018 00:40:07 +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 C978216875; Tue, 31 Jul 2018 00:40:06 +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 v3 8/8] drm/nouveau: Call pm_runtime_get_noresume() from hpd handlers Date: Mon, 30 Jul 2018 20:39:53 -0400 Message-Id: <20180731003954.19962-9-lyude@redhat.com> In-Reply-To: <20180731003954.19962-1-lyude@redhat.com> References: <20180731003954.19962-1-lyude@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 31 Jul 2018 00:40:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 31 Jul 2018 00:40:07 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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