lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190628121315.GH5942@intel.com>
Date:   Fri, 28 Jun 2019 15:13:15 +0300
From:   Ville Syrjälä <ville.syrjala@...ux.intel.com>
To:     Robert Beckett <bob.beckett@...labora.com>
Cc:     dri-devel@...ts.freedesktop.org,
        Maxime Ripard <maxime.ripard@...tlin.com>,
        linux-kernel@...r.kernel.org, David Airlie <airlied@...ux.ie>,
        Sean Paul <sean@...rly.run>
Subject: Re: [PATCH v4 2/2] Revert "drm/vblank: Do not update vblank count if
 interrupts are already disabled."

On Fri, Jun 28, 2019 at 01:05:32PM +0100, Robert Beckett wrote:
> If interrupts are already disabled, then the timestamp for the vblank
> does not get updated, causing a stale timestamp to be reported to
> userland while disabling crtcs.
> 
> This reverts commit 68036b08b91bc491ccc308f902616a570a49227c.

Please cc the people involved in that. And I'd drop the lkml cc.

> 
> Signed-off-by: Robert Beckett <bob.beckett@...labora.com>
> ---
>  drivers/gpu/drm/drm_vblank.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
> index 7dabb2bdb733..aeb9734d7799 100644
> --- a/drivers/gpu/drm/drm_vblank.c
> +++ b/drivers/gpu/drm/drm_vblank.c
> @@ -371,25 +371,23 @@ void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
>  	spin_lock_irqsave(&dev->vblank_time_lock, irqflags);
>  
>  	/*
> -	 * Update vblank count and disable vblank interrupts only if the
> -	 * interrupts were enabled. This avoids calling the ->disable_vblank()
> -	 * operation in atomic context with the hardware potentially runtime
> -	 * suspended.
> +	 * Only disable vblank interrupts if they're enabled. This avoids
> +	 * calling the ->disable_vblank() operation in atomic context with the
> +	 * hardware potentially runtime suspended.
>  	 */
> -	if (!vblank->enabled)
> -		goto out;
> +	if (vblank->enabled) {
> +		__disable_vblank(dev, pipe);
> +		vblank->enabled = false;
> +	}
>  
>  	/*
> -	 * Update the count and timestamp to maintain the
> +	 * Always update the count and timestamp to maintain the
>  	 * appearance that the counter has been ticking all along until
>  	 * this time. This makes the count account for the entire time
>  	 * between drm_crtc_vblank_on() and drm_crtc_vblank_off().
>  	 */
>  	drm_update_vblank_count(dev, pipe, false);
> -	__disable_vblank(dev, pipe);
> -	vblank->enabled = false;
>  
> -out:
>  	spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags);
>  }
>  
> -- 
> 2.18.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ