* [PATCH] drm/i915: add error path
@ 2015-07-22 11:28 Sudip Mukherjee
2015-07-22 11:39 ` [Intel-gfx] " Chris Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2015-07-22 11:28 UTC (permalink / raw)
To: Daniel Vetter, Jani Nikula, David Airlie
Cc: intel-gfx, linux-kernel, dri-devel, Sudip Mukherjee
If any of the debug file creation fails we were just returning the
error code to the drm layer. But the debug files that we created in the
process were not removed. And debugfs files are not automatically
cleaned up.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
Hi Daniel,
Whom should i keep Cc: for this patch? Original code was from 2009, then
more codes have been added and changed in it.
drivers/gpu/drm/i915/i915_debugfs.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index caf1382..24b04f9 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -5147,7 +5147,7 @@ int i915_debugfs_init(struct drm_minor *minor)
for (i = 0; i < ARRAY_SIZE(i915_pipe_crc_data); i++) {
ret = i915_pipe_crc_create(minor->debugfs_root, minor, i);
if (ret)
- return ret;
+ goto err_pipe_crc;
}
for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
@@ -5155,12 +5155,34 @@ int i915_debugfs_init(struct drm_minor *minor)
i915_debugfs_files[i].name,
i915_debugfs_files[i].fops);
if (ret)
- return ret;
+ goto err_debugfs;
}
return drm_debugfs_create_files(i915_debugfs_list,
I915_DEBUGFS_ENTRIES,
minor->debugfs_root, minor);
+
+err_debugfs:
+ while (--i >= 0) {
+ struct drm_info_list *info_list =
+ (struct drm_info_list *)i915_debugfs_files[i].fops;
+
+ drm_debugfs_remove_files(info_list, 1, minor);
+ }
+
+err_pipe_crc:
+ if (i == -1)
+ i = ARRAY_SIZE(i915_pipe_crc_data);
+
+ while (--i >= 0) {
+ struct drm_info_list *info_list =
+ (struct drm_info_list *)&i915_pipe_crc_data[i];
+ drm_debugfs_remove_files(info_list, 1, minor);
+ }
+ drm_debugfs_remove_files((struct drm_info_list *)&i915_forcewake_fops,
+ 1, minor);
+
+ return ret;
}
void i915_debugfs_cleanup(struct drm_minor *minor)
--
1.8.1.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Intel-gfx] [PATCH] drm/i915: add error path
2015-07-22 11:28 [PATCH] drm/i915: add error path Sudip Mukherjee
@ 2015-07-22 11:39 ` Chris Wilson
2015-07-22 11:56 ` Sudip Mukherjee
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2015-07-22 11:39 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: intel-gfx, linux-kernel, dri-devel, Daniel Vetter
On Wed, Jul 22, 2015 at 04:58:47PM +0530, Sudip Mukherjee wrote:
> If any of the debug file creation fails we were just returning the
> error code to the drm layer. But the debug files that we created in the
> process were not removed. And debugfs files are not automatically
> cleaned up.
Just handle the failure to add gracefully by only removing the ones we
add during debugfs cleanup. One thing we do not actually want to do here
is return an error - not setting up every file in debugfs shouldn't stop
the driver from loading.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: add error path
2015-07-22 11:39 ` [Intel-gfx] " Chris Wilson
@ 2015-07-22 11:56 ` Sudip Mukherjee
0 siblings, 0 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2015-07-22 11:56 UTC (permalink / raw)
To: Chris Wilson, Daniel Vetter, Jani Nikula, David Airlie, intel-gfx,
linux-kernel, dri-devel
On Wed, Jul 22, 2015 at 12:39:37PM +0100, Chris Wilson wrote:
> On Wed, Jul 22, 2015 at 04:58:47PM +0530, Sudip Mukherjee wrote:
> > If any of the debug file creation fails we were just returning the
> > error code to the drm layer. But the debug files that we created in the
> > process were not removed. And debugfs files are not automatically
> > cleaned up.
>
> Just handle the failure to add gracefully by only removing the ones we
> add during debugfs cleanup. One thing we do not actually want to do here
> is return an error - not setting up every file in debugfs shouldn't stop
> the driver from loading.
Ok, I will send the v2 day after tomorrow. Today and tomorrow I will
horribly busy in my dayjob.
regards
sudip
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-22 11:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 11:28 [PATCH] drm/i915: add error path Sudip Mukherjee
2015-07-22 11:39 ` [Intel-gfx] " Chris Wilson
2015-07-22 11:56 ` Sudip Mukherjee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox