public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915: load driver even if debugfs fails
@ 2015-07-23 14:06 Sudip Mukherjee
  2015-08-03  9:26 ` Sudip Mukherjee
  0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2015-07-23 14:06 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, David Airlie
  Cc: linux-kernel, intel-gfx, dri-devel, Sudip Mukherjee, Chris Wilson

debugfs files are not necessary for the usual operation of the driver
and the device. No need to check for the return values from the debugfs
file creation. Even if one debugfs file fails to create we try with the
next debugfs file and ultimately return success always so that the
driver continues to load.
cleanup will clean all the created debugfs files as the list of file
that are created are maintained in minor->debugfs_list.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

v1 was drm/i915: add error path

 drivers/gpu/drm/i915/i915_debugfs.c | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index caf1382..8b1a42a 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -5138,29 +5138,22 @@ void intel_display_crc_init(struct drm_device *dev)
 
 int i915_debugfs_init(struct drm_minor *minor)
 {
-	int ret, i;
+	int i;
 
-	ret = i915_forcewake_create(minor->debugfs_root, minor);
-	if (ret)
-		return ret;
+	i915_forcewake_create(minor->debugfs_root, 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;
-	}
+	for (i = 0; i < ARRAY_SIZE(i915_pipe_crc_data); i++)
+		i915_pipe_crc_create(minor->debugfs_root, minor, i);
 
-	for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
-		ret = i915_debugfs_create(minor->debugfs_root, minor,
-					  i915_debugfs_files[i].name,
-					  i915_debugfs_files[i].fops);
-		if (ret)
-			return ret;
-	}
+	for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++)
+		i915_debugfs_create(minor->debugfs_root, minor,
+				    i915_debugfs_files[i].name,
+				    i915_debugfs_files[i].fops);
+
+	drm_debugfs_create_files(i915_debugfs_list, I915_DEBUGFS_ENTRIES,
+				 minor->debugfs_root, minor);
 
-	return drm_debugfs_create_files(i915_debugfs_list,
-					I915_DEBUGFS_ENTRIES,
-					minor->debugfs_root, minor);
+	return 0;
 }
 
 void i915_debugfs_cleanup(struct drm_minor *minor)
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] drm/i915: load driver even if debugfs fails
  2015-07-23 14:06 [PATCH v2] drm/i915: load driver even if debugfs fails Sudip Mukherjee
@ 2015-08-03  9:26 ` Sudip Mukherjee
  2015-08-03 10:54   ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2015-08-03  9:26 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, David Airlie
  Cc: linux-kernel, intel-gfx, dri-devel, Chris Wilson

On Thu, Jul 23, 2015 at 07:36:12PM +0530, Sudip Mukherjee wrote:
> debugfs files are not necessary for the usual operation of the driver
> and the device. No need to check for the return values from the debugfs
> file creation. Even if one debugfs file fails to create we try with the
> next debugfs file and ultimately return success always so that the
> driver continues to load.
> cleanup will clean all the created debugfs files as the list of file
> that are created are maintained in minor->debugfs_list.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
A gentle ping.

regards
sudip

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] drm/i915: load driver even if debugfs fails
  2015-08-03  9:26 ` Sudip Mukherjee
@ 2015-08-03 10:54   ` Daniel Vetter
  2015-08-03 11:45     ` Sudip Mukherjee
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2015-08-03 10:54 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Daniel Vetter, Jani Nikula, David Airlie, intel-gfx, linux-kernel,
	dri-devel

On Mon, Aug 03, 2015 at 02:56:42PM +0530, Sudip Mukherjee wrote:
> On Thu, Jul 23, 2015 at 07:36:12PM +0530, Sudip Mukherjee wrote:
> > debugfs files are not necessary for the usual operation of the driver
> > and the device. No need to check for the return values from the debugfs
> > file creation. Even if one debugfs file fails to create we try with the
> > next debugfs file and ultimately return success always so that the
> > driver continues to load.

Does this even happen? I'm reluctant to merge patches without real-world
justification.
-Daniel

> > cleanup will clean all the created debugfs files as the list of file
> > that are created are maintained in minor->debugfs_list.
> > 
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > ---
> A gentle ping.
> 
> regards
> sudip
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] drm/i915: load driver even if debugfs fails
  2015-08-03 10:54   ` Daniel Vetter
@ 2015-08-03 11:45     ` Sudip Mukherjee
  0 siblings, 0 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2015-08-03 11:45 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, David Airlie, intel-gfx, linux-kernel,
	dri-devel

On Mon, Aug 03, 2015 at 12:54:33PM +0200, Daniel Vetter wrote:
> On Mon, Aug 03, 2015 at 02:56:42PM +0530, Sudip Mukherjee wrote:
> > On Thu, Jul 23, 2015 at 07:36:12PM +0530, Sudip Mukherjee wrote:
> > > debugfs files are not necessary for the usual operation of the driver
> > > and the device. No need to check for the return values from the debugfs
> > > file creation. Even if one debugfs file fails to create we try with the
> > > next debugfs file and ultimately return success always so that the
> > > driver continues to load.
> 
> Does this even happen?
realistically - I don't think it can happen. Even if it happens then
there will be more serious problem like memory crunch or filesystem
problem and in those cases there is no point in continuing to load the
driver.

regards
sudip

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-03 11:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 14:06 [PATCH v2] drm/i915: load driver even if debugfs fails Sudip Mukherjee
2015-08-03  9:26 ` Sudip Mukherjee
2015-08-03 10:54   ` Daniel Vetter
2015-08-03 11:45     ` Sudip Mukherjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox