From patchwork Wed Feb 5 15:40:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366487 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51965112B for ; Wed, 5 Feb 2020 15:40:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30E7720730 for ; Wed, 5 Feb 2020 15:40:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="u1KoK+lK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30E7720730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 640156F623; Wed, 5 Feb 2020 15:40:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc43.google.com (mail-yw1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) by gabe.freedesktop.org (Postfix) with ESMTPS id A89966F61C; Wed, 5 Feb 2020 15:40:25 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id l22so2707417ywc.8; Wed, 05 Feb 2020 07:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qeLHl579ioTT6rY1/3+ixHutdDt00Chlwn731EBjwWM=; b=u1KoK+lKkNOUDR/HaNzle9Fq0sP8EgOVBTVgMifk8qHSXMTRvU8LYyDT3580zyYZpX VPiqsLKt7Uh7hPRSr1li7VVfLrk5cVmRNERYXeEkL/xjoFzHswVP6xojWt8gqUFbMGkl p/2Jz9zu75fUFiR+XCYcA4akt+KWLUszTTKPBapZ3BEbl6P5/LNThuf4q9kT5IMB6vjY H3y4561zRrCnEnZSDLE/N5I1xZ8SAFIdujp0fsh3ou3RkB/Aa0P5RkXyjAtXe8QpwRhO K1DHJOvrD6hd4BKwoeA9e98XekPdLyIktF7PheLCFG4x2Ld0IpYTw2yF663+yZN3lhL+ mTUA== 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=qeLHl579ioTT6rY1/3+ixHutdDt00Chlwn731EBjwWM=; b=GdtGsGA943gQDjGSdjwAiApxcxYDBMs20qeaxK1m2Hwjk8V1suaP3oDt+veOMPklFD JngNtSNsr2nU98ovKzG7RyQnzvSB8SXLZa4DxFdtJVVYQbNVQuAQBdmtVU2YtBdEqizh jb2eLOgBvNB+fMyyXAF+8eg232WteoeMt+7U5kR4Qky5gjQbk12EcBsVlyXxb3MNLm8z Q3XVrivK2E3KVMnFL7tyAN4MsjJnczsoOeiW52y3Ybv8bg45pb7rZyzWq1A0yKGHuF01 LO/zfLQ4VuZYctvayvTlxIW1UH+A6o2bQq8Yej5ZB/7zxO5UnZeVVMLx0Pve1qnpvbBu 2P9g== X-Gm-Message-State: APjAAAV/BAo85KgYTXE5fRzPnaFwoW559/Agi2tkyiFXyp3SPyyLEZ3v rs1OL5bbzfH8g61FqLloodwveTPa X-Google-Smtp-Source: APXvYqxJ0B0RBhzIAQVVrUojryZJ/msYWFHTq1iP30p50PNalOqmU8Tvz3sWWBHUrpD9zKFkfbMlMg== X-Received: by 2002:a81:4c42:: with SMTP id z63mr11258802ywa.24.1580917224497; Wed, 05 Feb 2020 07:40:24 -0800 (PST) Received: from tr4.amd.com (atlvpn.amd.com. [165.204.84.11]) by smtp.gmail.com with ESMTPSA id q185sm61256ywh.61.2020.02.05.07.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:24 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 15/15] drm/amdgpu: drop legacy drm load and unload callbacks Date: Wed, 5 Feb 2020 10:40:00 -0500 Message-Id: <20200205154000.536145-16-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205154000.536145-1-alexander.deucher@amd.com> References: <20200205154000.536145-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We've moved the debugfs handling into a centralized place so we can remove the legacy load an unload callbacks. Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 4dc7145368fc..12aab522f459 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3091,10 +3091,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, } else adev->ucode_sysfs_en = true; - r = amdgpu_debugfs_init(adev); - if (r) - DRM_ERROR("Creating debugfs files failed (%d).\n", r); - if ((amdgpu_testing & 1)) { if (adev->accel_working) amdgpu_test_moves(adev); @@ -3216,7 +3212,6 @@ void amdgpu_device_fini(struct amdgpu_device *adev) amdgpu_ucode_sysfs_fini(adev); if (IS_ENABLED(CONFIG_PERF_EVENTS)) amdgpu_pmu_fini(adev); - amdgpu_debugfs_fini(adev); if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10) amdgpu_discovery_fini(adev); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index f26532998781..9753c55b317d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -1031,6 +1031,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { struct drm_device *dev; + struct amdgpu_device *adev; unsigned long flags = ent->driver_data; int ret, retry = 0; bool supports_atomic = false; @@ -1100,6 +1101,8 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, pci_set_drvdata(pdev, dev); + amdgpu_driver_load_kms(dev, ent->driver_data); + retry_init: ret = drm_dev_register(dev, ent->driver_data); if (ret == -EAGAIN && ++retry <= 3) { @@ -1110,6 +1113,11 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, } else if (ret) goto err_pci; + adev = dev->dev_private; + ret = amdgpu_debugfs_init(adev); + if (ret) + DRM_ERROR("Creating debugfs files failed (%d).\n", ret); + return 0; err_pci: @@ -1123,6 +1131,7 @@ static void amdgpu_pci_remove(struct pci_dev *pdev) { struct drm_device *dev = pci_get_drvdata(pdev); + struct amdgpu_device *adev = dev->dev_private; #ifdef MODULE if (THIS_MODULE->state != MODULE_STATE_GOING) @@ -1130,6 +1139,8 @@ amdgpu_pci_remove(struct pci_dev *pdev) DRM_ERROR("Hotplug removal is not supported\n"); drm_dev_unplug(dev); drm_dev_put(dev); + amdgpu_debugfs_fini(adev); + amdgpu_driver_unload_kms(dev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); } @@ -1434,11 +1445,9 @@ static struct drm_driver kms_driver = { DRIVER_GEM | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE, - .load = amdgpu_driver_load_kms, .open = amdgpu_driver_open_kms, .postclose = amdgpu_driver_postclose_kms, .lastclose = amdgpu_driver_lastclose_kms, - .unload = amdgpu_driver_unload_kms, .get_vblank_counter = amdgpu_get_vblank_counter_kms, .enable_vblank = amdgpu_enable_vblank_kms, .disable_vblank = amdgpu_disable_vblank_kms,