Message ID | 1513584243-12607-1-git-send-email-mika.kahola@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, 18 Dec 2017, Mika Kahola <mika.kahola@intel.com> wrote: > We may have fused or unused pipes in our system. Let's check that the pipe > in question is within limits of accessible pipes. In case, that we are not > able to access the pipe, we return early with a warning. > > v2: Rephrasing of the commit message (Jani) > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103206 > Reported-by: Thomas Gleixner <tglx@linutronix.de> > Tested-by: Jaswinder Singh Rajput <jaswinder@perfectintelligent.com> > Suggested-by: Jani Nikula <jani.nikula@intel.com> > Reviewed-by: Jani Nikula <jani.nikula@intel.com> > Signed-off-by: Mika Kahola <mika.kahola@intel.com> Pushed, thanks for the patch, sorry for the delay. BR, Jani. > --- > drivers/gpu/drm/i915/intel_audio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c > index f1502a0..522d54f 100644 > --- a/drivers/gpu/drm/i915/intel_audio.c > +++ b/drivers/gpu/drm/i915/intel_audio.c > @@ -779,7 +779,7 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *dev_priv, > { > struct intel_encoder *encoder; > > - if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->num_pipes)) > + if (WARN_ON(pipe >= ARRAY_SIZE(dev_priv->av_enc_map))) > return NULL; > > /* MST */
Quoting Jani Nikula (2018-01-19 14:22:49) > On Mon, 18 Dec 2017, Mika Kahola <mika.kahola@intel.com> wrote: > > We may have fused or unused pipes in our system. Let's check that the pipe > > in question is within limits of accessible pipes. In case, that we are not > > able to access the pipe, we return early with a warning. > > > > v2: Rephrasing of the commit message (Jani) > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103206 > > Reported-by: Thomas Gleixner <tglx@linutronix.de> > > Tested-by: Jaswinder Singh Rajput <jaswinder@perfectintelligent.com> > > Suggested-by: Jani Nikula <jani.nikula@intel.com> > > Reviewed-by: Jani Nikula <jani.nikula@intel.com> > > Signed-off-by: Mika Kahola <mika.kahola@intel.com> > > Pushed, thanks for the patch, sorry for the delay. This WARN is in the wild, should we queue this for drm-intel-fixes. Reported-by: fritsch@xbmc.org -Chris
On Mon, 29 Jan 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote: > Quoting Jani Nikula (2018-01-19 14:22:49) >> On Mon, 18 Dec 2017, Mika Kahola <mika.kahola@intel.com> wrote: >> > We may have fused or unused pipes in our system. Let's check that the pipe >> > in question is within limits of accessible pipes. In case, that we are not >> > able to access the pipe, we return early with a warning. >> > >> > v2: Rephrasing of the commit message (Jani) >> > >> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103206 >> > Reported-by: Thomas Gleixner <tglx@linutronix.de> >> > Tested-by: Jaswinder Singh Rajput <jaswinder@perfectintelligent.com> >> > Suggested-by: Jani Nikula <jani.nikula@intel.com> >> > Reviewed-by: Jani Nikula <jani.nikula@intel.com> >> > Signed-off-by: Mika Kahola <mika.kahola@intel.com> >> >> Pushed, thanks for the patch, sorry for the delay. > > This WARN is in the wild, should we queue this for drm-intel-fixes. > > Reported-by: fritsch@xbmc.org Rodrigo, please cherry-pick this to drm-intel-next-fixes, with Cc: stable, with any other cherry-picks you might have, and send a pull request to Dave to merge either during the merge window or at -rc1. BR, Jani.
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index f1502a0..522d54f 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -779,7 +779,7 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *dev_priv, { struct intel_encoder *encoder; - if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->num_pipes)) + if (WARN_ON(pipe >= ARRAY_SIZE(dev_priv->av_enc_map))) return NULL; /* MST */