From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH v3 06/10] drm/fb-helper: Support deferred setup Date: Wed, 22 Mar 2017 22:06:20 +0100 Message-ID: <20170322210620.GA15392@ulmo.ba.sec> References: <20170321081358.27237-1-thierry.reding@gmail.com> <20170321081358.27237-7-thierry.reding@gmail.com> <20170321101022.7u4nmhqiuknly4jk@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2055776806==" Return-path: In-Reply-To: <20170321101022.7u4nmhqiuknly4jk@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Daniel Vetter Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============2055776806== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 21, 2017 at 11:10:22AM +0100, Daniel Vetter wrote: > On Tue, Mar 21, 2017 at 09:13:54AM +0100, Thierry Reding wrote: [...] > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_h= elper.c [...] > > @@ -2437,11 +2476,16 @@ EXPORT_SYMBOL(drm_fb_helper_initial_config); > > int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) > > { > > struct drm_device *dev =3D fb_helper->dev; > > + unsigned int width, height; > > int err =3D 0; > > =20 > > if (!drm_fbdev_emulation) > > return 0; > > =20 > > + if (fb_helper->deferred_setup) > > + return drm_fb_helper_initial_config(fb_helper, > > + fb_helper->preferred_bpp); >=20 > I think this must be moved under the protection of ->lock, you might race > otherwise (e.g. hpd vs. userspace forcing a re-probe, both noticing the > change). I think I had originally put this under the lock only to see that result in a deadlock. I can't quite remember why that was, but testing shows that this still happens. It's getting rather late, so I'll have to defer tracking this down to tomorrow. Thierry --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAljS50kACgkQ3SOs138+ s6F8QxAAp4sK7wLTzJwZjnMA7tT84HqDtONKoBIQA/i7QewxGk5/QW1BvNJxae/V R9J8veMw4XmQHaWfGe9ZJlCDD1IXUca7Nl9hIn54LOFpWbfVq8mLjuU6XawkzhDm gFWy1YyvoMGUHm9b5h2TNt43VLmlfmx27TZ0Nxx3dU1+BHFc5AkdEAaHaeavxCNw zg8hP4se6NBuQY6Y6+SMkvti52xLDIApQGzY2sa/FyF8oLTzPW/PuqoizdsaVGTG vqUx7tP6cAYbyqjS34aXJPmB0NmAKtMZDVpyUy2MK1eXeL0mH82po/oh2ZzdtzNR GRNSNhgBu3kRCttOxs+HGv3WGtZAvJDofufcPDuqj2vxYwO1e4tqwOKoWFOC6Lfw 9ZW1uVopuWT7KjCHxWRpR6Psuov9KrXgZPZZuQ2iILJIDJ+gf+3jRr3jkNUR8xS/ 0XH6D2KytEvavYSrObhgNCYZ/+AHs86K1aA8xp2ukTNFQZd1tR69eGZLR1c+YXoV 2uhd4Qy5R4rbJTAX01s3GcdAQEllUQQFpegS6f6edKXTROmI7JgH6MRP0rZI+Cjp K70BWEFrMRNgxi2RDN2uFD4X6g4McZpRzX2lE4+zuzYQ7tUURjoxz5H0MHwlyD+Y uIXTtH7zC0ZL6M5xoocF/BF0bBA2B1yD3FHVoYL8Sc0K5G1V3/I= =9jg/ -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0-- --===============2055776806== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============2055776806==--