linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Baxter, Jim" <jim_baxter@mentor.com>
To: Peter Chen <peter.chen@freescale.com>
Cc: Robert Baldyga <r.baldyga@samsung.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"Zapolskiy, Vladimir" <Vladimir_Zapolskiy@mentor.com>,
	"balbi@ti.com" <balbi@ti.com>
Subject: Re: usb: gadget: f_fs: O_NONBLOCK waits MAX_SCHEDULE_TIMEOUT
Date: Fri, 22 May 2015 12:12:41 +0100	[thread overview]
Message-ID: <555F0F29.1070108@mentor.com> (raw)
In-Reply-To: <20150402002348.GA10964@shlinux2>


> On Wed, Apr 01, 2015 at 06:29:05PM +0100, Baxter, Jim wrote:
>>>
>>> FunctionFS is very specific, because read/write operations are directly
>>> translated into USB requests, which are asynchronous, so you cannot use
>>> O_NONBLOCK.
>>>
>>> If you need non-blocking API you can use Asynchronous I/O (AIO). You can
>>> find some examples in kernel sources (tools/usb/ffs-aio-example/).
>>>
>>> Br,
>>> Robert Baldyga
>>>
>>
>> Thank you, that sounds like the best approach.
>> In this case I think perhaps the long wait without any data is an
>> problem with the imx6 Chipidea USB controller.
> 
> What's the possible problem?

Sorry for the delay in replying, I have been getting some more details
with a USB Analyser.

The scenario is that the NCM  device is enumerating so we see the
messages to:

SetAddress (1)
GetDescriptor (Device)
GetDescriptor (StringN)
GetDescriptor (Configuration)
SetConfiguration (1)
GetDescriptor (String iInterface)
GetDescriptor (String iInterface)

At this point the NCM host sends Writes to the F_FS EP0 but for some
reason the host device does not respond and only issues SOF packets for
hours. This happens occasionally and is fixed by turning the device off
and on again.


Unless I am mistaken from a NCM gadget point of view the attached device
is working correctly and there is no way to know it has failed, is that
correct?

> 
>>
>> I guess it should suspend and drop the connections if there is no
>> traffic for more than 10ms?
>>
> 
> If the Device side NAK host's IN/OUT token continually, the pipe will 
> not be stopped, the host will send token continually until the application
> cancel this request.
> 

  reply	other threads:[~2015-05-22 11:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 18:53 usb: gadget: f_fs: O_NONBLOCK waits MAX_SCHEDULE_TIMEOUT Baxter, Jim
2015-03-31 20:28 ` Felipe Balbi
2015-04-01  8:06 ` Robert Baldyga
2015-04-01 17:29   ` Baxter, Jim
2015-04-02  0:23     ` Peter Chen
2015-05-22 11:12       ` Baxter, Jim [this message]
2015-05-25  1:55         ` Peter Chen
2015-06-01 16:25           ` Baxter, Jim
2015-06-02  3:01             ` Peter Chen

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=555F0F29.1070108@mentor.com \
    --to=jim_baxter@mentor.com \
    --cc=Vladimir_Zapolskiy@mentor.com \
    --cc=balbi@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@freescale.com \
    --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;
as well as URLs for NNTP newsgroup(s).