Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp141913pxb; Fri, 8 Jan 2021 00:38:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8JJC7qAKlNvIZ9RB1X3bKcoFharotDqH0Ik71Q/v5k9VcyehfqtDcQ9Vr+LT1box7kjai X-Received: by 2002:a17:906:8587:: with SMTP id v7mr1888239ejx.381.1610095089139; Fri, 08 Jan 2021 00:38:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610095089; cv=none; d=google.com; s=arc-20160816; b=XcFlUF7D7CCUt/MeH4AqtChrivp11TTeGGE6bSo5zJJpK+GgI4d45Wr3DvztU/daUK N4TUMKZL7xt1Vy2AngxWPLN174enEXj9gd0xmy42u5P459WcKJL1wA6WwGGNct1bkd7V KoCVxr17cLV4Wa4wsF9a7I+TBh/bnXh/34oJnJvuN9J7mUtsaMSKaOxt8xDKugShdvT6 zhDQiVYl2usdVjeKcN6dhzdysR0tIC6/hkqSue800IHqsOoDkzqXkRsnNQEFEUUX7Oxb mr83SAGz0k3Eua3Srpt94iAuHtnyaFnyE4bvZ3L94ny1WfNU/SGzJmP7iFNwrOZ5By8y fz9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dmarc-filter:sender:dkim-signature; bh=FBXv1OEG0N3B6hZlapLTMyecBYVCSlwsfuCoe1hhnzA=; b=b3TyrBEapt81SIQzLpSkcRTnwf4Urfp/IgIrCAhPsTiMnYHY4Odt181NQCVQos+tTz ypsgFJW+cAYvcju1uTTxe+mjebIywcwA7MpoXVxjJIx+PGrt0DZbotKAmMGp9PmX3Hy7 jFwiTJsH3Yo2ZM6GoEi1gf0tZHZyet9FqYGgTlm6+4MXpKLv/+MMl8Hl8jzyporUthf5 8JP+wVXlUKbnd2oOSdOXFb3j/xOolkJso8OaX/gUaeMG5kdNeRP7UXvvnd+0Xaf2mJvL zTYH4P7FoQbL6O0Uk5muYkzzdW2T7gStvZC3FDwQTuTu2KXM0nQBZmO2ta3Rq/4IaQow Wwtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=WWqoDApa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si3100088ejf.618.2021.01.08.00.37.44; Fri, 08 Jan 2021 00:38:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=WWqoDApa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727091AbhAHIgv (ORCPT + 99 others); Fri, 8 Jan 2021 03:36:51 -0500 Received: from so254-31.mailgun.net ([198.61.254.31]:52770 "EHLO so254-31.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbhAHIgv (ORCPT ); Fri, 8 Jan 2021 03:36:51 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1610094991; h=In-Reply-To: Content-Type: MIME-Version: References: Message-ID: Subject: Cc: To: From: Date: Sender; bh=FBXv1OEG0N3B6hZlapLTMyecBYVCSlwsfuCoe1hhnzA=; b=WWqoDApahEBQPYrLT9BASmTYUlNgx7LU5VRIfxc+Yo7jGezrGaDKGTXYND/49SuOBcDtxMK4 ffpslMSYITCBysNsVRz7lviPSFFkiWZeorpVcL3luD2p56sSJwqchF5dLvfsck8Ju7tlqbVM KN31nPg0oHD6xjAveth41u7Bj0I= X-Mailgun-Sending-Ip: 198.61.254.31 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-west-2.postgun.com with SMTP id 5ff81973661021aa28804612 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 08 Jan 2021 08:36:03 GMT Sender: jackp=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id CF7A8C433CA; Fri, 8 Jan 2021 08:36:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from jackp-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jackp) by smtp.codeaurora.org (Postfix) with ESMTPSA id B3975C433C6; Fri, 8 Jan 2021 08:36:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B3975C433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=jackp@codeaurora.org Date: Fri, 8 Jan 2021 00:35:59 -0800 From: Jack Pham To: Thinh Nguyen Cc: Felipe Balbi , Wesley Cheng , "peter.chen@nxp.com" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: Re: [PATCH 2/3] usb: gadget: composite: Split composite reset and disconnect Message-ID: <20210108083559.GD31406@jackp-linux.qualcomm.com> References: <1609283011-21997-1-git-send-email-wcheng@codeaurora.org> <1609283011-21997-3-git-send-email-wcheng@codeaurora.org> <87k0srcyq7.fsf@kernel.org> <37f3412c-9e91-eb1e-3974-bb16546b4b39@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37f3412c-9e91-eb1e-3974-bb16546b4b39@synopsys.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thinh, On Fri, Jan 08, 2021 at 02:19:30AM +0000, Thinh Nguyen wrote: > Hi Wesley, > > Felipe Balbi wrote: > > Hi, > > > > Wesley Cheng writes: > >> +void composite_reset(struct usb_gadget *gadget) > >> +{ > >> + /* > >> + * Section 1.4.13 Standard Downstream Port of the USB battery charging > >> + * specification v1.2 states that a device connected on a SDP shall only > >> + * draw at max 100mA while in a connected, but unconfigured state. > > The requirements are different, though. I think OTG spec has some extra > > requirements where only 8mA can be drawn max. You need to check for the > > otg flag. Moreover, USB3+ spec has units of 150mA meaning the device > > can't draw 100mA (IIRC). > > > > We see issue with this patch series. For our device running at SSP, the > device couldn't recover from a port reset and remained in eSS.Inactive > state. > > This patch series is already in Greg's usb-testing. Please review and > help fix it. > > We can see the failure once the patch "usb: gadget: configfs: Add a > specific configFS reset callback" is introduced. Hmm. Does your device use a legacy USB2 PHY (not generic PHY) driver, and does it implement the usb_phy_set_power() callback? Because otherwise this new configfs_composite_reset() callback would not have changed from the original behavior since the newly introduced (in patch 1/3) dwc3_gadget_vbus_draw() callback would simply be a no-op if dwc->usb2_phy is not present. If it does turn out to be something with your PHY driver's set_power(), it's still puzzling since it's directed to only the usb2_phy, so I'm curious how telling it to draw 100mA could affect SSP operation at all. Thanks, Jack -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project