From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Zongyao Bai <zongyao.bai@intel.com>, <intel-xe@lists.freedesktop.org>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
Stuart Summers <stuart.summers@intel.com>,
Shuicheng Lin <shuicheng.lin@intel.com>
Subject: Re: [PATCH v3 1/2] drm/xe/xe_device_sysfs: Add cleanup action in xe_device_sysfs_init
Date: Tue, 16 Sep 2025 16:29:50 +0200 [thread overview]
Message-ID: <d2a38554-c096-430f-a289-0fb2e299b688@intel.com> (raw)
In-Reply-To: <20250915214716.1327379-2-zongyao.bai@intel.com>
Hi,
I guess you need to modify the subject to something like:
"drm/xe/sysfs: ..."
On 9/15/2025 11:47 PM, Zongyao Bai wrote:
> xe_device_sysfs_init(): on partial failure, any sysfs files created
> before the failure will be cleaned up via xe_device_sysfs_fini,
> ensuring no leaked sysfs entries.
IMO this should be rephrased into something like:
"On partial failure, some sysfs files created before the failure might
not be removed. Add common cleanup step to remove them all immediately,
as is should be harmless to attempt to remove non-existing files."
see https://docs.kernel.org/process/submitting-patches.html#describe-your-changes
>
> v2: Using "goto cleanup" to reduced code duplication.(Stuart)
>
> v3: Split patch & remove unnecessary notes (Lucas)
> Adjust the comments accordingly.
>
> Fixes: 0e414bf7ad01 ("drm/xe: Expose PCIe link downgrade attributes")
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Stuart Summers <stuart.summers@intel.com>
> Cc: Shuicheng Lin <shuicheng.lin@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Zongyao Bai <zongyao.bai@intel.com>
> ---
> drivers/gpu/drm/xe/xe_device_sysfs.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c
> index 6ee422594b56..e5e3c56ea53c 100644
> --- a/drivers/gpu/drm/xe/xe_device_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
> @@ -311,12 +311,17 @@ int xe_device_sysfs_init(struct xe_device *xe)
> if (xe->info.platform == XE_BATTLEMAGE) {
> ret = sysfs_create_files(&dev->kobj, auto_link_downgrade_attrs);
> if (ret)
> - return ret;
> + goto cleanup;
>
> ret = late_bind_create_files(dev);
> if (ret)
> - return ret;
> + goto cleanup;
> }
>
> return devm_add_action_or_reset(dev, xe_device_sysfs_fini, xe);
> +
> +cleanup:
> + xe_device_sysfs_fini(xe);
> + return ret;
> +
> }
next prev parent reply other threads:[~2025-09-16 14:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 18:32 [PATCH] drm/xe/xe_device_sysfs: add cleanup action in xe_device_sysfs_init Zongyao Bai
2025-09-10 18:38 ` ✗ CI.checkpatch: warning for drm/xe/xe_device_sysfs: add cleanup action in xe_device_sysfs_init (rev2) Patchwork
2025-09-10 18:39 ` ✓ CI.KUnit: success " Patchwork
2025-09-10 19:12 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-11 2:24 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-11 4:11 ` [PATCH] drm/xe/xe_device_sysfs: add cleanup action in xe_device_sysfs_init Lucas De Marchi
2025-09-15 21:47 ` [PATCH v3 0/2] drm/xe/xe_device_sysfs: modify sysfs clean up process Zongyao Bai
2025-09-15 21:47 ` [PATCH v3 1/2] drm/xe/xe_device_sysfs: Add cleanup action in xe_device_sysfs_init Zongyao Bai
2025-09-15 22:34 ` Lin, Shuicheng
2025-09-16 14:29 ` Michal Wajdeczko [this message]
2025-09-16 15:06 ` (subset) " Lucas De Marchi
2025-09-15 21:47 ` [PATCH v3 2/2] drm/xe/xe_device_sysfs: Remove sysfs unconditionally while clean sysfs entries Zongyao Bai
2025-09-15 22:46 ` Lin, Shuicheng
2025-09-16 14:39 ` Michal Wajdeczko
2025-09-16 15:03 ` Lucas De Marchi
2025-09-15 21:55 ` ✗ CI.checkpatch: warning for drm/xe/xe_device_sysfs: add cleanup action in xe_device_sysfs_init (rev3) Patchwork
2025-09-15 21:56 ` ✓ CI.KUnit: success " Patchwork
2025-09-15 22:34 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-16 3:29 ` ✗ Xe.CI.Full: 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=d2a38554-c096-430f-a289-0fb2e299b688@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=shuicheng.lin@intel.com \
--cc=stuart.summers@intel.com \
--cc=zongyao.bai@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox