Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp119511pxu; Wed, 25 Nov 2020 14:59:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxvVKfGLgd3ObPj0nwSHp855i6GN0+hTLlw5oYpDYvYRWCfzLTsPAkvKyRQSj4naxODDY6 X-Received: by 2002:a17:906:6d13:: with SMTP id m19mr179439ejr.345.1606345159802; Wed, 25 Nov 2020 14:59:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606345159; cv=none; d=google.com; s=arc-20160816; b=oDWTAZFeImBEhtH1P1vru30t2YVVp5x3DEs29wf+J1OQTQqeB85k9HEzfhc4fh9Vsa 6yhRj7aYVkPoWkz+QYGKusD+XCbqUvl+039f5W9UsFpEuAQptRLOnktK09+4IAIL/Hvq vPPOkmoejINuhijbzYSONIacA0NU5BMqQawN/5WdoDi8H4o0tkH4bXCSnOmGlakCgVo/ Rm2m2hug33JUsOgecVtiVl6BAdikma2qRv3b61xCh+Yx8zMRS/F9u8oQELpUOWKyIJzA uwp+JJbbK8x13HwgoRpQwyk+r9U1BReRKkaeEHGgI7DuYazpooa8+10w+tY4R7dHGKjm fmCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oyv7TmTJOo07L0V0MDDH9iBw1ZsQzWrWnebIO9wiR7I=; b=QvPvzmr6eJ4s1MjZGn3SBo7yE5YNHWYEQd4obMYRECmrf3gidNvtbAar2PNN8w1oj2 OyoUr8QH0DAaS8fGm6is8J1J8Lccq2XMmdkrDhTICB36Av5Kn9Tbub1Z3SkNNvO8j81z 8Xe6qTmOcsZq0C1h5NFmigwJsXXDUVoNgvP1El4CAjfoxtbDF9kQPKcvkfBJTj+ajbW8 1Vr9HipB+1N/3tx6/bYjBMpoKzw59LlqVynqejdYQ5iiPwOX3KkgK53v+8VPAyI7n/qg m6xIumz3NZVSSO2yuU1C89dNWvK3eV0nbeNC9Jb5U036YOFs3VMAU7XmmUzOfuQgIh2W yD9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=idKvmE6J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si2069685ejg.364.2020.11.25.14.58.57; Wed, 25 Nov 2020 14:59:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=idKvmE6J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729482AbgKYU1P (ORCPT + 99 others); Wed, 25 Nov 2020 15:27:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:33331 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729175AbgKYU1P (ORCPT ); Wed, 25 Nov 2020 15:27:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606336033; 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=oyv7TmTJOo07L0V0MDDH9iBw1ZsQzWrWnebIO9wiR7I=; b=idKvmE6JeGaS+IwH1UaEilqG/aLRJ2w3Jp3hzRdPFGel9FjL3sUo+2PncCzNiJ1lMva7Sw pLTpifYG7EkLd1C2EKLBmaXu9W4+qPwyU7/WCGVkibzlGN4g4uSjYi9uPWScTr+yQfo8VF pwViHHKE1zMt6Nv6LkU6k/DbhnSkKbI= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-170-qyDbXV7KNci47_7KxVU5tg-1; Wed, 25 Nov 2020 15:27:12 -0500 X-MC-Unique: qyDbXV7KNci47_7KxVU5tg-1 Received: by mail-qk1-f197.google.com with SMTP id x196so3288703qkb.12 for ; Wed, 25 Nov 2020 12:27:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oyv7TmTJOo07L0V0MDDH9iBw1ZsQzWrWnebIO9wiR7I=; b=TyOOCzfKkmWsOYiBfkcSsyQmhuhZKG5oeHsiFuyzcHZGLJ70BzhnyVh9ddsfrTLeoP xAM7WM/BX57Aab1zsdV5gon8VRDgUNv2WwLEOnatuIBcBl2y8qq0ml2WF2NJ2Jjzs32g ZeADxxM4hEl0QG0cQXD31N/+Nh+RngsnaK9fdxvzMxVfRpEkwlOYZ9O9CSYd9V6TtWa4 hLa13iOmi+W5IVJa3Lp53ec21GyVThNI0kcpXl/ROiFrjhTFQE3sbkU9pEU5QM6QLCK9 oWQnkJJH0SzKLGFBrV/YTHTo/l6oensp9C5Rm3NXmfkHO/0OWaKNYl2oHIaxRwI8rin6 xLKg== X-Gm-Message-State: AOAM533tYrzTmhTlv3uOOumUYJe5GcoMjp3Qdc2GesEvjGSZyqQISqXc t66ZrlWPcPLiQOB+ohnRIFO8tZ9rJpJ1aqhvJGEFParJb3vrqpirgNKIJiNmncwleRhqbfHnZP2 MSC6/N7To5QG62kfoN+XyBaX3 X-Received: by 2002:aed:39c2:: with SMTP id m60mr663842qte.206.1606336031654; Wed, 25 Nov 2020 12:27:11 -0800 (PST) X-Received: by 2002:aed:39c2:: with SMTP id m60mr663825qte.206.1606336031489; Wed, 25 Nov 2020 12:27:11 -0800 (PST) Received: from dev.jcline.org ([2605:a601:a638:b301:9966:d978:493:6a3d]) by smtp.gmail.com with ESMTPSA id o187sm431772qkb.120.2020.11.25.12.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 12:27:10 -0800 (PST) From: Jeremy Cline To: Ben Skeggs Cc: Lyude Paul , Karol Herbst , David Airlie , nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jeremy Cline , stable@vger.kernel.org Subject: [PATCH v2 1/3] drm/nouveau: use drm_dev_unplug() during device removal Date: Wed, 25 Nov 2020 15:26:46 -0500 Message-Id: <20201125202648.5220-2-jcline@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201125202648.5220-1-jcline@redhat.com> References: <20201103194912.184413-1-jcline@redhat.com> <20201125202648.5220-1-jcline@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nouveau does not currently support hot-unplugging, but it still makes sense to switch from drm_dev_unregister() to drm_dev_unplug(). drm_dev_unplug() calls drm_dev_unregister() after marking the device as unplugged, but only after any device critical sections are finished. Since nouveau isn't using drm_dev_enter() and drm_dev_exit(), there are no critical sections so this is nearly functionally equivalent. However, the DRM layer does check to see if the device is unplugged, and if it is returns appropriate error codes. In the future nouveau can add critical sections in order to truly support hot-unplugging. Cc: stable@vger.kernel.org Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index d141a5f004af..4fe4d664c5f2 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -792,7 +792,7 @@ nouveau_drm_device_remove(struct drm_device *dev) struct nvkm_client *client; struct nvkm_device *device; - drm_dev_unregister(dev); + drm_dev_unplug(dev); dev->irq_enabled = false; client = nvxx_client(&drm->client.base); -- 2.28.0