From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03074C433F5 for ; Thu, 26 May 2022 20:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344939AbiEZUsB (ORCPT ); Thu, 26 May 2022 16:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344745AbiEZUr5 (ORCPT ); Thu, 26 May 2022 16:47:57 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A976812092 for ; Thu, 26 May 2022 13:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653598071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SY0RUurSRwuYkFp5Br4T7o+bRxgU1bmYAiSCEYlf2MY=; b=XH/RpsYB1ZaLDglZNCKp3lOsOInDgxHy9K1j16tMps2GIj/gbk31YtAM9ObDdz9YdUynpx T2ddW2rxeIrOJhRAVTJj+aba0lRFhAoQ+s/+xrTERuFPOx5dl2C9jO8gu/ljVn0IcND4Ai MrJZhhob5kFNUJPgZHTLYCQnu8xDKRs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-LveylXj7MlygAX64zTYprQ-1; Thu, 26 May 2022 16:47:48 -0400 X-MC-Unique: LveylXj7MlygAX64zTYprQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 43BB6801E6B; Thu, 26 May 2022 20:47:48 +0000 (UTC) Received: from emerald.redhat.com (unknown [10.22.34.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1FB2400F36; Thu, 26 May 2022 20:47:47 +0000 (UTC) From: Lyude Paul To: nouveau@lists.freedesktop.org Cc: Karol Herbst , Ben Skeggs , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org (open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] drm/nouveau: Don't pm_runtime_put_sync(), only pm_runtime_put_autosuspend() Date: Thu, 26 May 2022 16:47:32 -0400 Message-Id: <20220526204732.660069-3-lyude@redhat.com> In-Reply-To: <20220526204732.660069-1-lyude@redhat.com> References: <20220526204732.660069-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While trying to fix another issue, it occurred to me that I don't actually think there is any situation where we want pm_runtime_put() in nouveau to be synchronous. In fact, this kind of just seems like it would cause issues where we may unexpectedly block a thread we don't expect to be blocked. So, let's only use pm_runtime_put_autosuspend(). Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 9f5a45f24e5b..103bfb11acb9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -515,7 +515,7 @@ nouveau_display_hpd_work(struct work_struct *work) pm_runtime_mark_last_busy(drm->dev->dev); noop: - pm_runtime_put_sync(drm->dev->dev); + pm_runtime_put(drm->dev->dev); } #ifdef CONFIG_ACPI diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 4f9b3aa5deda..20ac1ce2c0f1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -466,7 +466,7 @@ nouveau_fbcon_set_suspend_work(struct work_struct *work) if (state == FBINFO_STATE_RUNNING) { nouveau_fbcon_hotplug_resume(drm->fbcon); pm_runtime_mark_last_busy(drm->dev->dev); - pm_runtime_put_sync(drm->dev->dev); + pm_runtime_put_autosuspend(drm->dev->dev); } } -- 2.35.3