On Mon, Mar 29, 2021 at 8:01 PM Noralf Trønnes <noralf@xxxxxxxxxxx> wrote: > Free transfer and compression buffers on device removal instead of at > DRM device removal time. This ensures that the usual 2x8MB buffers are > released when the device is unplugged and not kept around should > userspace keep the DRM device fd open. > > At least Ubuntu 20.04 doesn't release the DRM device on unplug. > > Signed-off-by: Noralf Trønnes <noralf@xxxxxxxxxxx> Interesting, we have exactly the same thing with a shim device staying around for open file handles after the actual physical device dies in gpiolib. I guess this is a common problem. Connect the buffer allocations to the device which will use them not the userspace facing device, indeed. Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Yours, Linus Walleij