[Intel-xe] [PATCH V3 3/3] drm/xe: Move device sysfs init out of xe_pm_init

Michal Wajdeczko michal.wajdeczko at intel.com
Tue Nov 28 16:28:27 UTC 2023



On 28.11.2023 16:13, Tejas Upadhyay wrote:
> Device sysfs needs to happen right after device probe.

.. sysfs _setup_ needs ...

> Currently it is under xe_pm_init() which does not look
> correct now as we add more sysfs entries which are not
> specific to PM.
> 
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>

can you send this patch separately from rest of UID changes ?
it doesn't seem to be connected to them

> ---
>  drivers/gpu/drm/xe/xe_device.c | 3 +++
>  drivers/gpu/drm/xe/xe_pm.c     | 5 +----
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index b54635d512d6..c8b592acb5b2 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -18,6 +18,7 @@
>  #include "regs/xe_regs.h"
>  #include "xe_bo.h"
>  #include "xe_debugfs.h"
> +#include "xe_device_sysfs.h"
>  #include "xe_display.h"
>  #include "xe_dma_buf.h"
>  #include "xe_drm_client.h"
> @@ -463,6 +464,8 @@ int xe_device_probe(struct xe_device *xe)
>  
>  	xe_hwmon_register(xe);
>  
> +	xe_device_sysfs_init(xe);

shouldn't we register generic xe sysfs little earlier?

OTOH it looks that today order is random:

	drm_dev_register(&xe->drm, 0);
	xe_display_register(xe);
	xe_debugfs_register(xe);
	xe_pmu_register(&xe->pmu);
	xe_hwmon_register(xe);

> +
>  	err = drmm_add_action_or_reset(&xe->drm, xe_device_sanitize, xe);
>  	if (err)
>  		return err;
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index e31a91cf311c..32009da9bfeb 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -13,7 +13,6 @@
>  #include "xe_bo.h"
>  #include "xe_bo_evict.h"
>  #include "xe_device.h"
> -#include "xe_device_sysfs.h"
>  #include "xe_display.h"
>  #include "xe_ggtt.h"
>  #include "xe_gt.h"
> @@ -175,10 +174,8 @@ void xe_pm_init(struct xe_device *xe)
>  
>  	xe->d3cold.capable = xe_pm_pci_d3cold_capable(pdev);
>  
> -	if (xe->d3cold.capable) {
> -		xe_device_sysfs_init(xe);
> +	if (xe->d3cold.capable)
>  		xe_pm_set_vram_threshold(xe, DEFAULT_VRAM_THRESHOLD);
> -	}
>  
>  	xe_pm_runtime_init(xe);
>  }


More information about the Intel-xe mailing list