All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/i915: Bail if plane/crtc init fails
Date: Fri, 4 Nov 2016 23:07:26 +0200	[thread overview]
Message-ID: <20161104210726.GU4617@intel.com> (raw)
In-Reply-To: <20161104204821.GA8566@nuc-i3427.alporthouse.com>

On Fri, Nov 04, 2016 at 08:48:21PM +0000, Chris Wilson wrote:
> On Tue, Oct 25, 2016 at 06:58:02PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Due to the plane->index not getting readjusted in drm_plane_cleanup(),
> > we can't continue initialization of some plane/crtc init fails.
> > Well, we sort of could I suppose if we left all initialized planes on
> > the list, but that would expose those planes to userspace as well.
> > 
> > But for crtcs the situation is even worse since we assume that
> > pipe==crtc index occasionally, so we can't really deal with a partially
> > initialize set of crtcs.
> > 
> > So seems safest to just abort the entire thing if anything goes wrong.
> > All the failure paths here are kmalloc()s anyway, so it seems unlikely
> > we'd get very far if these start failing.
> 
> smatch spotted ERR_PTR(0)
> 
> > @@ -15296,22 +15304,30 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
> >  	}
> >  
> >  	primary = intel_primary_plane_create(dev, pipe);
> > -	if (!primary)
> > +	if (IS_ERR(primary)) {
> > +		ret = PTR_ERR(primary);
> 
> Here...

This looks correct to me, but the cursor and sprite paths are clearly
crap.

> 
> >  		goto fail;
> > +	}
> >  
> >  	for_each_sprite(dev_priv, pipe, sprite) {
> > -		ret = intel_plane_init(dev, pipe, sprite);
> > -		if (ret)
> > -			DRM_DEBUG_KMS("pipe %c sprite %c init failed: %d\n",
> > -				      pipe_name(pipe), sprite_name(pipe, sprite), ret);
> > +		struct intel_plane *plane;
> > +
> > +		plane = intel_sprite_plane_create(dev, pipe, sprite);
> > +		if (!plane) {
> > +			ret = PTR_ERR(plane);
> 
> and here.
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-11-04 21:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 15:57 [PATCH 0/4] drm/i915: Abort if crtc/plane init fails ville.syrjala
2016-10-25 15:58 ` [PATCH 1/4] drm/i915: Don't try to initialize sprite planes on pre-ilk ville.syrjala
2016-10-25 15:58 ` [PATCH 2/4] drm/i915: Initialize planes in a reasonable order ville.syrjala
2016-10-25 15:58 ` [PATCH 3/4] drm/i915: Bail if plane/crtc init fails ville.syrjala
2016-10-27  7:03   ` Daniel Vetter
2016-11-04 20:48   ` Chris Wilson
2016-11-04 21:07     ` Ville Syrjälä [this message]
2016-11-04 21:45       ` Chris Wilson
2016-10-25 15:58 ` [PATCH 4/4] drm/i915: Reorganize sprite init ville.syrjala
2016-10-27  7:07   ` Daniel Vetter
2016-10-31 15:00     ` Ville Syrjälä
2016-10-25 16:16 ` ✗ Fi.CI.BAT: warning for series starting with [1/4] drm/i915: Don't try to initialize sprite planes on pre-ilk 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=20161104210726.GU4617@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.