From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH RFC 05/24] Revert "drm: Nerf the preclose callback for modern drivers" Date: Mon, 21 May 2018 12:37:00 -0700 Message-ID: <874lj0u7fn.fsf@anholt.net> References: <20180519065243.27600-1-yuq825@gmail.com> <20180519065243.27600-6-yuq825@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0500255468==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C1B16E2C6 for ; Mon, 21 May 2018 19:37:03 +0000 (UTC) In-Reply-To: <20180519065243.27600-6-yuq825@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org Cc: Simon Shields , Marek Vasut , Connor Abbott , Neil Armstrong , Andrei Paulau <7134956@gmail.com>, Vasily Khoruzhick , Qiang Yu , Erico Nunes List-Id: dri-devel@lists.freedesktop.org --===============0500255468== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Qiang Yu writes: > This reverts commit 45c3d213a400c952ab7119f394c5293bb6877e6b. > > lima driver need preclose to wait all task in the context > created within closing file to finish before free all the > buffer object. Otherwise pending tesk may fail and get > noisy MMU fault message. > > Move this wait to each buffer object free function can > achieve the same result but some buffer object is shared > with other file context, but we only want to wait the > closing file context's tasks. So the implementation is > not that straight forword compared to the preclose one. You should just separate your MMU structures from drm_file, and have drm_file and the jobs using it keep a reference on them. This is what I've done in V3D as well. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlsDH9wACgkQtdYpNtH8 nuiemxAAhmotu1QFiMdgyEdROzfU7mbiSH0ulHNXhDKsQGTGOShTfdGY8OYAqXp4 Ssx2JYETyZqgUQfg7XWpzA/V/VybW98fK3HOwSb+Euqn+C5ft47B9pI+LJeex/mq vP6hFDDkp2bPZZIkYfJpKz1VCZG4Ah9eGZaiXRpsi2RB7Uwm2zJhLbsDJUTj1oDI YpM6LS9v1XUEplIXz4tLfbWyEH/hl2rpdlzApGUJSA8/oPx6VENw6NN8FH2t1adT /qOc4prRXwACw/9ebSIXI9aqA4QRB0BJuilpJMuahrk0EU0d46YI/EmVGEeTdNCL tirqEKotGo5QyYEmdtiN5OohW9Z8zc766FmQGZlJHeV796zF5a6RrJxm5UmWnK3+ tLEJdiSOwYAe/HCnqkRb9+R4gRuL98Joj+mrRS8GvPfylLDIEhWvH/aZekNouJjl TCl4UM0WxAQTGnfpCaNzjZ96R+VYFPvt66KxNgmmnRJ10to4BYbi9ceyfqWA6R5f tLtKoLV//ErjxF6VOJ+wtEhn+nJzNcYjzhULZprQQ+bJue4ksX7OoxK4Wax8jCRc +ctZ0TjCNS5lDfqavp5qEfHcIdwL4TSnXlwzGjj29GBUJ1yUTkaXisElx0iKsDlk 7jTQbLOgpxCerlOfw/LPIJlc2akP2sL66v55FiYVW+12Wi7dB0U= =szk5 -----END PGP SIGNATURE----- --=-=-=-- --===============0500255468== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0500255468==--