Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752639AbbDBAZh (ORCPT ); Wed, 1 Apr 2015 20:25:37 -0400 Received: from mail-bn1on0144.outbound.protection.outlook.com ([157.56.110.144]:36936 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751576AbbDBAZf (ORCPT ); Wed, 1 Apr 2015 20:25:35 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; ti.com; dkim=none (message not signed) header.d=none; Date: Thu, 2 Apr 2015 08:23:49 +0800 From: Peter Chen To: "Baxter, Jim" CC: Robert Baldyga , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "Zapolskiy, Vladimir" , "balbi@ti.com" Subject: Re: usb: gadget: f_fs: O_NONBLOCK waits MAX_SCHEDULE_TIMEOUT Message-ID: <20150402002348.GA10964@shlinux2> References: <551AED33.2040206@mentor.com> <551BA70B.1090706@samsung.com> <551C2AE1.9000608@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <551C2AE1.9000608@mentor.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(189002)(199003)(24454002)(51704005)(33716001)(77156002)(50986999)(92566002)(86362001)(85426001)(97756001)(6806004)(54356999)(76176999)(23726002)(47776003)(87936001)(62966003)(33656002)(50466002)(104016003)(46406003)(106466001)(83506001)(110136001)(46102003)(77096005)(2950100001);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR03MB061;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB061; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006);SRVR:SN2PR03MB061;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB061; X-Forefront-PRVS: 0534947130 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2015 00:25:32.1269 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB061 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1172 Lines: 37 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? > > 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. -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/