From: Toby Gray <toby.gray-BiNz9QiKYoNBDgjK7y7TUQ@public.gmane.org>
To: Alexey Orishko <alexey.orishko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Toby Gray <tg-BiNz9QiKYoNBDgjK7y7TUQ@public.gmane.org>,
Oliver Neukum <oliver-Q6YOFhsQ4GZ7tPAFqOLdPg@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/5] usb: cdc-ncm: Set altsetting only when network interface is opened
Date: Fri, 17 Feb 2012 10:31:14 +0000 [thread overview]
Message-ID: <4F3E2C72.8000207@realvnc.com> (raw)
In-Reply-To: <CAL_Kpj01s=jCr5wkyaLanFUGFO4bsUcgHt+vP9W9mKAPA4Sh5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 17/02/12 09:57, Alexey Orishko wrote:
> On Wed, Feb 15, 2012 at 3:47 PM, Toby Gray<toby.gray-BiNz9QiKYoNBDgjK7y7TUQ@public.gmane.org> wrote:
>
>> Some NCM devices fail to send the NetworkConnection status if the host
>> is not trying to read from the control interrupt endpoint in the first
>> few seconds after the data interface alternate setting is selected.
> I have a feeling that the problem description above is not correct:
> more likely the fault is related to device initialization or other
> state machine problem in device.
I think I've been explaining my understanding badly and we actually
agree :) I imagine that the device has code something like the following
in it's initialization code:
void handle_set_alternate_setting(int altsetting) {
if (altsetting == 0) {
reset_interface_configuration();
} else if (altsetting == 1) {
queue_networkconnection_notification(DISCONNECTED, 1000MS_TIMEOUT);
//ignore timeout in sending notification
queue_speed_configuration_notification(tx_speed, rx_speed,
1000MS_TIMEOUT);
//ignore timeout in sending speed configuration
queue_networkconnection_notification(CONNECTED, 1000MS_TIMEOUT);
// ignore timeout in sending notification
}
}
Is that the sort of behavior you were thinking of?
> Looking at the trace, the patch serves its purpose, however there
> might be other devices which can't get network status in time or get
> similar problem. If this would be the case, driver could set a timer
> after selecting alt1; in the absence of the connect message set alt0
> to reset a function when timer expires and set alt1 again.
I might be overly cautious but this behavior sounds like it could impact
reliability. All my patch series does is keep the device in the reset
alternate setting until the network interface comes up. My understanding
is that this won't impact CDC NCM devices which queue the network
notifications indefinitely and it solves the issue for the device I'm
having issues with.
My reading of the CDC NCM specification is that it doesn't give any
timing constraints on when a NetworkConnection notification can come
from the device. You mentioned that 3G modems can take 1-2 minutes, so
if some sort of timer was added after selecting alt1, what value could
be used for it which would work reliably with all NCM CDC devices? Also
what devices could we test this timer code on?
Regards,
Toby
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-02-17 10:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-15 14:47 [PATCH 0/5] Delay selecting alternate setting in CDC NCM until network interface is raised Toby Gray
2012-02-15 14:47 ` [PATCH 1/5] usb: cdc-ncm: Change alternate setting magic numbers into #defines Toby Gray
[not found] ` <1329317261-3406-2-git-send-email-toby.gray-BiNz9QiKYoNBDgjK7y7TUQ@public.gmane.org>
2012-02-16 18:34 ` Alexey Orishko
[not found] ` <1329317261-3406-1-git-send-email-toby.gray-BiNz9QiKYoNBDgjK7y7TUQ@public.gmane.org>
2012-02-15 14:47 ` [PATCH 2/5] usb: cdc-ncm: Set altsetting only when network interface is opened Toby Gray
[not found] ` <1329317261-3406-3-git-send-email-toby.gray-BiNz9QiKYoNBDgjK7y7TUQ@public.gmane.org>
2012-02-17 9:57 ` Alexey Orishko
[not found] ` <CAL_Kpj01s=jCr5wkyaLanFUGFO4bsUcgHt+vP9W9mKAPA4Sh5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-17 10:31 ` Toby Gray [this message]
2012-02-15 14:47 ` [PATCH 3/5] usb: usbnet: Allow drivers using usbnet to specify maximum packet size Toby Gray
[not found] ` <1329317261-3406-4-git-send-email-toby.gray-BiNz9QiKYoNBDgjK7y7TUQ@public.gmane.org>
2012-02-15 19:35 ` Oliver Neukum
2012-02-15 14:47 ` [PATCH 4/5] usb: usbnet: Add validation of dev->maxpacket to usbnet Toby Gray
2012-02-15 19:34 ` Oliver Neukum
[not found] ` <201202152034.03000.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2012-02-16 10:55 ` Toby Gray
2012-02-15 14:47 ` [PATCH 5/5] usb: cdc-ncm: Allow NCM driver to determine dev->maxpacket Toby Gray
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=4F3E2C72.8000207@realvnc.com \
--to=toby.gray-binz9qikyonbdgjk7y7tuq@public.gmane.org \
--cc=alexey.orishko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=oliver-Q6YOFhsQ4GZ7tPAFqOLdPg@public.gmane.org \
--cc=tg-BiNz9QiKYoNBDgjK7y7TUQ@public.gmane.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.