The first two patches are cleanups, the second two attempt to fix the deadlock on the prime lock, in the failure paths. Patch 3 is based on a proposal from Daniel Vetter. I've ran these under virgl and I can't reproduce the deadlock there. Dave.