All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Tomasz Lis <tomasz.lis@intel.com>, intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/fb: Proper support of boundary conditions	in bitmasks.
Date: Mon, 20 Feb 2017 10:00:00 +0200	[thread overview]
Message-ID: <87tw7p47i7.fsf@intel.com> (raw)
In-Reply-To: <1487326666-15789-1-git-send-email-tomasz.lis@intel.com>

On Fri, 17 Feb 2017, Tomasz Lis <tomasz.lis@intel.com> wrote:
> The recently introduced patch changed behavior of masks when
> the bit number is negative. Instead of no bits set, the new way
> makes all bits set. Problematic patch:
>   drm/i915: Avoid BIT(max) - 1 and use GENMASK(max - 1, 0)

For future reference, please find the commit id of the committed patch,
and reference that with the Fixes: tag. Please Cc the folks from the
commit.

Whoever commits this must add:

Fixes: 3c779a49bd7c ("drm/i915: Avoid BIT(max) - 1 and use GENMASK(max - 1, 0)")
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>

Joonas, Chris, please check the rest of the regressing commit that it
doesn't suffer from the same issue.

Thanks,
Jani.

> This behaviour was not considered when making changes, and boundary
> value of count (=0) is now resulting in a mask with all bits on, since
> the value is directly decreased and therefore negative. Checking if
> all bits are set leads to infinite loop.
>
> This patch introduces an additional check to avoid empty masks. It
> reverts the control flow to the exact same way it worked before
> the problematic patch.
>
> Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> index e6f3eb2d..bc65ecf 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -496,7 +496,7 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
>  		conn_configured |= BIT(i);
>  	}
>  
> -	if ((conn_configured & mask) != mask) {
> +	if (count > 0 && (conn_configured & mask) != mask) {
>  		pass++;
>  		goto retry;
>  	}

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-02-20  8:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 10:17 [PATCH] drm/fb: Proper support of boundary conditions in bitmasks Tomasz Lis
2017-02-17 10:17 ` [RFC] drm/fb: Avoid infinite loop when no response from connector Tomasz Lis
2017-02-17 12:40   ` Arkadiusz Hiler
2017-02-17 12:53     ` Chris Wilson
2017-02-18 15:37   ` [PATCH] drm/i915/fbdev: Stop repeating tile configuration on stagnation Chris Wilson
2017-02-20 15:37     ` Tomasz Lis
2017-02-20 15:46       ` Chris Wilson
2017-02-24 10:38         ` Tomasz Lis
2017-02-17 12:45 ` [PATCH] drm/fb: Proper support of boundary conditions in bitmasks Arkadiusz Hiler
2017-02-18 16:22 ` ✓ Fi.CI.BAT: success for drm/fb: Proper support of boundary conditions in bitmasks. (rev4) Patchwork
2017-02-20  8:00 ` Jani Nikula [this message]
2017-02-21 15:04   ` [PATCH] drm/fb: Proper support of boundary conditions in bitmasks Joonas Lahtinen

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=87tw7p47i7.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=tomasz.lis@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 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.