<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hey Daniel, back from vacation and going over our last long
thread i think you didn't reply<br>
to my last question bellow (Or at least I can't find it).<br>
</p>
<p>Andrey<br>
</p>
<div class="moz-cite-prefix">On 12/17/20 4:13 PM, Andrey Grodzovsky
wrote:<br>
</div>
<blockquote type="cite" cite="mid:5feff301-0aca-3e07-c1c4-31e4a91fc942@amd.com">
<blockquote type="cite" style="color: #000000;">
<blockquote type="cite" style="color: #000000;">Ok, so I assumed
that with vmap_local you were trying to solve the problem of
<br>
quick reinsertion
<br>
of another device into same MMIO range that my driver still
points too but
<br>
actually are you trying to solve
<br>
the issue of exported dma buffers outliving the device ? For
this we have
<br>
drm_device refcount in the GEM layer
<br>
i think.
<br>
</blockquote>
That's completely different lifetime problems. Don't mix them up
<span class="moz-smiley-s1" title=":-)"><span>:-)</span></span>
<br>
One problem is the hardware disappearing, and for that we <span class="moz-txt-underscore"><span class="moz-txt-tag">_</span>have<span class="moz-txt-tag">_</span></span> to
<br>
guarantee timeliness, or otherwise the pci subsystem gets pissed
<br>
(since like you say, a new device might show up and need it's
mmio
<br>
bars assigned to io ranges). The other is lifetim of the
software
<br>
objects we use as interfaces, both from userspace and from other
<br>
kernel drivers. There we fundamentally can't enforce timely
cleanup,
<br>
and have to resort to refcounting.
<br>
</blockquote>
<br>
<br>
So regarding the second issue, as I mentioned above, don't we
already use drm_dev_get/put
<br>
for exported BOs ? Earlier in this discussion you mentioned that
we are ok for dma buffers since
<br>
we already have the refcounting at the GEM layer and the real life
cycle problem we have is the dma_fences
<br>
for which there is no drm_dev refcounting. Seems to me then that
vmap_local is superfluous because
<br>
of the recounting we already have for exported dma_bufs and for
dma_fences it won't help.
<br>
<br>
Andrey
</blockquote>
</body>
</html>