All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Reason ofono flakeyness
       [not found] <20190120155529.GE5540@atomide.com>
@ 2019-01-25 16:29 ` Pavel Machek
  0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2019-01-25 16:29 UTC (permalink / raw)
  To: ofono

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-25 16:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190120155529.GE5540@atomide.com>
2019-01-25 16:29 ` Reason ofono flakeyness Pavel Machek

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.