Received: by 10.213.65.68 with SMTP id h4csp312593imn; Fri, 16 Mar 2018 04:05:02 -0700 (PDT) X-Google-Smtp-Source: AG47ELsPHLQWSHaYAXSop+SbSHxoW2kIgAUrOWAJFeIMam0hX7zV0UMeEfJBegIFEL/SylyMm6lX X-Received: by 2002:a17:902:678f:: with SMTP id g15-v6mr1727428plk.120.1521198302865; Fri, 16 Mar 2018 04:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521198302; cv=none; d=google.com; s=arc-20160816; b=WzvLZcE5A/SJiEpKJasy5/11Rbf18LcXabxYTqwmwVxlSKrS+O4+GBpVZNFPCorOZn +fOSJqLV7vrDWWuNhdQ+3AxPZAHSQN4wlBRtybHkdM3xEyAJ4oWTXYOuREmqDmKoCZq9 lZy3pyI1gDnt2tpLc7P91kkEXo+i/mkxQkANncfii2blsKYsFGOscoy5JnPPsm/b2PDI 9zuJe4vs/LB0c3CEhm34HdXxpcF1BCEaz1Vun2KPEmrbVaL+UcybPEUV11QGNqddhgjG i1gnVOhV2u3RZKVSUXD9oDFOGRIUb1EYakAyZZmQmqqijB19d+qyt8GHp6tSZz2AZC8B E0TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=fIxWJ6xtV1Feaqf+DW6HBcs9tGIF+Cz5JiwPrL0+lPc=; b=J1jGOPI5VqxEUVYxsofGgMoi+uavFyT3WvLf/cO4eodKtoP+zca2oNL1lliLQ8Ci2m nnAsbAMPl3Ehv34rgzGi+nl4xn9TLrvvJbXh/wcu1kQQvfu2wZ3ohUCyg+aJifbbC2GH ps+TMEfS42EWOzlEgA3UKYiSCM7Kn06vX1/EKwkNGaVkouFwxiziBSd1Aq/IcJQ40ZD0 vYpJErB8MMS/sfR7QJaje8O/pV7K3+yznKn0coeWDHOVrCloBhTMIR7oABuyDKBFulpk 5WAcUWcKeaJZUXXCSl9qoGbK5Pe7f728Y8/Z54Lzld8egymiu2ISqme6ZFs90tejlZV3 YAuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=sCu3VEVD; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si4783301pgv.476.2018.03.16.04.04.48; Fri, 16 Mar 2018 04:05:02 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=sCu3VEVD; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753835AbeCPLDS (ORCPT + 99 others); Fri, 16 Mar 2018 07:03:18 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:62380 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753819AbeCPLDQ (ORCPT ); Fri, 16 Mar 2018 07:03:16 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w2GB3E2S030376; Fri, 16 Mar 2018 06:03:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1521198194; bh=Or/yYVU6xK+Iw/QPJOGJfbCttp0EzUpsohiP1PYOSNc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=sCu3VEVD74S5z+vyjevxmflNJTUqDXmMki5G+3bIm3AlxkLsZbxu+Q6DSn97f+FwM iazSO0vHgWbTKCqf7ArFYnxcXSUlA0Q+fS6Vp6dUp7WNGuBuABVHWtDhZQYs6YGlgg lcjECneU0qKXTdGr7HbYu09bcTBgR8afqW6xKUjY= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w2GB3EeK032630; Fri, 16 Mar 2018 06:03:14 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Fri, 16 Mar 2018 06:03:14 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Fri, 16 Mar 2018 06:03:14 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w2GB3DjB019211; Fri, 16 Mar 2018 06:03:13 -0500 Subject: Re: [PATCH v2] usb: dwc3: Prevent indefinite sleep in _dwc3_set_mode during suspend/resume To: Felipe Balbi CC: , References: <1519730526-22274-1-git-send-email-rogerq@ti.com> <69517684-bd39-e945-0c9e-ccd52b8050d5@ti.com> <87y3isffog.fsf@linux.intel.com> From: Roger Quadros Message-ID: <5ea0ad17-d538-72ec-ed59-004242c4cd26@ti.com> Date: Fri, 16 Mar 2018 13:03:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <87y3isffog.fsf@linux.intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-GB Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/03/18 13:00, Felipe Balbi wrote: > > Hi, > > Roger Quadros writes: > >> Hi Felipe, >> >> On 09/03/18 14:47, Roger Quadros wrote: >>> In the following test we get stuck by sleeping forever in _dwc3_set_mode() >>> after which dual-role switching doesn't work. >>> >>> On dra7-evm's dual-role port, >>> - Load g_zero gadget driver and enumerate to host >>> - suspend to mem >>> - disconnect USB cable to host and connect otg cable with Pen drive in it. >>> - resume system >>> - we sleep indefinitely in _dwc3_set_mode due to. >>> dwc3_gadget_exit()->usb_del_gadget_udc()->udc_stop()-> >>> dwc3_gadget_stop()->wait_event_lock_irq() >>> >>> To fix this instead of waiting indefinitely with wait_event_lock_irq() >>> we use wait_event_interruptible_lock_irq_timeout() and print >>> and error message if there was a timeout. >>> >>> Signed-off-by: Roger Quadros >> >> 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. -- cheers, -roger Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki