From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [PATCH] drm: shmob_drm: Check clk_prepare_enable() return value Date: Wed, 04 Dec 2013 15:37:48 +0100 Message-ID: <10119917.mgvmrMaWhg@avalon> References: <1385945540-20710-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> <37481163.oH5TkQcYhz@avalon> <20131204100106.GS19943@ulmo.nvidia.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0057279798==" Return-path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [95.142.166.194]) by gabe.freedesktop.org (Postfix) with ESMTP id 23346FAF47 for ; Wed, 4 Dec 2013 06:37:43 -0800 (PST) In-Reply-To: <20131204100106.GS19943@ulmo.nvidia.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: Thierry Reding , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0057279798== Content-Type: multipart/signed; boundary="nextPart1837887.Axj2NGpiI5"; micalg="pgp-sha1"; protocol="application/pgp-signature" --nextPart1837887.Axj2NGpiI5 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 --nextPart1837887.Axj2NGpiI5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJSnz48AAoJEIkPb2GL7hl12roH+gK5FdxtgpcIHmY8g6PavVla 41TRzB7RiwhzlgrbKj7N0lZzm1D4zcPGqUO3qynFkPgucnsHDQplIi7+TEurZJ6H kgXBfHvyfJqGH7/g+SfDTahaj8qaryWC2fqjDef+zH6mStPwdWtanwUin4Rig8UI Z3S8lTjSPXqWpBD9ivxjk/jIdzLgOJ2mLAsq/nzEOj5GewJgYOqDyEtSt6Ya19fh xFQZiURdqKgImvUGuOz+lCqlg1VkwimXh0qRS4KKu/9D3TIRlhwKWAiYmqpDH0w9 RpzU2bKOu0Q+c1wRyGSZX3ukkfSle/sV3dZa1I17Si3AXzdIhf+xewTnlxNv4mU= =O03b -----END PGP SIGNATURE----- --nextPart1837887.Axj2NGpiI5-- --===============0057279798== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0057279798==--