QMI fails to release client
Dan Williams
dcbw at redhat.com
Thu Apr 8 14:43:11 UTC 2021
On Thu, 2021-04-08 at 16:18 +0200, Sai Chaitanya wrote:
> Hi again,
>
> The issue seems to have been resolved by including this in open
> flags: QMI_DEVICE_OPEN_FLAGS_SYNC.
>
> So, even though the client release hasn't been smooth, a fresh start
> seems to work normal.
> I am not sure if there are any other downsides of this, but this
> works for now.
I believe this resets firmware and client state, so it's correct to use
it when:
1) the first time the device is opened
2) after the device is unplugged or crashes
if you use OPEN_SYNC outside of those scenarios, you'll terminate any
ongoing network connection and all current firmware/client state. That
may not be a problem for your use-case though.
Dan
> Thanks and regards,
> Sai.
>
> On Thu, Apr 8, 2021 at 2:41 PM Sai Chaitanya
> <msaichaitanya at gmail.com> wrote:
> > Hej, sorry for the delayed reply. I am using libqmi 1.26. Here are
> > some more details about the client allocation issue.
> >
> > Setup: A usb-modem is plugged in and a data connection is started
> > with qmi_client_wds_start_network(). It succeeds and can ping. Now,
> > if the module is suddenly pulled out, the application
> > calls qmi_device_release_client() and qmi_client_wds_stop_network()
> > as a part of exit process and ends up here:
> >
> > > error: couldn't release client: Cannot write message: Error
> > > writing to file descriptor: No such device
> > > error: operation failed: Cannot write message: Error writing to
> > > file descriptor: No such device
> >
> >
> > And when we try to fresh start the data connection after plugging
> > the module back again with qmi_client_wds_start_network()
> > >
> > > error: couldn't create client for the the 'WDS' service: CID
> > > allocation failed in the CTL client: Transaction timed out
> > >
> > So, it looks like some context is not cleaned up smoothly on the
> > modem in this sudden power off situation? Or is there any other
> > exit APIs required to be called in such situations?
> >
> > Regards,
> > Sai.
> >
> > On Mon, Mar 29, 2021 at 3:32 PM Aleksander Morgado <
> > aleksander at aleksander.es> wrote:
> > > Hey,
> > >
> > > >
> > > > Yes it happened after qmi_client_wds_stop_network().
> > > > If I try to use QMI_DEVICE_OPEN_FLAGS_PROXY, it crashes. So I
> > > removed it for now. I may be missing some pre-condition when
> > > using
> > > this flag.
> > > >
> > > > Setup is Linux based, cdc-wdm+qmi_wwan.
> > > >
> > >
> > > Can you debug that crash?, e.g building with debug symbols and
> > > running under gdb
> > >
> > > Also, what libqmi version are you using?
> > >
> > > --
> > > Aleksander
> > > https://aleksander.es
> >
> >
> > --
> >
>
>
> _______________________________________________
> libqmi-devel mailing list
> libqmi-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libqmi-devel
More information about the libqmi-devel
mailing list