Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2907885imm; Mon, 16 Jul 2018 17:01:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcw2VwkuCByxNuH+T7dcLOkTbPmAMLnlDPAUMPoVVKnc276lXcq5z0jpidq3xA3mMpHw7lx X-Received: by 2002:a62:6547:: with SMTP id z68-v6mr5942817pfb.20.1531785675857; Mon, 16 Jul 2018 17:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531785675; cv=none; d=google.com; s=arc-20160816; b=I4pYzbra4Al2Gk/oyGhHl0P2lG/Coe1voPXzY6QUy72XGfvrvOgxL82WJmGvxAY2ae 6JJD5LUFigvG8fkGZF2U2gScoEMT5v1q13EmBa52rmardqG7N7XJp2RRs2NqgOUv+vL2 s42KI/+YhkEZXxKGMXXvFbiqz1m6KkHaQ1KoDLFD3BTjFXX9iPLc+lmQW4x0HZRPPiVk ReoCHtVU5VWnzcmPtCUGo2dpEc93Is0bY6NMNhE9FeRfNZzteg5YP6vdMfEHGXsMyIHF 5d8hXsWkA64XCqleV0uSBt3MgR5O8j3ljcJyJi/rOk+y7PSQoBhEsPVzItq7kEp2+aI5 kGhw== 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=qR9VUjkXtQR6XBhGexG662jVJDqjkRWV4ZqqHcQVE/c=; b=LwSdNkXBZ2374Cn4J8YLwvCGL5e9mpsAKuRcsfsUcQBqptv6xFqKu83l1f52ff/icc EYfFwNbFfa9vZ0AmiTh3SNeGlfPcyPoDiMfGfKeo/HIS3bUhH14xxOl5F9Nx6GKQIsSR qwqqCEmtKkzE84RStzjyesXV2Ie/I+wsDjhM+E/9yAallA3cWsULwIxGYfYU8/nxtRV9 j6md9T3XzhYhEGIlQMmX7NXSN6rU+5ozyhdBOgdoiUE5T61ni5MQ5vPhePurA6ed6T2i wXt2h/XzvkoA4gBjhEYQjWW+bHzdspTgP02smfJXdlf2LNeAs3X/h/pEh2Rf6GCXCepY cY+A== 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 y191-v6si34121205pfg.246.2018.07.16.17.01.01; Mon, 16 Jul 2018 17:01:15 -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 S1730882AbeGQA3z (ORCPT + 99 others); Mon, 16 Jul 2018 20:29:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56660 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730736AbeGQA3z (ORCPT ); Mon, 16 Jul 2018 20:29:55 -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 4875D81A4EB9; Tue, 17 Jul 2018 00:00:10 +0000 (UTC) Received: from whitewolf.lyude.net.com (ovpn-124-27.rdu2.redhat.com [10.10.124.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBA192026D65; Tue, 17 Jul 2018 00:00:09 +0000 (UTC) From: Lyude Paul To: nouveau@lists.freedesktop.org Cc: Karol Herbst , stable@vger.kernel.org, Ben Skeggs , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] drm/nouveau: Grab RPM ref when aux bus is in use Date: Mon, 16 Jul 2018 19:59:29 -0400 Message-Id: <20180716235936.11268-6-lyude@redhat.com> In-Reply-To: <20180716235936.11268-1-lyude@redhat.com> References: <20180716235936.11268-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.8]); Tue, 17 Jul 2018 00:00:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 17 Jul 2018 00:00:10 +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 DP AUX busses can both be accessed by DRM, and through any of the userspace dev nodes in /dev/drm_dp_auxN. We need to make sure the GPU stays on in all of these codepaths. Signed-off-by: Lyude Paul Cc: Karol Herbst Cc: stable@vger.kernel.org --- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c index 4c1f547da463..6276b113065c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c @@ -98,18 +98,28 @@ nvkm_i2c_aux_release(struct nvkm_i2c_aux *aux) AUX_TRACE(aux, "release"); nvkm_i2c_pad_release(pad); mutex_unlock(&aux->mutex); + pm_runtime_put_autosuspend(pad->i2c->subdev.device->dev); } int nvkm_i2c_aux_acquire(struct nvkm_i2c_aux *aux) { struct nvkm_i2c_pad *pad = aux->pad; + struct device *dev = pad->i2c->subdev.device->dev; int ret; + AUX_TRACE(aux, "acquire"); + + ret = pm_runtime_get_sync(dev); + if (ret < 0 && ret != -EACCES) + return ret; + mutex_lock(&aux->mutex); ret = nvkm_i2c_pad_acquire(pad, NVKM_I2C_PAD_AUX); - if (ret) + if (ret) { mutex_unlock(&aux->mutex); + pm_runtime_put_autosuspend(dev); + } return ret; } -- 2.17.1