public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Ferreri Tonello <eu@felipetonello.com>
To: Clemens Ladisch <clemens@ladisch.de>, linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Felipe Balbi <balbi@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Robert Baldyga <r.baldyga@samsung.com>
Subject: Re: [PATCH 1/2] usb: gadget: f_midi: refactor state machine
Date: Wed, 23 Dec 2015 11:50:15 +0000	[thread overview]
Message-ID: <567A8A77.4000504@felipetonello.com> (raw)
In-Reply-To: <5679840F.5010805@ladisch.de>

[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]

Hi Clemens,

On 22/12/15 17:10, Clemens Ladisch wrote:
> Felipe F. Tonello wrote:
>> This refactor includes the following:
>>  * Cleaner state machine code;
> 
> It does not correctly handle system real time messages inserted between
> the status and data bytes of other messages.

True, thanks for pointing that out. I fixed that on next revision of
this patch.

> 
>>  * Reset state if MIDI message parsed is non-conformant;
> 
> Why?  In a byte stream like "C1 C3 44", where the data byte of the first
> message was lost, the reset would also drop the second message.

True. That was fixed as well.

> 
>>  * Fixed bug when a conformant MIDI message was followed by a non-conformant
>>    causing the MIDI-USB message to use old temporary data (port->data[0..1]),
>>    thus packing a wrong MIDI-USB request.
> 
> Running status is feature.

What do you mean by that? I don't qualify writing a *wrong* MIDI-USB
packet because of a previous MIDI message as a feature.

For instance, try this MIDI message:
"8A 54 24 00 40"

It will be converted to MIDI-USB as "08 8A 54 24 08 8A 00 40" which is
wrong. It should only be "08 8A 54 24" and ignore the "00 40" MIDI bytes.

On every state byte the message should basically reset data[0..1] to
zero overwriting previous data. This should also be true when a MIDI-USB
packet is complete.

Felipe

[-- Attachment #2: 0x92698E6A.asc --]
[-- Type: application/pgp-keys, Size: 7310 bytes --]

  reply	other threads:[~2015-12-23 11:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22 16:08 [PATCH 1/2] usb: gadget: f_midi: refactor state machine Felipe F. Tonello
2015-12-22 16:08 ` [PATCH 2/2] usb: gadget: f_midi: added spinlock on transmit function Felipe F. Tonello
2015-12-25  8:03   ` Peter Chen
2015-12-22 17:10 ` [PATCH 1/2] usb: gadget: f_midi: refactor state machine Clemens Ladisch
2015-12-23 11:50   ` Felipe Ferreri Tonello [this message]
2015-12-23 21:46     ` Clemens Ladisch
2015-12-22 17:49 ` Felipe Balbi
2015-12-23  9:19   ` Felipe Ferreri Tonello

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=567A8A77.4000504@felipetonello.com \
    --to=eu@felipetonello.com \
    --cc=balbi@ti.com \
    --cc=clemens@ladisch.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=r.baldyga@samsung.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox