From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [Intel-gfx] [RFC v2 1/4] drm: Add support to find drm_panel by name Date: Fri, 16 Jan 2015 13:19:04 +0100 Message-ID: <20150116121902.GE4885@ulmo.nvidia.com> References: <1420206085-2913-1-git-send-email-shobhit.kumar@intel.com> <1420206085-2913-2-git-send-email-shobhit.kumar@intel.com> <87a91syv7h.fsf@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1703835963==" Return-path: 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: Daniel Vetter Cc: Jani Nikula , Shobhit Kumar , intel-gfx , dri-devel , Andrzej Hajda , jacob.jun.pan@intel.com, Daniel Vetter List-Id: dri-devel@lists.freedesktop.org --===============1703835963== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G6nVm6DDWH/FONJq" Content-Disposition: inline --G6nVm6DDWH/FONJq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 13, 2015 at 12:08:11AM +0100, Daniel Vetter wrote: > On Fri, Jan 9, 2015 at 1:50 PM, Jani Nikula wrote: > > I have a slightly uneasy feeling about handing out drm_panel pointers > > (both from here and of_drm_find_panel) without refcounting. If the panel > > driver gets removed, whoever called the find functions will have a > > dangling pointer. I supposed this will be discussed on drm-devel. >=20 > There's been some discussion already about exactly this problem (but > with drm bridges) with Thierry and some other people. Cc'ed them all > hopefully. Especially when the panel/bridge is a separate driver > there's imo indeed an issue. I posted patches some time ago to create a generic registry to do the actual ref-counting[0]. It didn't seem to be very well received by Greg for the core, so perhaps we could test-drive it in DRM first for panels and bridges and once it's matured a bit it could still be promoted to the driver core, or maybe lib/. The difficult part about it is that while reference counting gives you the benefit of keeping a valid pointer around, you may still want to have a method of getting notified of the panel going away. I've thought a bit about that and I think we could probably integrate that into the registry, since that will notice anyway. Thierry [0]: http://www.spinics.net/linux/lists/kernel/msg1859333.html --G6nVm6DDWH/FONJq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUuQG2AAoJEN0jrNd/PrOhSO0QAK1H1UXgccRKe5dreKf79ESf 7X0LQi7S3/9Iq26I1LANXkjsICz+u6M6h/Z1wGgcGyDl2n/6FTVPO2VH2xtgKQ8K gNJnL3U+uS55sIT15oUkVMlBrCVGKkG6Y7R6w6lJabwh/qGgJs5zYStVf0QnJwwY Y7Ug2ZUWh8VSZKMqZVLeD0NHXMWNVO0RCQlZXUa8+7E2QkM5C9PEc7ESHoF2lBAr Ym4vs5WV7wkQM4byfMGz6C24Dgss37lSPTibOW7WSJYvzPRO8Kkl8sWvZ6foHhMs 4t4NjHt66DWiOmMEYID5f3Who6sZhAZmiokIDLu7cLgdAyhj1h/HW+TLMhyeMwxc jBK3FGO2V+/eHAzdZsp9y5JEfH8xltikVIDIjRLIxUDkNOWFL6h5yDxLrDebEUAZ 1jSA4Yvq4KVEAUwtuZlfKoHzd7XbOo/kt7kEH0Bd0nMxjrvtjJWJ6Q9KlgeBd4T4 cdZCyEIldqo588aQFgt5RB08SQHX7DyEvgc/nwCtYhuqzEcl3OpQi3wwSqcEyxtL tXilrPyJrhchg8qN+Jryd3HvsVnQNkVZWebjFh4IS8k9vvITyPjaQ37SrTix+fmq MEo7aJVaHFYfadKPD+z+mwZiO+kCLzlT1SK7sLyBrhfPZN5mtRxNVCX9WUryr9Hz cOmPqCvFRDgDAAdyu927 =H4hG -----END PGP SIGNATURE----- --G6nVm6DDWH/FONJq-- --===============1703835963== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============1703835963==--