Releasing QMI IOCTL driver, EM7565 on USB

Hi there,

I am trying to understand if I’m doing this wrong or I have misunderstood how this works.
I have added rules in the UDEV to send notifications to my application when the modem is attached and detached. That seems to work ok. I get the notification from the UDEV and I close the handle that I was given earlier, which requested the IOCTL_QMI_GET_SERVICE_FILE.
However on detach the driver I get a lot of warnings “cdev in use by 1 tasks” and looking at the drivers, it’s in the function DeregisterQMIDevice.
It loops around there for a while, either until it times out at 30 seconds or if I kill my app.

So just sitting here and thinking about it right now, do I really have to put all QMI access into some separate task that can be killed when I’m done and want to close down the interface?
Isn’t there a better and more elegant way of telling the GobiNet driver that I’m done with the resource? I don’t seem to be able to find any IOCTL call that releases it?

Btw, I’m using the QMI drivers S2.37N2.57