From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Riana Tauro <riana.tauro@intel.com>
Cc: Raag Jadav <raag.jadav@intel.com>, <lucas.demarchi@intel.com>,
<intel-xe@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
<badal.nilawar@intel.com>
Subject: Re: [PATCH v7 1/3] drm/xe: Move xe_device_sysfs_init() to xe_device_probe()
Date: Wed, 7 May 2025 15:32:25 -0400 [thread overview]
Message-ID: <aBu1SVfzSXA_h0UM@intel.com> (raw)
In-Reply-To: <cc1d7661-22db-447b-b90f-689e939b5727@intel.com>
On Wed, May 07, 2025 at 10:20:23AM +0530, Riana Tauro wrote:
>
>
> On 5/6/2025 11:18 AM, Raag Jadav wrote:
> > Since xe_device_sysfs_init() exposes device specific attributes, a better
> > place for it is xe_device_probe().
>
> Looks good to me
> Reviewed-by: Riana Tauro <riana.tauro@intel.com>
pushed to drm-xe-next. thanks for the patches, reviews and the patience!
>
>
> >
> > Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> > ---
> > drivers/gpu/drm/xe/xe_device.c | 5 +++++
> > drivers/gpu/drm/xe/xe_device_sysfs.c | 11 +++++++----
> > drivers/gpu/drm/xe/xe_pm.c | 8 +-------
> > 3 files changed, 13 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> > index 6c9d3009aa03..79b7b0ecfbae 100644
> > --- a/drivers/gpu/drm/xe/xe_device.c
> > +++ b/drivers/gpu/drm/xe/xe_device.c
> > @@ -26,6 +26,7 @@
> > #include "xe_bo_evict.h"
> > #include "xe_debugfs.h"
> > #include "xe_devcoredump.h"
> > +#include "xe_device_sysfs.h"
> > #include "xe_dma_buf.h"
> > #include "xe_drm_client.h"
> > #include "xe_drv.h"
> > @@ -916,6 +917,10 @@ int xe_device_probe(struct xe_device *xe)
> > if (err)
> > goto err_unregister_display;
> > + err = xe_device_sysfs_init(xe);
> > + if (err)
> > + goto err_unregister_display;
> > +
> > xe_debugfs_register(xe);
> > err = xe_hwmon_register(xe);
> > diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c
> > index 7efbd4c52791..d4c73acea1cf 100644
> > --- a/drivers/gpu/drm/xe/xe_device_sysfs.c
> > +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
> > @@ -67,7 +67,8 @@ static void xe_device_sysfs_fini(void *arg)
> > {
> > struct xe_device *xe = arg;
> > - sysfs_remove_file(&xe->drm.dev->kobj, &dev_attr_vram_d3cold_threshold.attr);
> > + if (xe->d3cold.capable)
> > + sysfs_remove_file(&xe->drm.dev->kobj, &dev_attr_vram_d3cold_threshold.attr);
> > }
> > int xe_device_sysfs_init(struct xe_device *xe)
> > @@ -75,9 +76,11 @@ int xe_device_sysfs_init(struct xe_device *xe)
> > struct device *dev = xe->drm.dev;
> > int ret;
> > - ret = sysfs_create_file(&dev->kobj, &dev_attr_vram_d3cold_threshold.attr);
> > - if (ret)
> > - return ret;
> > + if (xe->d3cold.capable) {
> > + ret = sysfs_create_file(&dev->kobj, &dev_attr_vram_d3cold_threshold.attr);
> > + if (ret)
> > + return ret;
> > + }
> > return devm_add_action_or_reset(dev, xe_device_sysfs_fini, xe);
> > }
> > diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> > index 38514cef817e..693866def183 100644
> > --- a/drivers/gpu/drm/xe/xe_pm.c
> > +++ b/drivers/gpu/drm/xe/xe_pm.c
> > @@ -16,7 +16,6 @@
> > #include "xe_bo.h"
> > #include "xe_bo_evict.h"
> > #include "xe_device.h"
> > -#include "xe_device_sysfs.h"
> > #include "xe_ggtt.h"
> > #include "xe_gt.h"
> > #include "xe_guc.h"
> > @@ -273,6 +272,7 @@ int xe_pm_init_early(struct xe_device *xe)
> > if (err)
> > return err;
> > + xe->d3cold.capable = xe_pm_pci_d3cold_capable(xe);
> > return 0;
> > }
> > ALLOW_ERROR_INJECTION(xe_pm_init_early, ERRNO); /* See xe_pci_probe() */
> > @@ -344,13 +344,7 @@ int xe_pm_init(struct xe_device *xe)
> > if (!xe_device_uc_enabled(xe))
> > return 0;
> > - xe->d3cold.capable = xe_pm_pci_d3cold_capable(xe);
> > -
> > if (xe->d3cold.capable) {
> > - err = xe_device_sysfs_init(xe);
> > - if (err)
> > - goto err_unregister;
> > -
> > vram_threshold = vram_threshold_value(xe);
> > err = xe_pm_set_vram_threshold(xe, vram_threshold);
> > if (err)
> Lo
next prev parent reply other threads:[~2025-05-07 19:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 5:48 [PATCH v7 0/3] BMG PCIe link downgrade attributes and usage Raag Jadav
2025-05-06 5:48 ` [PATCH v7 1/3] drm/xe: Move xe_device_sysfs_init() to xe_device_probe() Raag Jadav
2025-05-07 4:50 ` Riana Tauro
2025-05-07 19:32 ` Rodrigo Vivi [this message]
2025-05-06 5:48 ` [PATCH v7 2/3] drm/xe: Expose PCIe link downgrade attributes Raag Jadav
2025-05-06 5:48 ` [PATCH v7 3/3] drm/xe/doc: Wire up PCIe Gen5 limitations Raag Jadav
2025-05-06 5:55 ` ✓ CI.Patch_applied: success for BMG PCIe link downgrade attributes and usage Patchwork
2025-05-06 5:56 ` ✓ CI.checkpatch: " Patchwork
2025-05-06 5:57 ` ✓ CI.KUnit: " Patchwork
2025-05-06 6:05 ` ✓ CI.Build: " Patchwork
2025-05-06 6:08 ` ✓ CI.Hooks: " Patchwork
2025-05-06 6:09 ` ✓ CI.checksparse: " Patchwork
2025-05-06 7:00 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-06 8:35 ` ✓ Xe.CI.Full: " Patchwork
2025-05-26 15:50 ` ✗ CI.Patch_applied: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aBu1SVfzSXA_h0UM@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=raag.jadav@intel.com \
--cc=riana.tauro@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.