Received: by 10.213.65.68 with SMTP id h4csp1450151imn; Mon, 19 Mar 2018 04:38:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELvY/lSJ38W2EMug0Kydod/hikpWPIevsK8tFsBwo4LVNOVFnfFHtpw2Wlm+XUjc9QYePUG7 X-Received: by 10.98.234.22 with SMTP id t22mr10019388pfh.56.1521459525641; Mon, 19 Mar 2018 04:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521459525; cv=none; d=google.com; s=arc-20160816; b=mGOJ3xKgYv67vjLsqgRQq1KP7nBe/5Bp7lGl+DOnlz0CajhaDBXqBYXc7iyrZhBGFg oHDNzvokLtvbsCDvhNsSWE3L+OzWk8d9trnSjzx+PGNWUEfTv8iTmFK34+udqG6c+DKZ AGzN591ziUZ8n2JhY5L2KH2yfiBEMeXVnOGI+FIHis8UwX2pNhsqhP87KcjOOc3w9rTE +iU7Jv5y4Dxj6Nir3v0O3dck6L35Ym248KCJt0BPsfQV5PTEsNB6nl5FMGqZWYCEBDop yLG7+zlv6Gu3t8ftpn71TZkGXSkwbZZXew/zMrLaDshjMJZjnCCtui1/6/nU6w7pg/Qy Txig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=Cjee1UaGzlTS7N72NZz6Y4+paHPkGhCMq9AmcgG2LLg=; b=mwZoEpPl/jLmLUaRfBNto0eTyA/WKns1fk/RLuepKIgQddQ06QhdiDTVJsqAH0rB3e xGHnbejEyT5br1Zxhyw3eh9pal/887qYyMLYD2Em9/X+DHzYhg/twsseeAFfiVvdk2a3 IxtIUmdWWS2WlcoXf4O/5LvvnnMv2EbKu2dCYFojkGhCJp8OdutZGDUOzLNfVS5TbT3m cULYkiV8t69S6mYqAI6nKY4EuDsEIK9ruzFyk4e5s2CfkB/aEtHNSnxOqvChYgi/fa8q KkQhpdhWAyLieL9tLr0bCv6HBLVU0iXXk17oxdc+D/rvFGxopSPikVHT+85L+Gvd8Qmn su8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1-v6si12180431pld.75.2018.03.19.04.38.31; Mon, 19 Mar 2018 04:38:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932496AbeCSLg2 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Mar 2018 07:36:28 -0400 Received: from smtprelay.synopsys.com ([198.182.60.111]:45331 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755327AbeCSLgY (ORCPT ); Mon, 19 Mar 2018 07:36:24 -0400 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 6D16210C07B0; Mon, 19 Mar 2018 04:36:24 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 57DE23F21; Mon, 19 Mar 2018 04:36:24 -0700 (PDT) Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id 447563F20; Mon, 19 Mar 2018 04:36:24 -0700 (PDT) Received: from AM04WEHTCA.internal.synopsys.com (10.116.16.190) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 19 Mar 2018 04:36:24 -0700 Received: from AM04WEMBXA.internal.synopsys.com ([fe80::79c3:55f2:1f20:5bf4]) by am04wehtca.internal.synopsys.com ([::1]) with mapi id 14.03.0361.001; Mon, 19 Mar 2018 15:36:21 +0400 From: Minas Harutyunyan To: Felipe Balbi , Minas Harutyunyan , Roger Quadros CC: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] usb: dwc3: Prevent indefinite sleep in _dwc3_set_mode during suspend/resume Thread-Topic: [PATCH v2] usb: dwc3: Prevent indefinite sleep in _dwc3_set_mode during suspend/resume Thread-Index: AQHTt7VttcDOmDIowUqzUI1Hi/JpmA== Date: Mon, 19 Mar 2018 11:36:20 +0000 Message-ID: <410670D7E743164D87FA6160E7907A560113ABC945@am04wembxa.internal.synopsys.com> References: <1519730526-22274-1-git-send-email-rogerq@ti.com> <69517684-bd39-e945-0c9e-ccd52b8050d5@ti.com> <87y3isffog.fsf@linux.intel.com> <5ea0ad17-d538-72ec-ed59-004242c4cd26@ti.com> <410670D7E743164D87FA6160E7907A560113ABB478@am04wembxa.internal.synopsys.com> <87zi38438h.fsf@linux.intel.com> <410670D7E743164D87FA6160E7907A560113ABBA4B@am04wembxa.internal.synopsys.com> <87d100qwc5.fsf@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.116.70.62] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 3/19/2018 12:55 PM, Felipe Balbi wrote: > > Hi, > > Minas Harutyunyan writes: >>>>>>> Thanks for picking this for -next. >>>>>>> Is it better to have this in v4.16-rc fixes? >>>>>>> and also stable? v4.12+ >>>>>> >>>>>> Well, there was no "Fixes: foobar" or "Cc: stable" lines in the commit >>>>>> log ;-) >>>>>> >>>>>> The best we can do now, is wait for -rc1 and manually send the commit to >>>>>> stable. >>>>>> >>>>> >>>>> That's fine. Thanks. >>>>> >>>> >>>> Same issue seen in dwc3_gadget_ep_dequeue() function where also used >>>> wait_event_lock_irq() - as result infinite loop. >>> >>> how did this happen? During rmmod dwc3? Or, perhaps, after you unloaded >>> a gadget driver? >>> >> No, not during rmmod's. >> We using our internal USB testing tool. Test case; ISOC OUT, transfer >> size N frames. When host starts ISOC OUT traffic then the dwc3 based on >> "Transfer not ready" event in frame F starts transfers staring from >> frame F+4 (for bInterval=1) as result 4 requests, which already queued >> on device side, remain incomplete. Function driver on some timeout >> trying dequeue these 4 requests (without disabling EP) to complete test. >> For IN ISOC's these requests completed on MISSED ISOC event, but for >> ISOC OUT required call dequeue on some timeout. > > okay > >>>> Actually to fix this issue I updated condition of wait function >>>> from: >>>> !(dep->flags & DWC3_EP_END_TRANSFER_PENDING) >>>> to: >>>> !(dep->flags & DWC3_EP_END_TRANSFER_PENDING & DWC3_EP_ENABLED) >>> >>> you're not fixing anything. You're, essentially, removing the entire >>> end transfer pending logic. >> yes, you are right, but how to overcome this infinite loop? Replace >> wait_event_lock_irq() by wait_event_interruptible_lock_irq_timeout()? > > The best way here would be to figure why we're missing command complete > IRQ in those cases. According to documentation, we *should* receive that > interrupt, so why is it missing? > Additional info on test. Core configuration is HS only mode, test speed HS, core version v2.90a. Maybe it will help to understand cause of issue. BTW, currently to pass above describe ISOC OUT test we just commented wait_event_lock_irq() in dwc3_gadget_ep_dequeue() function and successfully received request completion in function driver. Thanks, Minas