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 BF506C433EF for ; Wed, 24 Nov 2021 14:04:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354542AbhKXOHm (ORCPT ); Wed, 24 Nov 2021 09:07:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:50824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356454AbhKXOEU (ORCPT ); Wed, 24 Nov 2021 09:04:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5DA3961A84; Wed, 24 Nov 2021 13:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637759458; bh=MxCAPOVorpMN2VtI2HQ6FeSoF/XhI8DATfcH1s/0HRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RYuCDVQXyfH2Uz7Pajqp3BiuSnzZtqR1DBYyuPJMm1M88I8bqskCIiMnzpnL2i3Zl YPLfYRUpE3JElANXF9x7fKmNucRzVOmSzRclDsI06enVy/b8LOjpMrS6sdsH1teS5k nuq+uOBSa+mg+dZ7B71t98lAYHFApy9yZidnyq+8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeremy Cline , Lyude Paul , Ben Skeggs , Karol Herbst Subject: [PATCH 5.15 249/279] drm/nouveau: use drm_dev_unplug() during device removal Date: Wed, 24 Nov 2021 12:58:56 +0100 Message-Id: <20211124115727.333633176@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115718.776172708@linuxfoundation.org> References: <20211124115718.776172708@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Cline commit aff2299e0d81b26304ccc6a1ec0170e437f38efc upstream. 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 # 5.4+ Signed-off-by: Jeremy Cline Reviewed-by: Lyude Paul Reviewed-by: Ben Skeggs Tested-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20201125202648.5220-2-jcline@redhat.com Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/14 Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -798,7 +798,7 @@ nouveau_drm_device_remove(struct drm_dev struct nvkm_client *client; struct nvkm_device *device; - drm_dev_unregister(dev); + drm_dev_unplug(dev); client = nvxx_client(&drm->client.base); device = nvkm_device_find(client->device);