From: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: <prashanth.kumar@intel.com>, <dnyaneshwar.bhadane@intel.com>,
"Michal Wajdeczko" <michal.wajdeczko@intel.com>,
John Harrison <John.C.Harrison@Intel.com>
Subject: Re: [PATCH v3 13/13] drm/xe/configfs: Dump custom settings when binding
Date: Thu, 14 Aug 2025 17:48:25 -0700 [thread overview]
Message-ID: <9a3a4f35-51f4-42dd-bd4b-3b46e50de170@intel.com> (raw)
In-Reply-To: <20250808-psmi-v3-13-a111e9f1e4b7@intel.com>
On 8/8/2025 10:29 AM, Lucas De Marchi wrote:
> Device configuration using configfs could be prepared long time prior
> the driver load. Currently all the xe configfs entries are for things
> that are important to have in the log if a non-default value is being
> used. Add a info-level message about that with the individual entries
> that are different than the default.
>
> Based on previous patch by Michal Wajdeczko.
>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_configfs.c | 39 +++++++++++++++++++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_configfs.h | 2 ++
> drivers/gpu/drm/xe/xe_pci.c | 3 +++
> 3 files changed, 44 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c
> index 3b9d24c0bb588..9a283b713ff9d 100644
> --- a/drivers/gpu/drm/xe/xe_configfs.c
> +++ b/drivers/gpu/drm/xe/xe_configfs.c
> @@ -480,6 +480,45 @@ static struct xe_config_group_device *find_xe_config_group_device(struct pci_dev
> return to_xe_config_group_device(item);
> }
>
> +static void dump_custom_dev_config(struct pci_dev *pdev,
> + struct xe_config_group_device *dev)
> +{
> +#define PRI_CUSTOM_ATTR(fmt_, attr_) do { \
> + if (dev->config.attr_ != device_defaults.attr_) \
> + pci_info(pdev, "configfs: " __stringify(attr_) " = " fmt_ "\n", \
> + dev->config.attr_); \
> + } while (0)
> +
> + PRI_CUSTOM_ATTR("%llx", engines_allowed);
> + PRI_CUSTOM_ATTR("%d", enable_psmi);
> + PRI_CUSTOM_ATTR("%d", survivability_mode);
> +
> +#undef PRI_CUSTOM_ATTR
> +}
> +
> +/**
> + * xe_configfs_check_device() - Test if device was configured by configfs
> + * @pdev: the &pci_dev device to test
> + *
> + * Try to find the configfs group that belongs to the specified pci device
> + * and print a diagnostic message if found.
We print only if custom ones are found right? Not otherwise.
> + */
> +void xe_configfs_check_device(struct pci_dev *pdev)
> +{
> + struct xe_config_group_device *dev = find_xe_config_group_device(pdev);
> +
> + if (!dev)
> + return;
> +
> + /* memcmp here is safe as both as zero-initialized */
s/as/are?
With the above nits resolved,
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
> + if (memcmp(&dev->config, &device_defaults, sizeof(dev->config))) {
> + pci_info(pdev, "Found custom settings in configfs\n");
> + dump_custom_dev_config(pdev, dev);
> + }
> +
> + config_group_put(&dev->group);
> +}
> +
> /**
> * xe_configfs_get_survivability_mode - get configfs survivability mode attribute
> * @pdev: pci device
> diff --git a/drivers/gpu/drm/xe/xe_configfs.h b/drivers/gpu/drm/xe/xe_configfs.h
> index 603dd7796c8b2..58c8c31640008 100644
> --- a/drivers/gpu/drm/xe/xe_configfs.h
> +++ b/drivers/gpu/drm/xe/xe_configfs.h
> @@ -13,6 +13,7 @@ struct pci_dev;
> #if IS_ENABLED(CONFIG_CONFIGFS_FS)
> int xe_configfs_init(void);
> void xe_configfs_exit(void);
> +void xe_configfs_check_device(struct pci_dev *pdev);
> bool xe_configfs_get_survivability_mode(struct pci_dev *pdev);
> void xe_configfs_clear_survivability_mode(struct pci_dev *pdev);
> u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev);
> @@ -20,6 +21,7 @@ bool xe_configfs_get_psmi_enabled(struct pci_dev *pdev);
> #else
> static inline int xe_configfs_init(void) { return 0; }
> static inline void xe_configfs_exit(void) { }
> +static inline void xe_configfs_check_device(struct pci_dev *pdev) { }
> static inline bool xe_configfs_get_survivability_mode(struct pci_dev *pdev) { return false; }
> static inline void xe_configfs_clear_survivability_mode(struct pci_dev *pdev) { }
> static inline u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev) { return U64_MAX; }
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 52d46c66ae1eb..9ce6e6dca5bc7 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -17,6 +17,7 @@
>
> #include "display/xe_display.h"
> #include "regs/xe_gt_regs.h"
> +#include "xe_configfs.h"
> #include "xe_device.h"
> #include "xe_drv.h"
> #include "xe_gt.h"
> @@ -771,6 +772,8 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> struct xe_device *xe;
> int err;
>
> + xe_configfs_check_device(pdev);
> +
> if (desc->require_force_probe && !id_forced(pdev->device)) {
> dev_info(&pdev->dev,
> "Your graphics device %04x is not officially supported\n"
>
prev parent reply other threads:[~2025-08-15 0:48 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-08 17:29 [PATCH v3 00/13] drm/xe: Add psmi support Lucas De Marchi
2025-08-08 17:29 ` [PATCH v3 01/13] drm/xe/psmi: Add GuC flag to enable PSMI Lucas De Marchi
2025-08-13 0:38 ` Belgaumkar, Vinay
2025-08-15 21:34 ` Lucas De Marchi
2025-08-08 17:29 ` [PATCH v3 02/13] drm/xe/psmi: Add debugfs interface for PSMI Lucas De Marchi
2025-08-13 1:41 ` Belgaumkar, Vinay
2025-08-13 10:42 ` Matthew Auld
2025-08-15 21:35 ` Lucas De Marchi
2025-08-08 17:29 ` [PATCH v3 03/13] drm/xe/rtp: Add match for psmi Lucas De Marchi
2025-08-14 21:28 ` Belgaumkar, Vinay
2025-08-08 17:29 ` [PATCH v3 04/13] drm/xe/psmi: Add Wa_14020001231 Lucas De Marchi
2025-08-13 17:44 ` Riana Tauro
2025-08-14 11:13 ` Lucas De Marchi
2025-08-08 17:29 ` [PATCH v3 05/13] drm/xe/psmi: Add Wa_16023683509 Lucas De Marchi
2025-08-13 11:15 ` Bhadane, Dnyaneshwar
2025-08-08 17:29 ` [PATCH v3 06/13] drm/xe/configfs: Simplify kernel doc Lucas De Marchi
2025-08-13 6:23 ` Riana Tauro
2025-08-08 17:29 ` [PATCH v3 07/13] drm/xe/configfs: Allow to enable PSMI Lucas De Marchi
2025-08-13 6:58 ` Riana Tauro
2025-08-13 11:23 ` Lucas De Marchi
2025-08-13 17:38 ` Riana Tauro
2025-08-08 17:29 ` [PATCH v3 08/13] drm/xe/configfs: Use guard() for dev->lock Lucas De Marchi
2025-08-12 10:23 ` Bhadane, Dnyaneshwar
2025-08-08 17:29 ` [PATCH v3 09/13] drm/xe/configfs: Block runtime attribute changes Lucas De Marchi
2025-08-13 11:03 ` Riana Tauro
2025-08-08 17:29 ` [PATCH v3 10/13] drm/xe/configfs: Use tree-like output in documentation Lucas De Marchi
2025-08-14 21:31 ` Bhadane, Dnyaneshwar
2025-08-08 17:29 ` [PATCH v3 11/13] drm/xe/configfs: Improve documentation steps Lucas De Marchi
2025-08-13 11:08 ` Riana Tauro
2025-08-08 17:29 ` [PATCH v3 12/13] drm/xe/configfs: Minor fixes to documentation Lucas De Marchi
2025-08-12 10:24 ` Bhadane, Dnyaneshwar
2025-08-08 17:29 ` [PATCH v3 13/13] drm/xe/configfs: Dump custom settings when binding Lucas De Marchi
2025-08-15 0:48 ` Belgaumkar, Vinay [this message]
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=9a3a4f35-51f4-42dd-bd4b-3b46e50de170@intel.com \
--to=vinay.belgaumkar@intel.com \
--cc=John.C.Harrison@Intel.com \
--cc=dnyaneshwar.bhadane@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=michal.wajdeczko@intel.com \
--cc=prashanth.kumar@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.