From: Pavel Machek <pavel@ucw.cz>
To: ofono@ofono.org
Subject: Re: Reason ofono flakeyness
Date: Fri, 25 Jan 2019 17:29:05 +0100 [thread overview]
Message-ID: <20190125162905.GA7647@amd> (raw)
In-Reply-To: <20190120155529.GE5540@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 1784 bytes --]
Hi!
> > > OK I think I found the reason fo ofono doing a variable
> > > number of commands on start-up with sudo test/enable-modem.
> > >
> > > There seems to be some kind of issue with handling of
> > > commands and results in ofono. See the logs below for
> > > test/enable-modem. The AT+SCRN=0 is sent and then AT+CFUN=1
> > > without waiting for results from the previous command :)
> > >
> > > Is there maybe a missing sync somewhere after writes?
> >
> > No idea. I just copied the code from other drivers and it seemed to
> > work for me.
>
> Yeah presumably that works for serial ports.
Still not sure what is going on there. Part of the problem seems to be
ofono expects serial protocol, and will happily split & batch things
together, but motmdm is really packet-based.
Few questions:
drivers/mfd/motorola-mdm.c:
/* Prepend Motorola custom packet numbering */
snprintf(cmd, cmdlen, "U%04i%s\r", mot_dlci->id, buf);
We already have \r or \n from the user. Will this add extra one?
I guess this will not work with embedded zero bytes...
Plus it seems kernel auto-splits stream from user into packets...
motmdm_cdev_write:
static ssize_t motmdm_cdev_write(struct file *file, const char __user
*buf,
...should it work byte-by-byte? This way if userland sends
AT+FOO=1\rAT+BAR=2\r, it will be sent as a single packet, which is
probably wrong thing to do.
...should it also treat ^Z as an end of packet? In case of SMS
sending, AT+GCGMS= should go in one packet and hex data in another
one, if I understand things correctly....
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
parent reply other threads:[~2019-01-25 16:29 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20190120155529.GE5540@atomide.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190125162905.GA7647@amd \
--to=pavel@ucw.cz \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.