From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH 7/9] drm/omap: fix omap_crtc_flush() to handle the workqueue Date: Mon, 8 Sep 2014 16:03:18 +0300 Message-ID: <540DA916.8030601@ti.com> References: <1409745310-19092-1-git-send-email-tomi.valkeinen@ti.com> <1409745310-19092-7-git-send-email-tomi.valkeinen@ti.com> <20140903142750.GT15520@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0486188907==" Return-path: Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AFA26E2A5 for ; Mon, 8 Sep 2014 06:03:24 -0700 (PDT) In-Reply-To: <20140903142750.GT15520@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Daniel Vetter Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0486188907== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FlvOFpHa2VngIOdkbSFgfPg6b77MXFr8G" --FlvOFpHa2VngIOdkbSFgfPg6b77MXFr8G Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 03/09/14 17:27, Daniel Vetter wrote: > On Wed, Sep 03, 2014 at 02:55:08PM +0300, Tomi Valkeinen wrote: >> omap_crtc_flush() is used to wait for scheduled work to be done for th= e >> give crtc. However, it's not quite right at the moment. >> >> omap_crtc_flush() does wait for work that is ran via vsync irq to be >> done. However, work is also queued to the driver's priv->wq workqueue,= >> which is not handled by omap_crtc_flush(). >> >> Improve omap_crtc_flush() to flush the workqueue so that work there wi= ll >> be ran. >> >> This fixes a race issue on module unload, where an unpin work may be o= n >> the work queue, but does not get ran before drm core starts tearing th= e >> driver down, leading to a WARN. >> >> Signed-off-by: Tomi Valkeinen >=20 > I didn't really dig into details, but isn't that the same workqueue as > used by the async modeset code? So the same deadlocks might happen ... Yes, we have just one workqueue in the driver. Hmm, deadlocks with what lock? The modeconfig or crtc->mutex? I don't think they are locked at any place where omap_crtc_flush is called. > lockdep won't complain though since you essentially open-code a > workqueue_flush, and lockdep also doesn't complain about all possible > deadlocks (due to some design issues with lockdep). What do you mean "open-code a workqueue_flush"?. I use flush_workqueue there. We have two things to wait for: work on the workqueue and work which is triggered by the vsync irq. So we loop and test for both of those, until there's no more work. Tomi --FlvOFpHa2VngIOdkbSFgfPg6b77MXFr8G 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 iQIcBAEBAgAGBQJUDakWAAoJEPo9qoy8lh71sCoP/2DWmoHhkcElxR1pTMII+npO Y2g+T9EI70OTokNqQ6ZNTvhvhxZ1bsoUz3iUBqX2Bq9i8LPq8tOxms7Q+YPx0KT7 yYz2N3cHiYRWy0WvwH+3G2HJ57hNMyJLV83/nrJFtxH985QncAyzkxLqmbdOhH9y Q1t2iHZ/2yV/LK6wyMVtb6r1mbPwqAJjSl3IfRq2HcBwmAb5wK9hRHM+yd2yX+B7 /rJ1AmvvbpNSa+2pHXpfDynSBuOEDMcGRBg/BtojywOI7N30gSCUnIgfoCmt6hrw VQ6qLZPiKa+iei+mDTsgZfIIo7hOwJhikEQQYWKi+cbAsPdcp7OmF3zb+8FLMvYd tiiC3wL1CyfbjfVkJCITuoTWVmKcHDm4rZ21xsKEROn2u0GlZL1MXxPGq/C2gBzK Rb04/LZC6J8Fg1qSlZjESoFsyJK1MZy96mkzVcGWbUPQoLcfLNYaTZLB3YCKgES/ 0Zpwx5lrB0Zk9/UqDjwRXH2b3wBeScOTTQ9+5WisclgThP9ybjMA9xM7aqLj/WNZ 2eb2BuHjWimaHRGdM1l3isziwu4myndlLNeoZeHE9VaNdAynjp5oorW9DWIOAazr BHBWN7Pc0K5HZBkLDmQjvQw3OPRPMz3Mf/DooXFswNTgEY5YpPJvQr14sWgiacTK zEmG97+xE72n/UI441bn =OEaF -----END PGP SIGNATURE----- --FlvOFpHa2VngIOdkbSFgfPg6b77MXFr8G-- --===============0486188907== 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 --===============0486188907==--