From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH 6/6] drm/omap: protect omap_crtc's event with event_lock spinlock Date: Mon, 14 Apr 2014 15:36:12 +0300 Message-ID: <534BD63C.5050708@ti.com> References: <1397201015-2807-1-git-send-email-archit@ti.com> <1397201015-2807-7-git-send-email-archit@ti.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0038046506==" Return-path: Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CAAB6E77C for ; Mon, 14 Apr 2014 05:36:16 -0700 (PDT) In-Reply-To: <1397201015-2807-7-git-send-email-archit@ti.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Archit Taneja Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0038046506== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0TajQQKx5e7m1DJDhW2lc1Gw3VauVedRW" --0TajQQKx5e7m1DJDhW2lc1Gw3VauVedRW Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 11/04/14 10:23, Archit Taneja wrote: > The vblank_cb callback and the page_flip ioctl can occur together in di= fferent > CPU contexts. vblank_cb uses takes tje drm device's event_lock spinlock= when > sending the vblank event and updating omap_crtc->event and omap_crtc->o= d_fb. >=20 > Use the same spinlock in page_flip, to make sure the above omap_crtc pa= rameters > are configured sequentially. >=20 > Signed-off-by: Archit Taneja > --- > drivers/gpu/drm/omapdrm/omap_crtc.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omap= drm/omap_crtc.c > index d74c72c..9c7af42 100644 > --- a/drivers/gpu/drm/omapdrm/omap_crtc.c > +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c > @@ -350,6 +350,7 @@ static int omap_crtc_page_flip_locked(struct drm_cr= tc *crtc, > struct drm_device *dev =3D crtc->dev; > struct omap_crtc *omap_crtc =3D to_omap_crtc(crtc); > struct drm_gem_object *bo; > + unsigned long flags; > =20 > DBG("%d -> %d (event=3D%p)", crtc->fb ? crtc->fb->base.id : -1, > fb->base.id, event); > @@ -359,9 +360,12 @@ static int omap_crtc_page_flip_locked(struct drm_c= rtc *crtc, > return -EINVAL; > } > =20 > + spin_lock_irqsave(&dev->event_lock, flags); > + > omap_crtc->event =3D event; > omap_crtc->old_fb =3D crtc->fb =3D fb; > =20 > + spin_unlock_irqrestore(&dev->event_lock, flags); There's if (omap_crtc->old_fb) just above the code you changed. Shouldn't that also be inside the spinlo= ck? Also, the description contains a few typos. Tomi --0TajQQKx5e7m1DJDhW2lc1Gw3VauVedRW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQIcBAEBAgAGBQJTS9Y8AAoJEPo9qoy8lh71VWEP/RyPhPjG1+y30X6E62fIeTAM jrfHGGfW0FoExjvWRDlN06Vu3JhhXBoN8xJ+yP6uEu4bTB/sA99+KwrMrhgQNkpY J6cg+saHCnPWP7YKXd0gDzakH+ZG8xjvqBSmuUna3WsyeQHZ8zO8PDCQLwnNq/K5 cZVLtBbeME6m4Duv6CWmEf9ou2uLKivrYBLo1FouahuSFI+t8J2xxMEe2VZZQQn+ w3Vz7YHjjtQP3sWyvOuJlfH7j9flpq5WJ5DSW6IVFS0H72qM0i/FbFMtSXagErK0 In793zWXgDV+DA5/VJbovyIY4ey2yC2N9hkybn9qomtYPIju+IWV6CnF9w3cENyW XK9YXZCIXAAIm2/BTgw1MPOeG82t8REmKnV0venQcx1piVmodNl7TA86rZ7kmM1o ix03lI57aHoZzP2gwr+A1QYRyaIRjJLCkoaJ5meyhV5JP4jVTjk4whUapdpBP5Jc AmXKsFRpVDVJFuxWJ8NxYT2wxwo0MUqI9y+P7K3zrTCq4Muji33b9Xa4uS9rNak4 3FemcD0oHMXKADl2qTb9aroVIRVr3Oe1NQ5fHteLUPOL8iTh/2oVOzAmY4p+kLg/ y2Z81/Q5AzG5aIqtmg1jjowbIBclZ5bFEnkbeK4LkFZhZAue+MQgyX+Op1TJ9apm cLPUEYulV2K2nepjV62t =I6OU -----END PGP SIGNATURE----- --0TajQQKx5e7m1DJDhW2lc1Gw3VauVedRW-- --===============0038046506== 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 --===============0038046506==--