* [PATCH 1/3] Revert "drm/amdgpu: fix a mistake when removing mem_info_preempt_used sysfs"
@ 2024-11-18 4:31 Jesse.zhang@amd.com
2024-11-18 4:31 ` [PATCH 2/3] Revert "drm/amdgpu: fix warning when removing sysfs" Jesse.zhang@amd.com
2024-11-18 4:31 ` [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging Jesse.zhang@amd.com
0 siblings, 2 replies; 6+ messages in thread
From: Jesse.zhang@amd.com @ 2024-11-18 4:31 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Christian Koenig, vitaly.prosyak, Tim.Huang,
Jesse.zhang@amd.com, Jesse Zhang
From: "Jesse.zhang@amd.com" <Jesse.zhang@amd.com>
This reverts commit 10aec8943bcc5123288ded8c97e78312bcf17fb1.
the dev->unplugged flag will also be set to true ,
Only uninstall the driver by amdgpu_exit, not actually unplug the device.
that will cause a new issue.
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
index 9a0346ed6ea4..33a714ddfbbc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
@@ -138,7 +138,7 @@ void amdgpu_preempt_mgr_fini(struct amdgpu_device *adev)
if (ret)
return;
- if (drm_dev_enter(adev_to_drm(adev), &idx)) {
+ if (!drm_dev_enter(adev_to_drm(adev), &idx)) {
device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
drm_dev_exit(idx);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] Revert "drm/amdgpu: fix warning when removing sysfs"
2024-11-18 4:31 [PATCH 1/3] Revert "drm/amdgpu: fix a mistake when removing mem_info_preempt_used sysfs" Jesse.zhang@amd.com
@ 2024-11-18 4:31 ` Jesse.zhang@amd.com
2024-11-18 4:31 ` [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging Jesse.zhang@amd.com
1 sibling, 0 replies; 6+ messages in thread
From: Jesse.zhang@amd.com @ 2024-11-18 4:31 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Christian Koenig, vitaly.prosyak, Tim.Huang,
Jesse.zhang@amd.com, Jesse Zhang
From: "Jesse.zhang@amd.com" <Jesse.zhang@amd.com>
This reverts commit 330d97e9b14e0c85cc8b63e0092e4abcb9ce99c8.
the dev->unplugged flag will also be set to true ,
Only uninstall the driver by amdgpu_exit,not actually unplug the device.
that will cause a new issue.
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 12 +++---------
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 10 ++--------
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 8 ++------
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 10 ++--------
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 9 ++-------
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 9 ++-------
drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 8 ++------
7 files changed, 15 insertions(+), 51 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index c65feb97167d..3c89c74d67e0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -25,7 +25,6 @@
#include <linux/firmware.h>
#include <linux/pm_runtime.h>
-#include <drm/drm_drv.h>
#include "amdgpu.h"
#include "amdgpu_gfx.h"
@@ -1779,14 +1778,9 @@ int amdgpu_gfx_sysfs_init(struct amdgpu_device *adev)
void amdgpu_gfx_sysfs_fini(struct amdgpu_device *adev)
{
- int idx;
-
- if (drm_dev_enter(adev_to_drm(adev), &idx)) {
- amdgpu_gfx_sysfs_xcp_fini(adev);
- amdgpu_gfx_sysfs_isolation_shader_fini(adev);
- amdgpu_gfx_sysfs_reset_mask_fini(adev);
- drm_dev_exit(idx);
- }
+ amdgpu_gfx_sysfs_xcp_fini(adev);
+ amdgpu_gfx_sysfs_isolation_shader_fini(adev);
+ amdgpu_gfx_sysfs_reset_mask_fini(adev);
}
int amdgpu_gfx_cleaner_shader_sw_init(struct amdgpu_device *adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
index bf4dbceb18e1..43ea76ebbad8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
@@ -24,7 +24,6 @@
*
*/
-#include <drm/drm_drv.h>
#include "amdgpu.h"
#include "amdgpu_jpeg.h"
#include "amdgpu_pm.h"
@@ -448,11 +447,6 @@ int amdgpu_jpeg_sysfs_reset_mask_init(struct amdgpu_device *adev)
void amdgpu_jpeg_sysfs_reset_mask_fini(struct amdgpu_device *adev)
{
- int idx;
-
- if (drm_dev_enter(adev_to_drm(adev), &idx)) {
- if (adev->jpeg.num_jpeg_inst)
- device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
- drm_dev_exit(idx);
- }
+ if (adev->jpeg.num_jpeg_inst)
+ device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
index 33a714ddfbbc..e8adfd0a570a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
@@ -23,7 +23,6 @@
* Authors: Christian König, Felix Kuehling
*/
-#include <drm/drm_drv.h>
#include "amdgpu.h"
/**
@@ -130,7 +129,7 @@ int amdgpu_preempt_mgr_init(struct amdgpu_device *adev)
void amdgpu_preempt_mgr_fini(struct amdgpu_device *adev)
{
struct ttm_resource_manager *man = &adev->mman.preempt_mgr;
- int idx, ret;
+ int ret;
ttm_resource_manager_set_used(man, false);
@@ -138,10 +137,7 @@ void amdgpu_preempt_mgr_fini(struct amdgpu_device *adev)
if (ret)
return;
- if (!drm_dev_enter(adev_to_drm(adev), &idx)) {
- device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
- drm_dev_exit(idx);
- }
+ device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
ttm_resource_manager_cleanup(man);
ttm_set_driver_manager(&adev->mman.bdev, AMDGPU_PL_PREEMPT, NULL);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
index 24e9daacaabb..8c89b69edc20 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
@@ -21,7 +21,6 @@
*
*/
-#include <drm/drm_drv.h>
#include <linux/firmware.h>
#include "amdgpu.h"
#include "amdgpu_sdma.h"
@@ -449,14 +448,9 @@ int amdgpu_sdma_sysfs_reset_mask_init(struct amdgpu_device *adev)
void amdgpu_sdma_sysfs_reset_mask_fini(struct amdgpu_device *adev)
{
- int idx;
-
if (!amdgpu_gpu_recovery)
return;
- if (drm_dev_enter(adev_to_drm(adev), &idx)) {
- if (adev->sdma.num_instances)
- device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
- drm_dev_exit(idx);
- }
+ if (adev->sdma.num_instances)
+ device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 25f490ad3a85..60e19052a1e2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -1310,11 +1310,6 @@ int amdgpu_vcn_sysfs_reset_mask_init(struct amdgpu_device *adev)
void amdgpu_vcn_sysfs_reset_mask_fini(struct amdgpu_device *adev)
{
- int idx;
-
- if (drm_dev_enter(adev_to_drm(adev), &idx)) {
- if (adev->vcn.num_vcn_inst)
- device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
- drm_dev_exit(idx);
- }
+ if (adev->vcn.num_vcn_inst)
+ device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
index b5f5a1a81c29..02bda187f982 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
@@ -904,13 +904,8 @@ int amdgpu_vpe_sysfs_reset_mask_init(struct amdgpu_device *adev)
void amdgpu_vpe_sysfs_reset_mask_fini(struct amdgpu_device *adev)
{
- int idx;
-
- if (drm_dev_enter(adev_to_drm(adev), &idx)) {
- if (adev->vpe.num_instances)
- device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
- drm_dev_exit(idx);
- }
+ if (adev->vpe.num_instances)
+ device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
}
static const struct amdgpu_ring_funcs vpe_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
index 54c05af2eed2..483a441b46aa 100644
--- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
+++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
@@ -20,7 +20,6 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
*/
-#include <drm/drm_drv.h>
#include "amdgpu.h"
#include "df_v3_6.h"
@@ -255,12 +254,9 @@ static void df_v3_6_sw_init(struct amdgpu_device *adev)
static void df_v3_6_sw_fini(struct amdgpu_device *adev)
{
- int idx;
- if (drm_dev_enter(adev_to_drm(adev), &idx)) {
- device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
- drm_dev_exit(idx);
- }
+ device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
+
}
static void df_v3_6_enable_broadcast_mode(struct amdgpu_device *adev,
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging
2024-11-18 4:31 [PATCH 1/3] Revert "drm/amdgpu: fix a mistake when removing mem_info_preempt_used sysfs" Jesse.zhang@amd.com
2024-11-18 4:31 ` [PATCH 2/3] Revert "drm/amdgpu: fix warning when removing sysfs" Jesse.zhang@amd.com
@ 2024-11-18 4:31 ` Jesse.zhang@amd.com
2024-11-18 5:16 ` Huang, Tim
2024-11-18 9:58 ` Christian König
1 sibling, 2 replies; 6+ messages in thread
From: Jesse.zhang@amd.com @ 2024-11-18 4:31 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Christian Koenig, vitaly.prosyak, Tim.Huang,
Jesse.zhang@amd.com, Andy Dong
Replace the check drm_dev_enter with sysfs directory entry.
Because the dev->unplugged flag will also be set to true,
Only uninstall the driver by amdgpu_exit, not actually unplug the device.
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Reported-by: Andy Dong <andy.dong@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 +++++---
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 6 ++++--
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 6 ++++--
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 6 ++++--
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++++--
drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 4 ++--
7 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 3c89c74d67e0..e54f42e3797e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -1778,9 +1778,11 @@ int amdgpu_gfx_sysfs_init(struct amdgpu_device *adev)
void amdgpu_gfx_sysfs_fini(struct amdgpu_device *adev)
{
- amdgpu_gfx_sysfs_xcp_fini(adev);
- amdgpu_gfx_sysfs_isolation_shader_fini(adev);
- amdgpu_gfx_sysfs_reset_mask_fini(adev);
+ if (adev->dev->kobj.sd) {
+ amdgpu_gfx_sysfs_xcp_fini(adev);
+ amdgpu_gfx_sysfs_isolation_shader_fini(adev);
+ amdgpu_gfx_sysfs_reset_mask_fini(adev);
+ }
}
int amdgpu_gfx_cleaner_shader_sw_init(struct amdgpu_device *adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
index 43ea76ebbad8..9a1a317d4fd9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
@@ -447,6 +447,8 @@ int amdgpu_jpeg_sysfs_reset_mask_init(struct amdgpu_device *adev)
void amdgpu_jpeg_sysfs_reset_mask_fini(struct amdgpu_device *adev)
{
- if (adev->jpeg.num_jpeg_inst)
- device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
+ if (adev->dev->kobj.sd) {
+ if (adev->jpeg.num_jpeg_inst)
+ device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
+ }
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
index e8adfd0a570a..34b5e22b44e5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
@@ -137,7 +137,8 @@ void amdgpu_preempt_mgr_fini(struct amdgpu_device *adev)
if (ret)
return;
- device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
+ if (adev->dev->kobj.sd)
+ device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
ttm_resource_manager_cleanup(man);
ttm_set_driver_manager(&adev->mman.bdev, AMDGPU_PL_PREEMPT, NULL);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
index 8c89b69edc20..113f0d242618 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
@@ -451,6 +451,8 @@ void amdgpu_sdma_sysfs_reset_mask_fini(struct amdgpu_device *adev)
if (!amdgpu_gpu_recovery)
return;
- if (adev->sdma.num_instances)
- device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
+ if (adev->dev->kobj.sd) {
+ if (adev->sdma.num_instances)
+ device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
+ }
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 60e19052a1e2..ed9c795e7b35 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -1310,6 +1310,8 @@ int amdgpu_vcn_sysfs_reset_mask_init(struct amdgpu_device *adev)
void amdgpu_vcn_sysfs_reset_mask_fini(struct amdgpu_device *adev)
{
- if (adev->vcn.num_vcn_inst)
- device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
+ if (adev->dev->kobj.sd) {
+ if (adev->vcn.num_vcn_inst)
+ device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
+ }
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
index 02bda187f982..dc96e81235df 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
@@ -904,8 +904,10 @@ int amdgpu_vpe_sysfs_reset_mask_init(struct amdgpu_device *adev)
void amdgpu_vpe_sysfs_reset_mask_fini(struct amdgpu_device *adev)
{
- if (adev->vpe.num_instances)
- device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
+ if (adev->dev->kobj.sd) {
+ if (adev->vpe.num_instances)
+ device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
+ }
}
static const struct amdgpu_ring_funcs vpe_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
index 483a441b46aa..621aeca53880 100644
--- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
+++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
@@ -254,8 +254,8 @@ static void df_v3_6_sw_init(struct amdgpu_device *adev)
static void df_v3_6_sw_fini(struct amdgpu_device *adev)
{
-
- device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
+ if (adev->dev->kobj.sd)
+ device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging
2024-11-18 4:31 ` [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging Jesse.zhang@amd.com
@ 2024-11-18 5:16 ` Huang, Tim
2024-11-18 9:58 ` Christian König
1 sibling, 0 replies; 6+ messages in thread
From: Huang, Tim @ 2024-11-18 5:16 UTC (permalink / raw)
To: Zhang, Jesse(Jie), amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander, Koenig, Christian, Prosyak, Vitaly,
Zhang, Jesse(Jie), Dong, Andy
[Public]
Hi Jesse,
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Jesse.zhang@amd.com
> Sent: Monday, November 18, 2024 12:31 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Prosyak, Vitaly <Vitaly.Prosyak@amd.com>;
> Huang, Tim <Tim.Huang@amd.com>; Zhang, Jesse(Jie)
> <Jesse.Zhang@amd.com>; Dong, Andy <Andy.Dong@amd.com>
> Subject: [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging
>
> Replace the check drm_dev_enter with sysfs directory entry.
> Because the dev->unplugged flag will also be set to true, Only uninstall the
> driver by amdgpu_exit, not actually unplug the device.
I am okay with this patch. If I recall correctly, this fixes a warning when running IGT tests? It would be helpful to add the comment specifying the types of warnings and the test cases that trigger them.
Best Regards,
Tim Huang
>
> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
> Reported-by: Andy Dong <andy.dong@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 +++++---
> drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 4 ++--
> 7 files changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index 3c89c74d67e0..e54f42e3797e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> @@ -1778,9 +1778,11 @@ int amdgpu_gfx_sysfs_init(struct amdgpu_device
> *adev)
>
> void amdgpu_gfx_sysfs_fini(struct amdgpu_device *adev) {
> - amdgpu_gfx_sysfs_xcp_fini(adev);
> - amdgpu_gfx_sysfs_isolation_shader_fini(adev);
> - amdgpu_gfx_sysfs_reset_mask_fini(adev);
> + if (adev->dev->kobj.sd) {
> + amdgpu_gfx_sysfs_xcp_fini(adev);
> + amdgpu_gfx_sysfs_isolation_shader_fini(adev);
> + amdgpu_gfx_sysfs_reset_mask_fini(adev);
> + }
> }
>
> int amdgpu_gfx_cleaner_shader_sw_init(struct amdgpu_device *adev, diff
> --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> index 43ea76ebbad8..9a1a317d4fd9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> @@ -447,6 +447,8 @@ int amdgpu_jpeg_sysfs_reset_mask_init(struct
> amdgpu_device *adev)
>
> void amdgpu_jpeg_sysfs_reset_mask_fini(struct amdgpu_device *adev) {
> - if (adev->jpeg.num_jpeg_inst)
> - device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->jpeg.num_jpeg_inst)
> + device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
> + }
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> index e8adfd0a570a..34b5e22b44e5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> @@ -137,7 +137,8 @@ void amdgpu_preempt_mgr_fini(struct
> amdgpu_device *adev)
> if (ret)
> return;
>
> - device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
> + if (adev->dev->kobj.sd)
> + device_remove_file(adev->dev,
> &dev_attr_mem_info_preempt_used);
>
> ttm_resource_manager_cleanup(man);
> ttm_set_driver_manager(&adev->mman.bdev, AMDGPU_PL_PREEMPT,
> NULL); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> index 8c89b69edc20..113f0d242618 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> @@ -451,6 +451,8 @@ void amdgpu_sdma_sysfs_reset_mask_fini(struct
> amdgpu_device *adev)
> if (!amdgpu_gpu_recovery)
> return;
>
> - if (adev->sdma.num_instances)
> - device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->sdma.num_instances)
> + device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
> + }
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 60e19052a1e2..ed9c795e7b35 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -1310,6 +1310,8 @@ int amdgpu_vcn_sysfs_reset_mask_init(struct
> amdgpu_device *adev)
>
> void amdgpu_vcn_sysfs_reset_mask_fini(struct amdgpu_device *adev) {
> - if (adev->vcn.num_vcn_inst)
> - device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->vcn.num_vcn_inst)
> + device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
> + }
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> index 02bda187f982..dc96e81235df 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> @@ -904,8 +904,10 @@ int amdgpu_vpe_sysfs_reset_mask_init(struct
> amdgpu_device *adev)
>
> void amdgpu_vpe_sysfs_reset_mask_fini(struct amdgpu_device *adev) {
> - if (adev->vpe.num_instances)
> - device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->vpe.num_instances)
> + device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
> + }
> }
>
> static const struct amdgpu_ring_funcs vpe_ring_funcs = { diff --git
> a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> index 483a441b46aa..621aeca53880 100644
> --- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> +++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> @@ -254,8 +254,8 @@ static void df_v3_6_sw_init(struct amdgpu_device
> *adev)
>
> static void df_v3_6_sw_fini(struct amdgpu_device *adev) {
> -
> - device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
> + if (adev->dev->kobj.sd)
> + device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
>
> }
>
> --
> 2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging
2024-11-18 4:31 ` [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging Jesse.zhang@amd.com
2024-11-18 5:16 ` Huang, Tim
@ 2024-11-18 9:58 ` Christian König
2024-11-19 1:19 ` Zhang, Jesse(Jie)
1 sibling, 1 reply; 6+ messages in thread
From: Christian König @ 2024-11-18 9:58 UTC (permalink / raw)
To: Jesse.zhang@amd.com, amd-gfx
Cc: Alexander.Deucher, vitaly.prosyak, Tim.Huang, Andy Dong
Am 18.11.24 um 05:31 schrieb Jesse.zhang@amd.com:
> Replace the check drm_dev_enter with sysfs directory entry.
> Because the dev->unplugged flag will also be set to true,
> Only uninstall the driver by amdgpu_exit, not actually unplug the device.
Clearly a NAK to this one. This looks strongly like you are just working
around the issue that the functions are called twice.
What exactly is going on here?
Regards,
Christian.
>
> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
> Reported-by: Andy Dong <andy.dong@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 +++++---
> drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 4 ++--
> 7 files changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index 3c89c74d67e0..e54f42e3797e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> @@ -1778,9 +1778,11 @@ int amdgpu_gfx_sysfs_init(struct amdgpu_device *adev)
>
> void amdgpu_gfx_sysfs_fini(struct amdgpu_device *adev)
> {
> - amdgpu_gfx_sysfs_xcp_fini(adev);
> - amdgpu_gfx_sysfs_isolation_shader_fini(adev);
> - amdgpu_gfx_sysfs_reset_mask_fini(adev);
> + if (adev->dev->kobj.sd) {
> + amdgpu_gfx_sysfs_xcp_fini(adev);
> + amdgpu_gfx_sysfs_isolation_shader_fini(adev);
> + amdgpu_gfx_sysfs_reset_mask_fini(adev);
> + }
> }
>
> int amdgpu_gfx_cleaner_shader_sw_init(struct amdgpu_device *adev,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> index 43ea76ebbad8..9a1a317d4fd9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> @@ -447,6 +447,8 @@ int amdgpu_jpeg_sysfs_reset_mask_init(struct amdgpu_device *adev)
>
> void amdgpu_jpeg_sysfs_reset_mask_fini(struct amdgpu_device *adev)
> {
> - if (adev->jpeg.num_jpeg_inst)
> - device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->jpeg.num_jpeg_inst)
> + device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
> + }
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> index e8adfd0a570a..34b5e22b44e5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> @@ -137,7 +137,8 @@ void amdgpu_preempt_mgr_fini(struct amdgpu_device *adev)
> if (ret)
> return;
>
> - device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
> + if (adev->dev->kobj.sd)
> + device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
>
> ttm_resource_manager_cleanup(man);
> ttm_set_driver_manager(&adev->mman.bdev, AMDGPU_PL_PREEMPT, NULL);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> index 8c89b69edc20..113f0d242618 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> @@ -451,6 +451,8 @@ void amdgpu_sdma_sysfs_reset_mask_fini(struct amdgpu_device *adev)
> if (!amdgpu_gpu_recovery)
> return;
>
> - if (adev->sdma.num_instances)
> - device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->sdma.num_instances)
> + device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
> + }
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 60e19052a1e2..ed9c795e7b35 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -1310,6 +1310,8 @@ int amdgpu_vcn_sysfs_reset_mask_init(struct amdgpu_device *adev)
>
> void amdgpu_vcn_sysfs_reset_mask_fini(struct amdgpu_device *adev)
> {
> - if (adev->vcn.num_vcn_inst)
> - device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->vcn.num_vcn_inst)
> + device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
> + }
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> index 02bda187f982..dc96e81235df 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> @@ -904,8 +904,10 @@ int amdgpu_vpe_sysfs_reset_mask_init(struct amdgpu_device *adev)
>
> void amdgpu_vpe_sysfs_reset_mask_fini(struct amdgpu_device *adev)
> {
> - if (adev->vpe.num_instances)
> - device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->vpe.num_instances)
> + device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
> + }
> }
>
> static const struct amdgpu_ring_funcs vpe_ring_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> index 483a441b46aa..621aeca53880 100644
> --- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> +++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> @@ -254,8 +254,8 @@ static void df_v3_6_sw_init(struct amdgpu_device *adev)
>
> static void df_v3_6_sw_fini(struct amdgpu_device *adev)
> {
> -
> - device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
> + if (adev->dev->kobj.sd)
> + device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
>
> }
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging
2024-11-18 9:58 ` Christian König
@ 2024-11-19 1:19 ` Zhang, Jesse(Jie)
0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Jesse(Jie) @ 2024-11-19 1:19 UTC (permalink / raw)
To: Koenig, Christian, amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander, Prosyak, Vitaly, Huang, Tim, Dong, Andy
[AMD Official Use Only - AMD Internal Distribution Only]
-----Original Message-----
From: Koenig, Christian <Christian.Koenig@amd.com>
Sent: Monday, November 18, 2024 5:58 PM
To: Zhang, Jesse(Jie) <Jesse.Zhang@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Prosyak, Vitaly <Vitaly.Prosyak@amd.com>; Huang, Tim <Tim.Huang@amd.com>; Dong, Andy <Andy.Dong@amd.com>
Subject: Re: [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging
Am 18.11.24 um 05:31 schrieb Jesse.zhang@amd.com:
> Replace the check drm_dev_enter with sysfs directory entry.
> Because the dev->unplugged flag will also be set to true, Only
> uninstall the driver by amdgpu_exit, not actually unplug the device.
Clearly a NAK to this one. This looks strongly like you are just working around the issue that the functions are called twice.
What exactly is going on here?
This warning occurs when running hotplug tests in IGT.
When a device is unplugged, the PCI bus removes the device.
Then uninstall the amdgpu driver, and many similar warnings will be reported.
There is V2 about the is patch and update the details in comments.
Thanks
Jesse
Regards,
Christian.
>
> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
> Reported-by: Andy Dong <andy.dong@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 +++++---
> drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 4 ++--
> 7 files changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index 3c89c74d67e0..e54f42e3797e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> @@ -1778,9 +1778,11 @@ int amdgpu_gfx_sysfs_init(struct amdgpu_device
> *adev)
>
> void amdgpu_gfx_sysfs_fini(struct amdgpu_device *adev)
> {
> - amdgpu_gfx_sysfs_xcp_fini(adev);
> - amdgpu_gfx_sysfs_isolation_shader_fini(adev);
> - amdgpu_gfx_sysfs_reset_mask_fini(adev);
> + if (adev->dev->kobj.sd) {
> + amdgpu_gfx_sysfs_xcp_fini(adev);
> + amdgpu_gfx_sysfs_isolation_shader_fini(adev);
> + amdgpu_gfx_sysfs_reset_mask_fini(adev);
> + }
> }
>
> int amdgpu_gfx_cleaner_shader_sw_init(struct amdgpu_device *adev,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> index 43ea76ebbad8..9a1a317d4fd9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
> @@ -447,6 +447,8 @@ int amdgpu_jpeg_sysfs_reset_mask_init(struct
> amdgpu_device *adev)
>
> void amdgpu_jpeg_sysfs_reset_mask_fini(struct amdgpu_device *adev)
> {
> - if (adev->jpeg.num_jpeg_inst)
> - device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->jpeg.num_jpeg_inst)
> + device_remove_file(adev->dev, &dev_attr_jpeg_reset_mask);
> + }
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> index e8adfd0a570a..34b5e22b44e5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> @@ -137,7 +137,8 @@ void amdgpu_preempt_mgr_fini(struct amdgpu_device *adev)
> if (ret)
> return;
>
> - device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
> + if (adev->dev->kobj.sd)
> + device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
>
> ttm_resource_manager_cleanup(man);
> ttm_set_driver_manager(&adev->mman.bdev, AMDGPU_PL_PREEMPT, NULL);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> index 8c89b69edc20..113f0d242618 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
> @@ -451,6 +451,8 @@ void amdgpu_sdma_sysfs_reset_mask_fini(struct amdgpu_device *adev)
> if (!amdgpu_gpu_recovery)
> return;
>
> - if (adev->sdma.num_instances)
> - device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->sdma.num_instances)
> + device_remove_file(adev->dev, &dev_attr_sdma_reset_mask);
> + }
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 60e19052a1e2..ed9c795e7b35 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -1310,6 +1310,8 @@ int amdgpu_vcn_sysfs_reset_mask_init(struct
> amdgpu_device *adev)
>
> void amdgpu_vcn_sysfs_reset_mask_fini(struct amdgpu_device *adev)
> {
> - if (adev->vcn.num_vcn_inst)
> - device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->vcn.num_vcn_inst)
> + device_remove_file(adev->dev, &dev_attr_vcn_reset_mask);
> + }
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> index 02bda187f982..dc96e81235df 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> @@ -904,8 +904,10 @@ int amdgpu_vpe_sysfs_reset_mask_init(struct
> amdgpu_device *adev)
>
> void amdgpu_vpe_sysfs_reset_mask_fini(struct amdgpu_device *adev)
> {
> - if (adev->vpe.num_instances)
> - device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
> + if (adev->dev->kobj.sd) {
> + if (adev->vpe.num_instances)
> + device_remove_file(adev->dev, &dev_attr_vpe_reset_mask);
> + }
> }
>
> static const struct amdgpu_ring_funcs vpe_ring_funcs = { diff --git
> a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> index 483a441b46aa..621aeca53880 100644
> --- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> +++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> @@ -254,8 +254,8 @@ static void df_v3_6_sw_init(struct amdgpu_device
> *adev)
>
> static void df_v3_6_sw_fini(struct amdgpu_device *adev)
> {
> -
> - device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
> + if (adev->dev->kobj.sd)
> + device_remove_file(adev->dev, &dev_attr_df_cntr_avail);
>
> }
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-11-19 1:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18 4:31 [PATCH 1/3] Revert "drm/amdgpu: fix a mistake when removing mem_info_preempt_used sysfs" Jesse.zhang@amd.com
2024-11-18 4:31 ` [PATCH 2/3] Revert "drm/amdgpu: fix warning when removing sysfs" Jesse.zhang@amd.com
2024-11-18 4:31 ` [PATCH 3/3] drm/amdgpu: Fix sysfs warning when hotplugging Jesse.zhang@amd.com
2024-11-18 5:16 ` Huang, Tim
2024-11-18 9:58 ` Christian König
2024-11-19 1:19 ` Zhang, Jesse(Jie)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox