From: Maxime Ripard Subject: Re: [PATCH] drm/sun4i: tcon: Unconditionally reset the TCON Date: Fri, 8 Sep 2017 09:47:47 +0200 Message-ID: <20170908074747.nwfdkvshqucvy424@flea.lan> References: <20170908041545.14198-1-wens@csie.org> <20170908064218.kjo5clk2dpeunwwo@flea.lan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1059809972==" Return-path: Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 8001F89F5F for ; Fri, 8 Sep 2017 07:47:48 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Chen-Yu Tsai Cc: dri-devel List-Id: dri-devel@lists.freedesktop.org --===============1059809972== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qvdfns35c22nculk" Content-Disposition: inline --qvdfns35c22nculk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 08, 2017 at 02:49:52PM +0800, Chen-Yu Tsai wrote: > On Fri, Sep 8, 2017 at 2:42 PM, Maxime Ripard > wrote: > > Hi, > > > > On Fri, Sep 08, 2017 at 12:15:45PM +0800, Chen-Yu Tsai wrote: > >> When binding the TCON, we were checking the reset control status and > >> asserting reset if it wasn't in reset. The check failed to account for > >> the reset control API returning error codes if the status callback was > >> not implemented. > >> > >> Since we want the TCON to be reset in all cases, and re-asserting the > >> reset control does no harm, just assert the reset unconditionally. > >> > >> Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") > >> Signed-off-by: Chen-Yu Tsai > >> --- > >> drivers/gpu/drm/sun4i/sun4i_tcon.c | 3 +-- > >> 1 file changed, 1 insertion(+), 2 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4= i/sun4i_tcon.c > >> index d9791292553e..eb32676d5b01 100644 > >> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c > >> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c > >> @@ -530,8 +530,7 @@ static int sun4i_tcon_bind(struct device *dev, str= uct device *master, > >> } > >> > >> /* Make sure our TCON is reset */ > >> - if (!reset_control_status(tcon->lcd_rst)) > >> - reset_control_assert(tcon->lcd_rst); > >> + reset_control_assert(tcon->lcd_rst); > > > > That doesn't really reset it if it was already de-asserted. In that > > case, the TCON will not be reset, unlike what your commit log says. >=20 > Why not? It is now asserting the reset control, regardless of the > status. Oh, right, sorry. > > Maybe you wanted to use reset_control_reset? >=20 > If you prefer it, sure. When I did this patch we didn't support the > .reset callback, so this is an explicit assert followed by the existing > deassert. Still, if we rework that part, I guess that just using reset unconditonally would make it more obvious. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --qvdfns35c22nculk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJZsksjAAoJEBx+YmzsjxAgboQP/jF0PSd5W2h5e4QrWBdJy254 QwzqUN5Zq6UYhgfD+BwWRuj9yBwGFYSf/ptQvOwif2wsiMXaEO+FzxgPaMJYLc72 JzoEqqkJ7fEljRz0+aDjWHLVuwejzVTVZq0Csl4R9hIH5ngtcggcdF6D8Q0zuIsG YwzDOJ0UY0Z8/QomjfrZFRWsZKIVVIHCUST9fM/FqjKg4xHXXl4Kg/iMOI9YWenj KTDmLYc+MlHGg51LoQgpVjpNxyK3ETHHc9P9+sDz6T1vt97hBM0VewjQvgapvdcC 5nd6cF5CXUuJx/RcyK0bZmNMXLswPgEQNPQ7uzqJxpew09LQaiPaM7+8pDbPE82N kPrv8Y/wsDCAr58p0ec4SxjaxCfvqw7fsnBer83WH3Emqdl7LU/PhY8yVj+hmz8R 1XKYMemnLQ8fKlMD6l3x6REMVFG0xgPC6/F3dG5qa8TPfHBK9iZxiaLaGiHVnp30 h5FVGUWquHiKv8Xt6Z7wUoSIRdrBYaFLg2TYeBB5BDF7BX/tMXHvlzlVrud1NFsr sLwQ/wfixfp4hB7RfqR3TJ5dClo+zCCGfQaMdWjHJm21r3L7D5ssp3dWi9DefxkD 2bqF7syrarRfpoQPrPJB5jDHNkPSXxFFANLupmrYX5XtPfJX30FP6MrhMtm82eeJ licBuY8idR/I0lAKUGsx =/9r5 -----END PGP SIGNATURE----- --qvdfns35c22nculk-- --===============1059809972== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1059809972==--