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] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 31 Jan 2015 13:49:28 +0100
From:	Heiko Stübner <heiko@...ech.de>
To:	dri-devel@...ts.freedesktop.org
Cc:	Mark Yao <mark.yao@...k-chips.com>,
	David Airlie <airlied@...ux.ie>,
	Daniel Vetter <daniel@...ll.ch>,
	Rob Clark <robdclark@...il.com>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Daniel Kurtz <djkurtz@...omium.org>,
	linux-kernel@...r.kernel.org, linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH] drm/rockchip: vop: power off until vop standby take effect

Hi Mark,

Am Samstag, 31. Januar 2015, 16:41:38 schrieb Mark Yao:
> Vop standby will take effect end of current frame,
> if dsp_hold_valid_irq happen, it means vop standby complete.
> 
> we must wait standby complete when we want to disable aclk,
> if not, memory bus maybe dead.
> 
> Signed-off-by: Mark Yao <mark.yao@...k-chips.com>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c |   76
> ++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 13
> deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index fb25836..47ea61f 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -89,6 +89,7 @@ struct vop {
>  	/* mutex vsync_ work */
>  	struct mutex vsync_mutex;
>  	bool vsync_work_pending;
> +	struct completion dsp_hold_completion;
> 
>  	const struct vop_data *data;
> 
> @@ -382,6 +383,34 @@ static bool is_alpha_support(uint32_t format)
>  	}
>  }
> 
> +static void vop_dsp_hold_valid_irq_enable(struct vop *vop)
> +{
> +	unsigned long flags;
> +
> +	BUG_ON(!vop->is_enabled);

BUG_ON is generally not well liked in general error handling - i.e. in the
	 !vop->is_enabled
bad things may happen, but this may not always be the case. And BUG_ON 
effectively kills the machine.

You could simply use a WARN_ON, so people see that something really strange is 
going on but can still try to recover things.


> +
> +	spin_lock_irqsave(&vop->irq_lock, flags);
> +
> +	vop_mask_write(vop, INTR_CTRL0, DSP_HOLD_VALID_INTR_MASK,
> +		       DSP_HOLD_VALID_INTR_EN(1));
> +
> +	spin_unlock_irqrestore(&vop->irq_lock, flags);
> +}
> +
> +static void vop_dsp_hold_valid_irq_disable(struct vop *vop)
> +{
> +	unsigned long flags;
> +
> +	BUG_ON(!vop->is_enabled);

same here

> +
> +	spin_lock_irqsave(&vop->irq_lock, flags);
> +
> +	vop_mask_write(vop, INTR_CTRL0, DSP_HOLD_VALID_INTR_MASK,
> +		       DSP_HOLD_VALID_INTR_EN(0));
> +
> +	spin_unlock_irqrestore(&vop->irq_lock, flags);
> +}
> +
>  static void vop_enable(struct drm_crtc *crtc)
>  {
>  	struct vop *vop = to_vop(crtc);


except the above
Reviewed-by: Heiko Stuebner <heiko@...ech.de>

[but take it with a grain of salt, as I'm still new to drm-land :-) ]


Heiko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ