[PATCH] drm/xe: Default auto_link_downgrade status to false
Upadhyay, Tejas
tejas.upadhyay at intel.com
Fri May 16 10:22:35 UTC 2025
> -----Original Message-----
> From: Bhatia, Aradhya <aradhya.bhatia at intel.com>
> Sent: 16 May 2025 14:53
> To: Roper, Matthew D <matthew.d.roper at intel.com>
> Cc: Intel XE List <intel-xe at lists.freedesktop.org>; Upadhyay, Tejas
> <tejas.upadhyay at intel.com>; Bhatia, Aradhya <aradhya.bhatia at intel.com>
> Subject: [PATCH] drm/xe: Default auto_link_downgrade status to false
>
> xe_pcode_read() can return back successfully without updating the variable
> 'val'. This can cause an arbitrary value to show up in the sysfs file. This
> concern was flagged by the coverity static analysis tool.
concern was flagged by the static code analysis tool.
>
> ALlow the auto_link_downgrade_status to default to 0 to avoid any such
> complication.
>
> Fixes: 0e414bf7ad01 ("drm/xe: Expose PCIe link downgrade attributes")
> Signed-off-by: Aradhya Bhatia <aradhya.bhatia at intel.com>
> ---
> drivers/gpu/drm/xe/xe_device_sysfs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c
> b/drivers/gpu/drm/xe/xe_device_sysfs.c
> index 9628e9a0a0af..2e657692e5b5 100644
> --- a/drivers/gpu/drm/xe/xe_device_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
> @@ -124,7 +124,8 @@ auto_link_downgrade_status_show(struct device
> *dev, struct device_attribute *att {
> struct pci_dev *pdev = to_pci_dev(dev);
> struct xe_device *xe = pdev_to_xe_device(pdev);
> - u32 val;
> + /* default the auto_link_downgrade status to 0 */
> + u32 val = 0;
Apart from above comment, LGTM,
Reviewed-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
Tejas
> int ret;
>
> xe_pm_runtime_get(xe);
>
> base-commit: bf8c2c7bea6b5a38b6a3c24fdfc72b1ab5c03c28
> --
> 2.43.0
More information about the Intel-xe
mailing list