Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13474040ybl; Sun, 29 Dec 2019 12:46:32 -0800 (PST) X-Google-Smtp-Source: APXvYqw+Di8V/+28etpPV1i9X6WoC++aN0snz5a4xin39AQrLdvd/Jt41uAeSxGLa2kqvklgtz70 X-Received: by 2002:a05:6830:1385:: with SMTP id d5mr40380959otq.61.1577652392652; Sun, 29 Dec 2019 12:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652392; cv=none; d=google.com; s=arc-20160816; b=ZhOmCKApTegRhpTf99j0+yfXAt5HO75WHL6PAxYoAfb2tPxoAXqUgm6J/gvMqfpoK7 Vw7H7mBuamwu3otVci/piSTnWynRxkzaEN9Qry+VQda+CkX99O4V8s4aP09W4zuyCEmF Lk3tag8xGZaTa+0b8KNdFMDnS38jhypwIO3N9gD5dqPSA2imcZoQGM7KzJ3H9DgVgLi1 XDwZvGVIwFuXtK2/Tcf34fHYWQk91nOumYj6i6QUBuetJ/WWXUJdb87uK9YGqbSJyBhk /F8WF/hxNIzUEoozJYsBQsiYVaa6MQSlUKnG886OPAlI0aivU2I6tW407punlbb61JR8 1MWg== 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:dkim-signature; bh=7AVatAyHNkLxm9evUCTFxw64kwiqvIL3pZB7BjAhRUE=; b=lbeIWtHmp+b/awSU2rC9babnItu7OcgqkEsC8w25dOW0A7y+6jDLCQd03n3/jjEaSG mR9wM6xkHnJqGORImmJXpSMBPVWP49u12jn4QPWCAIgTzXNF7cYlU8LKhzRAJZ4HhrqW fUoiFHgzxpLxR4L0qkUSIbleOCI3Wybb3XN3A1bTfMTuE1U7/jm31/e0Xz/Pwwg8dm9+ jVTaFzvs4HA31DAxIOzn4wP0/vypjquZRBoWC9EcIB3WPz9Ef50V6w3s6jgprVBdXdiy tJVCSP/ruBLvnsupt8JTT0BGgpuVi0TPEkTN9Qvplhjl+r4VujmxM2GSRsAiAKDuAMY6 JYoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vQaPaH4w; 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 g126si16402826oif.106.2019.12.29.12.46.20; Sun, 29 Dec 2019 12:46:32 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=vQaPaH4w; 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 S1731451AbfL2Rs0 (ORCPT + 99 others); Sun, 29 Dec 2019 12:48:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:59618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731157AbfL2RsY (ORCPT ); Sun, 29 Dec 2019 12:48:24 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 55829206DB; Sun, 29 Dec 2019 17:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641703; bh=SpyCjP8RX0DpkAjCNktAGaCvrCrHwq5o7oh0VsmPAok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vQaPaH4wJQ/1e3XwZxcU92/hRZNnDbE9Q6gZytUuk8xxjofnXmW85hi4Bz9J7Bo8y zZSCnbaELO709Jizk5xckHk7gLwfc8Ku6KamBQVYjKuXYsPAfx6/51qhb/wgytly+O pURSgj0SUAYR0PN49z2ELeT0/0yAURWAE00Fmf5c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juston Li , Imre Deak , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Harry Wentland , Daniel Vetter , Ben Skeggs , Sean Paul , Lyude Paul , Sasha Levin Subject: [PATCH 5.4 175/434] drm/nouveau: Dont grab runtime PM refs for HPD IRQs Date: Sun, 29 Dec 2019 18:23:48 +0100 Message-Id: <20191229172713.435660549@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Lyude Paul [ Upstream commit 09e530657e1c982d3dbc5e4302bf9207950c3d0a ] In order for suspend/resume reprobing to work, we need to be able to perform sideband communications during suspend/resume, along with runtime PM suspend/resume. In order to do so, we also need to make sure that nouveau doesn't bother grabbing a runtime PM reference to do so, since otherwise we'll start deadlocking runtime PM again. Note that we weren't able to do this before, because of the DP MST helpers processing UP requests from topologies in the same context as drm_dp_mst_hpd_irq() which would have caused us to open ourselves up to receiving hotplug events and deadlocking with runtime suspend/resume. Now that those requests are handled asynchronously, this change should be completely safe. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Cc: Daniel Vetter Reviewed-by: Ben Skeggs Reviewed-by: Sean Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-10-lyude@redhat.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nouveau_connector.c | 33 +++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 94dfa2e5a9ab..a442a955f98c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -1131,6 +1131,16 @@ nouveau_connector_hotplug(struct nvif_notify *notify) const char *name = connector->name; struct nouveau_encoder *nv_encoder; int ret; + bool plugged = (rep->mask != NVIF_NOTIFY_CONN_V0_UNPLUG); + + if (rep->mask & NVIF_NOTIFY_CONN_V0_IRQ) { + NV_DEBUG(drm, "service %s\n", name); + drm_dp_cec_irq(&nv_connector->aux); + if ((nv_encoder = find_encoder(connector, DCB_OUTPUT_DP))) + nv50_mstm_service(nv_encoder->dp.mstm); + + return NVIF_NOTIFY_KEEP; + } ret = pm_runtime_get(drm->dev->dev); if (ret == 0) { @@ -1151,25 +1161,16 @@ nouveau_connector_hotplug(struct nvif_notify *notify) return NVIF_NOTIFY_DROP; } - if (rep->mask & NVIF_NOTIFY_CONN_V0_IRQ) { - NV_DEBUG(drm, "service %s\n", name); - drm_dp_cec_irq(&nv_connector->aux); - if ((nv_encoder = find_encoder(connector, DCB_OUTPUT_DP))) - nv50_mstm_service(nv_encoder->dp.mstm); - } else { - bool plugged = (rep->mask != NVIF_NOTIFY_CONN_V0_UNPLUG); - + if (!plugged) + drm_dp_cec_unset_edid(&nv_connector->aux); + NV_DEBUG(drm, "%splugged %s\n", plugged ? "" : "un", name); + if ((nv_encoder = find_encoder(connector, DCB_OUTPUT_DP))) { if (!plugged) - drm_dp_cec_unset_edid(&nv_connector->aux); - NV_DEBUG(drm, "%splugged %s\n", plugged ? "" : "un", name); - if ((nv_encoder = find_encoder(connector, DCB_OUTPUT_DP))) { - if (!plugged) - nv50_mstm_remove(nv_encoder->dp.mstm); - } - - drm_helper_hpd_irq_event(connector->dev); + nv50_mstm_remove(nv_encoder->dp.mstm); } + drm_helper_hpd_irq_event(connector->dev); + pm_runtime_mark_last_busy(drm->dev->dev); pm_runtime_put_autosuspend(drm->dev->dev); return NVIF_NOTIFY_KEEP; -- 2.20.1