From patchwork Wed May 12 14:26:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 12253883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7B81C43462 for ; Wed, 12 May 2021 14:27:33 +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 65537613E9 for ; Wed, 12 May 2021 14:27:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65537613E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amd.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 A56996EC0F; Wed, 12 May 2021 14:27:31 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2044.outbound.protection.outlook.com [40.107.223.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE95B6EC14; Wed, 12 May 2021 14:27:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jlohzi4jlJFCfQ+AbqnLz7TSTFLiT9vWHJoJWR59lWod+84YqXifufwXfvEgGQpy3zqAU1vaKcQ4U6H5W8aCf74b9c6tTbRZhtP/oMM16JA7b7CynijVc7oc0am+ZCufm/Ub2NDu5ovsdpDqTE6KL5VYZeEw8OrJXuGnqzfFz3gKqs17Lw9sBBTNERo7wRVtSLWgynF0JBayacOVwylX6e1fOPUYp22yvkgO47pbP5FgY9X0U9A5+P9SSh2OLQFcvXIDm50u6mmN0Z6qSJxQaC8h3aZpDC/VYsIhqCtT1L0r92RhKNScTXHogWw/PU6av9OQWHYTakuqvGDRXBYJNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+j+bM1q4z3pMJEkudykjSW5dJG+JuOaAr7e0M6/ckSw=; b=biGjpNvl7b82q+PwL9wI8EAepzxD3HsxeZfODkC2mE+0FKTOdqWv5Gh2ldi+ZZQ8vAsXVaRO5JZqyWMwA0lFPcaIv0alIq7y1DIqKAetjev88BlIiPaLsT6Op3755uHAz/3R2iV7jJr348cz3+JuVD2s/Fn4iorKAy0/zJOEZCvNRvhuxs65PA8J0BV49SFfhdXt246RlA8EWEwlhBS164x3jRCzkdWoawkxnSW5wXlV8ZLlJTWvhQM6lZjA3BGXZV24caAwp04dSgzrYeb0XDReGO6Dhwj3T8gJyXeK/1jOi/YN78e8S4d3Sm0vGnx2woIfTS21YR5DdTlHiyuR/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+j+bM1q4z3pMJEkudykjSW5dJG+JuOaAr7e0M6/ckSw=; b=ddjX09QaEOh1ra+Wyrm7sDzzGIWUBL4l2kZKVNMmrWjenI1ySrSTqeL7QJHR/lMS0XW7aJ7Vatspab4QN0Rg0uDLIC++eqgppd5iwjiCnpak4V12xjyRCSyi8LIZUhPvAkHDogDLGaWQYx4DbA/6jHe0QV62hy+0zv1/8f9zOxg= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB4623.namprd12.prod.outlook.com (2603:10b6:805:e9::17) by SN6PR12MB2845.namprd12.prod.outlook.com (2603:10b6:805:75::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Wed, 12 May 2021 14:27:26 +0000 Received: from SN6PR12MB4623.namprd12.prod.outlook.com ([fe80::ad51:8c49:b171:856c]) by SN6PR12MB4623.namprd12.prod.outlook.com ([fe80::ad51:8c49:b171:856c%7]) with mapi id 15.20.4129.026; Wed, 12 May 2021 14:27:26 +0000 From: Andrey Grodzovsky To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-pci@vger.kernel.org, ckoenig.leichtzumerken@gmail.com, daniel.vetter@ffwll.ch, Harry.Wentland@amd.com Subject: [PATCH v7 08/16] drm/amdgpu: Convert driver sysfs attributes to static attributes Date: Wed, 12 May 2021 10:26:40 -0400 Message-Id: <20210512142648.666476-9-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210512142648.666476-1-andrey.grodzovsky@amd.com> References: <20210512142648.666476-1-andrey.grodzovsky@amd.com> X-Originating-IP: [2607:fea8:3edf:49b0:7576:4f76:97d8:1487] X-ClientProxiedBy: YTOPR0101CA0032.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:15::45) To SN6PR12MB4623.namprd12.prod.outlook.com (2603:10b6:805:e9::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from agrodzovsky-All-Series.hitronhub.home (2607:fea8:3edf:49b0:7576:4f76:97d8:1487) by YTOPR0101CA0032.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:15::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.30 via Frontend Transport; Wed, 12 May 2021 14:27:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e3753d6-d2bd-40ed-d4b9-08d9155210f5 X-MS-TrafficTypeDiagnostic: SN6PR12MB2845: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NuHBhvPgseDyf/4H1ld5FZxFb7YL93e4NSR0VdOVJIvO4ZNcyQpXfBlfY4KC6V8e5z6OOaEp817+jghKDylxUrFxOyf7Ayjzl8hUZ32AkkXLVbBMKh+MvMEIxBI/epyIYkHVssBUJS65xBvpGVL9QhARV99WFhtWvXg4E4ATxKJXa6M47+l5P0fDfuLTUzfUZlxXAhrW5Yb5+UuWxT62NdTt5nElgRQlL1z/jGAhZqbHX8RGPamG6CeFVAC+b6HmeMZK8PAa/nfghMGGNGUFeqwjqWou3w1VfLhPzCFlurkg9V7WMnAhjqw0rIVg+nK3Ky0mjZL6nlg4Jw2sAfbIEGrHSZ3uFYt7dxagjViMcWQi7stWCXE4XnafDW6JrBhTU5/3RnCrjR2M/VY27S62/Px97+90CjeU68tyebjU1929JojzKLnpJWhedwANLHOd9UvYj8c84ncAhrh5sNkAfZ2DGTckHMvrhLrV5almfZmTyW6d+Sv8w62pY5chlEgQlzKZ59/LbzZa06+jSb7WzgQUQmKjn4Lw8GtgsowegP/uHZv94wyyGWxcFAzjyTFklAIjFt6w3pTbtjtrGLHBWzAe73sb0+uvvrlVRJj0TcE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR12MB4623.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(39860400002)(396003)(346002)(136003)(366004)(6486002)(8676002)(54906003)(316002)(6512007)(16526019)(6636002)(478600001)(1076003)(186003)(4326008)(44832011)(2906002)(6506007)(8936002)(5660300002)(2616005)(38100700002)(66574015)(36756003)(86362001)(6666004)(66476007)(66946007)(66556008)(83380400001)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?eTC0QvD4vSrL4t0QkMf/NqvVrz398n?= =?utf-8?q?62FLDx1L+BC+JK6PCsd1zOgClgN8JI9elyBxqZgqNo3g28znCzbs9j/P4JcV+zlcb?= =?utf-8?q?IATk9DaNcH4MO0tJSuevV3R1bonY2AyvoujrzUoL25EQI5Vle3RIVt5Qn9rMtzJsK?= =?utf-8?q?+eVmDCoSJtBTmHlV8gbqlVmDxeQj09HwRQdZsZjd9azzMzwpVWBkyPNSvcwE/VSmo?= =?utf-8?q?6f94D0Epr2NYvFIAQHIRxe0PLyJFlukSJ6kgxa8KxrNVO+HdO4qjBvylbCZkwOatP?= =?utf-8?q?u77UmxKPKm0/ED9UQ+Qpga9DIENdYTlp8QTm/TgpxGMRe/gfAqSatB7UnQYKvNZqe?= =?utf-8?q?tFiFkH0X1SPeQswN0L7p55QLdCl8v32J+VCUN6vo1zMXJSXxK6+l/2y7CnaYIxj3s?= =?utf-8?q?r8IUcXbQwWTwx2+HgC07TdxbFoy5s061JaLWjqb8U92ZyYUBwEc+Fges6Op4c067B?= =?utf-8?q?8SgrtTmqM4FBAJYA4mCFceoaqwjrXkj/GV3T6QtXleY06u3InLTPnkGv/waOTCINB?= =?utf-8?q?sf4v8+e4Ddj9OA/j5AOIeOU4vSDEuA8UzqFbK1If57yESd7exzYmwW7EJg+Q8ROu/?= =?utf-8?q?ZhXblN5T/pA8NQyegGVBnaMx673WeawxAOyuBXjruhw3IJDNew7/2P4Oq4UMQZsAR?= =?utf-8?q?1RyVoQwA1oYnTU9xnEgAIQ9mJ/fUUatsxXGsKo2uXYYVbcJqtIFh9UhQJd81DeT2g?= =?utf-8?q?NOetZPnx4v91oVa9z09iZumon8Mu6DZCillVudXLAL9pmIcYIlAS+YpKwgAsDwNT0?= =?utf-8?q?cBMlwMagLDy5f40k+tZgFJRgaqTRK8cn8g2rL1S7/Kz1tECZrfVfMImxUPPp/+VSI?= =?utf-8?q?k2XaZ/N1CJxSXqmHzAPs+KYJNqP7z5ocI7OIlmSBXePp/EZxUxNgO89HoJAFVZowy?= =?utf-8?q?58VeDJKR2jD7J09EQ/Y0/feiWe65rom0kET88N8GVaK/ld1Ai2vNXGrmzPI7OAqi3?= =?utf-8?q?wSYtduN7NIq0TPpHicyRQGW1WdEBQ+qcQABY4hakH8E+mBs1w8/1L8ijqeWp7miAh?= =?utf-8?q?9Jp7z5iZBCA+3HC0/Usukcs5/Jjx5dGS4u40PR2/Q5V9aLATC0J213jZIVMHGF0Pe?= =?utf-8?q?aYeFTp8mf0RguJCcD7hWUjqxhMihrDy3qeDd4J4EpjeowWLSfgWnXHYFUlx+gCk+N?= =?utf-8?q?uY0JHSvPhGwi3auGOAG633ARnM78qUubW4yLK0dsppbqWvrqSb35spA3Y/pIwLA41?= =?utf-8?q?eApSOVXbzItM63Oo4Utp8gji8XXEJupF9doMNauBcj1w7keCV5kRAh4mELUXOn8zY?= =?utf-8?q?QBeht6Rsxekls2uvLrWMgIVDOWWa+7QoIk40qP2uRaJ3gqbk0f8i2FV5D8rTmSEPF?= =?utf-8?q?LrPQv3ljBY9mo?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e3753d6-d2bd-40ed-d4b9-08d9155210f5 X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB4623.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2021 14:27:26.7072 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OGm5T98Pb2GAiFQY/WpOdHyPNf/bkiMz44IsiNS+64QUwhrzZCSaZ/f4nTjekOleGhYOCmiLntMtDOFN3psVAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2845 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: gregkh@linuxfoundation.org, Felix.Kuehling@amd.com, helgaas@kernel.org, Alexander.Deucher@amd.com, =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This allows to remove explicit creation and destruction of those attrs and by this avoids warnings on device finalizing post physical device extraction. v5: Use newly added pci_driver.dev_groups directly Signed-off-by: Andrey Grodzovsky Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 17 ++++++------- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 ++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 25 ++++++++------------ drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 14 ++++------- 4 files changed, 37 insertions(+), 32 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 494b2e1717d5..879ed3e50a6e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -1768,6 +1768,15 @@ static ssize_t amdgpu_atombios_get_vbios_version(struct device *dev, static DEVICE_ATTR(vbios_version, 0444, amdgpu_atombios_get_vbios_version, NULL); +static struct attribute *amdgpu_vbios_version_attrs[] = { + &dev_attr_vbios_version.attr, + NULL +}; + +const struct attribute_group amdgpu_vbios_version_attr_group = { + .attrs = amdgpu_vbios_version_attrs +}; + /** * amdgpu_atombios_fini - free the driver info and callbacks for atombios * @@ -1787,7 +1796,6 @@ void amdgpu_atombios_fini(struct amdgpu_device *adev) adev->mode_info.atom_context = NULL; kfree(adev->mode_info.atom_card_info); adev->mode_info.atom_card_info = NULL; - device_remove_file(adev->dev, &dev_attr_vbios_version); } /** @@ -1804,7 +1812,6 @@ int amdgpu_atombios_init(struct amdgpu_device *adev) { struct card_info *atom_card_info = kzalloc(sizeof(struct card_info), GFP_KERNEL); - int ret; if (!atom_card_info) return -ENOMEM; @@ -1833,12 +1840,6 @@ int amdgpu_atombios_init(struct amdgpu_device *adev) amdgpu_atombios_allocate_fb_scratch(adev); } - ret = device_create_file(adev->dev, &dev_attr_vbios_version); - if (ret) { - DRM_ERROR("Failed to create device file for VBIOS version\n"); - return ret; - } - return 0; } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 5ebed4c7d9c0..83006f45b10b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -1766,6 +1766,18 @@ static struct pci_error_handlers amdgpu_pci_err_handler = { .resume = amdgpu_pci_resume, }; +extern const struct attribute_group amdgpu_vram_mgr_attr_group; +extern const struct attribute_group amdgpu_gtt_mgr_attr_group; +extern const struct attribute_group amdgpu_vbios_version_attr_group; + +static const struct attribute_group *amdgpu_sysfs_groups[] = { + &amdgpu_vram_mgr_attr_group, + &amdgpu_gtt_mgr_attr_group, + &amdgpu_vbios_version_attr_group, + NULL, +}; + + static struct pci_driver amdgpu_kms_pci_driver = { .name = DRIVER_NAME, .id_table = pciidlist, @@ -1774,6 +1786,7 @@ static struct pci_driver amdgpu_kms_pci_driver = { .shutdown = amdgpu_pci_shutdown, .driver.pm = &amdgpu_pm_ops, .err_handler = &amdgpu_pci_err_handler, + .dev_groups = amdgpu_sysfs_groups, }; static int __init amdgpu_init(void) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c index 72962de4c04c..a4404da8ca6d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c @@ -75,6 +75,16 @@ static DEVICE_ATTR(mem_info_gtt_total, S_IRUGO, static DEVICE_ATTR(mem_info_gtt_used, S_IRUGO, amdgpu_mem_info_gtt_used_show, NULL); +static struct attribute *amdgpu_gtt_mgr_attributes[] = { + &dev_attr_mem_info_gtt_total.attr, + &dev_attr_mem_info_gtt_used.attr, + NULL +}; + +const struct attribute_group amdgpu_gtt_mgr_attr_group = { + .attrs = amdgpu_gtt_mgr_attributes +}; + static const struct ttm_resource_manager_func amdgpu_gtt_mgr_func; /** * amdgpu_gtt_mgr_init - init GTT manager and DRM MM @@ -89,7 +99,6 @@ int amdgpu_gtt_mgr_init(struct amdgpu_device *adev, uint64_t gtt_size) struct amdgpu_gtt_mgr *mgr = &adev->mman.gtt_mgr; struct ttm_resource_manager *man = &mgr->manager; uint64_t start, size; - int ret; man->use_tt = true; man->func = &amdgpu_gtt_mgr_func; @@ -102,17 +111,6 @@ int amdgpu_gtt_mgr_init(struct amdgpu_device *adev, uint64_t gtt_size) spin_lock_init(&mgr->lock); atomic64_set(&mgr->available, gtt_size >> PAGE_SHIFT); - ret = device_create_file(adev->dev, &dev_attr_mem_info_gtt_total); - if (ret) { - DRM_ERROR("Failed to create device file mem_info_gtt_total\n"); - return ret; - } - ret = device_create_file(adev->dev, &dev_attr_mem_info_gtt_used); - if (ret) { - DRM_ERROR("Failed to create device file mem_info_gtt_used\n"); - return ret; - } - ttm_set_driver_manager(&adev->mman.bdev, TTM_PL_TT, &mgr->manager); ttm_resource_manager_set_used(man, true); return 0; @@ -142,9 +140,6 @@ void amdgpu_gtt_mgr_fini(struct amdgpu_device *adev) drm_mm_takedown(&mgr->mm); spin_unlock(&mgr->lock); - device_remove_file(adev->dev, &dev_attr_mem_info_gtt_total); - device_remove_file(adev->dev, &dev_attr_mem_info_gtt_used); - ttm_resource_manager_cleanup(man); ttm_set_driver_manager(&adev->mman.bdev, TTM_PL_TT, NULL); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index 2344aba9dca3..8543d6486018 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -152,7 +152,7 @@ static DEVICE_ATTR(mem_info_vis_vram_used, S_IRUGO, static DEVICE_ATTR(mem_info_vram_vendor, S_IRUGO, amdgpu_mem_info_vram_vendor, NULL); -static const struct attribute *amdgpu_vram_mgr_attributes[] = { +static struct attribute *amdgpu_vram_mgr_attributes[] = { &dev_attr_mem_info_vram_total.attr, &dev_attr_mem_info_vis_vram_total.attr, &dev_attr_mem_info_vram_used.attr, @@ -161,6 +161,10 @@ static const struct attribute *amdgpu_vram_mgr_attributes[] = { NULL }; +const struct attribute_group amdgpu_vram_mgr_attr_group = { + .attrs = amdgpu_vram_mgr_attributes +}; + static const struct ttm_resource_manager_func amdgpu_vram_mgr_func; /** @@ -174,7 +178,6 @@ int amdgpu_vram_mgr_init(struct amdgpu_device *adev) { struct amdgpu_vram_mgr *mgr = &adev->mman.vram_mgr; struct ttm_resource_manager *man = &mgr->manager; - int ret; ttm_resource_manager_init(man, adev->gmc.real_vram_size >> PAGE_SHIFT); @@ -185,11 +188,6 @@ int amdgpu_vram_mgr_init(struct amdgpu_device *adev) INIT_LIST_HEAD(&mgr->reservations_pending); INIT_LIST_HEAD(&mgr->reserved_pages); - /* Add the two VRAM-related sysfs files */ - ret = sysfs_create_files(&adev->dev->kobj, amdgpu_vram_mgr_attributes); - if (ret) - DRM_ERROR("Failed to register sysfs\n"); - ttm_set_driver_manager(&adev->mman.bdev, TTM_PL_VRAM, &mgr->manager); ttm_resource_manager_set_used(man, true); return 0; @@ -227,8 +225,6 @@ void amdgpu_vram_mgr_fini(struct amdgpu_device *adev) drm_mm_takedown(&mgr->mm); spin_unlock(&mgr->lock); - sysfs_remove_files(&adev->dev->kobj, amdgpu_vram_mgr_attributes); - ttm_resource_manager_cleanup(man); ttm_set_driver_manager(&adev->mman.bdev, TTM_PL_VRAM, NULL); }