[PATCH] drm: shmob_drm: Check clk_prepare_enable() return value

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Dec 4 06:37:48 PST 2013


Hi Thierry,

On Wednesday 04 December 2013 11:01:07 Thierry Reding wrote:
> On Wed, Dec 04, 2013 at 02:38:21AM +0100, Laurent Pinchart wrote:
> > On Tuesday 03 December 2013 10:59:24 Thierry Reding wrote:
> > > On Mon, Dec 02, 2013 at 01:52:20AM +0100, Laurent Pinchart wrote:
> > > [...]
> > > 
> > > > diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
> > > > b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
> > > 
> > > [...]
> > > 
> > > > @@ -170,7 +178,9 @@ static void shmob_drm_crtc_start(struct
> > > > shmob_drm_crtc
> > > > *scrtc)
> > > > 
> > > >  		return;
> > > >  	
> > > >  	/* Enable clocks before accessing the hardware. */
> > > > 
> > > > -	shmob_drm_clk_on(sdev);
> > > > +	ret = shmob_drm_clk_on(sdev);
> > > > +	if (ret < 0)
> > > > +		return;
> > > 
> > > Perhaps this should be printing an error or using WARN_ON()? Otherwise
> > > it might be very difficult to diagnose what's going wrong.
> > 
> > That's a good point. In practice, as the driver always uses a Renesas SoC
> > MSTP clock, the clock code will print a message to the kernel log though,
> > so I'm not sure whether we should duplicate that here. If you think we
> > should I'll submit a new patch.
> 
> Is that one of the clocks implemented in drivers/sh/clk?

Correct, and in drivers/clk/shmobile/clk-mstp.c when 
http://www.spinics.net/lists/devicetree/msg12696.html will be merged.

> There don't seem to be any error messages in the clk_enable()
> implementation.

There will be one when http://www.spinics.net/lists/linux-sh/msg25650.html 
will get merged :-) Before that enabling the clock never failed, with the 
patch applied the failure is logged.

-- 
Regards,

Laurent Pinchart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20131204/8410e272/attachment.pgp>


More information about the dri-devel mailing list