Received: by 10.213.65.68 with SMTP id h4csp1536976imn; Mon, 19 Mar 2018 06:56:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELukLucxZ0ViqWqbJuo4i9xZQ0qwut4Fd9/OeRhKZFiPpdzEO2sSi5m5UGBPebBzLsFU+VOK X-Received: by 2002:a17:902:127:: with SMTP id 36-v6mr12662660plb.194.1521467776382; Mon, 19 Mar 2018 06:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521467776; cv=none; d=google.com; s=arc-20160816; b=DmJ92xuq+PSrq9Pa8NEaNXQNDQxPhZ9dDurfwxKYe+95Ndo8fR6cosieab6d2Sin6g poNCeR6Ev0SFasIlL2PUJmO9jwLxr5VqheqHV2qxpeoTC0VUz2sBIOPxRjkIaZpQXghN ab28PA2lzgdbUtC3qFMguKOYcfDTB7PuW2RgwQVCWsB6PeQZe3Xtipp2COT6An4whDmu X7x3ceaGO+zXVkhSrramamIaThsHf0jxUzstuar5m1sZJ1jI6FpXZOT71kNDzBUFJlAa rBlLstmoQizEn6KNoMg5Bac8cFqaZD7YAVSS1kelCy/B/dtcLSSHrKdkrxnFOjmuKGCS r2zA== 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=wTNd4wWQosyJtoTE2JNgGPhYSppOpUZ9u6MpaknV1Ec=; b=JsOxsMrJaXzwg1gawWosfHq/9FvvxeBFB0TlZAgryKlqR5FhVuH0lLQEbv7pIt8CtW ADn+krXpK1LLTqIJ4qK7LhIh8QsgSeQEhWYqG5qbOxGHnu+esU158B3qMwL9JgoeV3dz zFEJpbr11AsI3ltCWNmCnN6oVssBKSaERVC1ZT+eflccYYjKTVcP/DoUKPDmvE8sImti kFD0zESNy4K2G876YiXLgZ/oiHpPRlAexhMxLUJoKaeYxGqhHDFsgg0L3zaUr2JQOgQi OYGmzENMqIiCjWG3AFbcvk/+1idC8kN2kyS+LLdS/089Jw7nEahpTqsoa0UEjdHkNONk pryQ== 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 o13si46637pgd.125.2018.03.19.06.56.02; Mon, 19 Mar 2018 06:56:16 -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 S933438AbeCSNx4 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Mar 2018 09:53:56 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:39865 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933308AbeCSNxv (ORCPT ); Mon, 19 Mar 2018 09:53:51 -0400 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 4B2DB24E12C0; Mon, 19 Mar 2018 06:53:51 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 2FAB73C7F; Mon, 19 Mar 2018 06:53:51 -0700 (PDT) Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) by mailhost.synopsys.com (Postfix) with ESMTP id 115113C7E; Mon, 19 Mar 2018 06:53:51 -0700 (PDT) Received: from AM04WEHTCA.internal.synopsys.com (10.116.16.190) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 19 Mar 2018 06:53:50 -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 17:53:48 +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 13:53:48 +0000 Message-ID: <410670D7E743164D87FA6160E7907A560113ABCA0A@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> <410670D7E743164D87FA6160E7907A560113ABC945@am04wembxa.internal.synopsys.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 3:36 PM, Minas Harutyunyan wrote: > 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 > One more info: while function driver call dequeue, host periodically send control read command to get status of test from function - test In Progress or Finished. Thanks, Minas