From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH v2 2/6] drm/tilcdc: Write to LCDC_END_OF_INT_IND_REG at the end of IRQ function Date: Thu, 16 Jun 2016 12:19:35 +0300 Message-ID: <57626F27.9000608@ti.com> References: <4f1ca388972381100d9c44316e0f4f13a62134f9.1465979902.git.jsarha@ti.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0633226910==" Return-path: Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1CD4C6E9E8 for ; Thu, 16 Jun 2016 09:19:45 +0000 (UTC) In-Reply-To: <4f1ca388972381100d9c44316e0f4f13a62134f9.1465979902.git.jsarha@ti.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Jyri Sarha , dri-devel@lists.freedesktop.org Cc: bcousson@baylibre.com, laurent.pinchart@ideasonboard.com List-Id: dri-devel@lists.freedesktop.org --===============0633226910== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3CkIdWbMrfvRR1iIikwIRXL5ePcOdcg3I" --3CkIdWbMrfvRR1iIikwIRXL5ePcOdcg3I Content-Type: multipart/mixed; boundary="Frlp6gxIDsWon3TM1T8i92ElFan1FMRCi" From: Tomi Valkeinen To: Jyri Sarha , dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, daniel@ffwll.ch, laurent.pinchart@ideasonboard.com, robdclark@gmail.com, bcousson@baylibre.com Message-ID: <57626F27.9000608@ti.com> Subject: Re: [PATCH v2 2/6] drm/tilcdc: Write to LCDC_END_OF_INT_IND_REG at the end of IRQ function References: <4f1ca388972381100d9c44316e0f4f13a62134f9.1465979902.git.jsarha@ti.com> In-Reply-To: <4f1ca388972381100d9c44316e0f4f13a62134f9.1465979902.git.jsarha@ti.com> --Frlp6gxIDsWon3TM1T8i92ElFan1FMRCi Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 15/06/16 11:39, Jyri Sarha wrote: > Reorder the IRQ function so that the write to LCDC_END_OF_INT_IND_REG > is done last. The write to LCDC_END_OF_INT_IND_REG indicates to LCDC > that the interrupt service routine has completed (see section > 13.3.6.1.6 in AM335x TRM). This is needed if LCDC's ipgvmodirq module > is configured for pulse interrupts. >=20 > Signed-off-by: Jyri Sarha > --- > drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 24 +++++++++++++++--------- > 1 file changed, 15 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/til= cdc/tilcdc_crtc.c > index 4d8f9a5..1343717 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > @@ -725,14 +725,19 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc= ) > tilcdc_crtc->frame_intact =3D true; > } > =20 > - if (priv->rev =3D=3D 2) { > - if (stat & LCDC_FRAME_DONE) { > - tilcdc_crtc->frame_done =3D true; > - wake_up(&tilcdc_crtc->frame_done_wq); > - } > - tilcdc_write(dev, LCDC_END_OF_INT_IND_REG, 0); > + if (priv->rev =3D=3D 1) > + return IRQ_HANDLED; > + /* The rest is for revision 2 only */ > + > + if (stat & LCDC_FRAME_DONE) { > + tilcdc_crtc->frame_done =3D true; > + wake_up(&tilcdc_crtc->frame_done_wq); > } > =20 > + if (stat & LCDC_FIFO_UNDERFLOW) > + dev_err_ratelimited(dev->dev, "%s(0x%08x): FIFO underfow", > + __func__, stat); We do have underflow irq for rev1 too, don't we? Why not just move the "if (priv->rev =3D=3D 2) {" block to the end? Or ma= ybe extract the write to the LCDC_END_OF_INT_IND_REG from the current block, and move only that to the end. Much less re-ordering needed for that. Tomi --Frlp6gxIDsWon3TM1T8i92ElFan1FMRCi-- --3CkIdWbMrfvRR1iIikwIRXL5ePcOdcg3I Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXYm8nAAoJEPo9qoy8lh71sYMP/2vkvM4w6sie/Tg14i042LYF x2Uuy/r9dbHpGKl/myV29oNzjWOq6OmdZ50u5nR8e9rmqI0vlHSE5l+rdjaIeJzu 6wDlNWYa75YM4wZ3LoEEMR1HqytKdVSi8ZC4pOr5k7jv16VfxGic9VWTUzInMDKu p+qR91Zxyx4m1WNFh7UgRHWCl6oan9w0xoVJctz5JYcCpHj1idgurORm2WpbQyw3 Ek+TqGfjfcMhej2IVyOv3ln64Sz4OepYr99jh+qiSWP2Q7MIAH8Ck/Lrj5KQOg5J 8EiwQbRb1wzCmVRaGzmYZsoKEfCzb4Ep4QwrE93qqg+X0JocoO7ozUPAmRT88dE5 7rKaSgTSjr+4H8hkoU5l3Ddh/toyT/OVzz6wMbDUfsWYDQ24ZNK20/zR76rfJMl6 lALMocu4OUDogBkD4PdMRsNbSeih9xckL8mrBX12UxIpd1+vUXOiAzZouhcbtUKJ /IUvraWNE/02LPPp1Y081QOr3hBbh0YQM3ysLRd0WlO2yKmN7lIGALC2m4qkkGjd wDqJcSlqNS5S2DFux6t0IFXVhEe7YmNSs2aVzUp7hyOEdp3VWO+svzzKb7XGf0Fg lHZkCdeKi2+z58LbnwrBSj4HWPxYaY0swdSBA3QiZbRh4+NEnBTRXSgCOGH5B+NT rlpF/H2JErIgFxPHB6/g =EZUv -----END PGP SIGNATURE----- --3CkIdWbMrfvRR1iIikwIRXL5ePcOdcg3I-- --===============0633226910== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0633226910==--