etnaviv: address space collision with softpin
Currently when softpin aka userspace managed addressspace is used there is a race condition that leads to otherwise valid submits getting rejected by the kernel. The gist of the issue is that the addressblock used by a buffer is freed as soon as the BO is released in userspace, however there might still be GPU jobs in-flight, which keep this block of addressspace in use for a while. If userspace now reuses the freed address space and assigns this addressblock to a different BO the kernel will reject the submit, as it sees that there is still another referenced BO using this space.
The fix is to add some userspace fencing to the BOs, so that the addressblock is only freed after the last job using this BO has completed, which ensures that userspace never passes conflicting requirements to the kernel.
Both @agx and @lynxeye observed this issue and have fixing it somewhere on their TODO list. Whoever gets to look at implementing a fix should assign this issue to himself, to avoid duplicate work being done.