From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1FFFC433E0 for ; Fri, 8 Jan 2021 08:37:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65F3823403 for ; Fri, 8 Jan 2021 08:37:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727265AbhAHIgz (ORCPT ); Fri, 8 Jan 2021 03:36:55 -0500 Received: from m43-15.mailgun.net ([69.72.43.15]:23575 "EHLO m43-15.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbhAHIgz (ORCPT ); Fri, 8 Jan 2021 03:36:55 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1610094989; h=In-Reply-To: Content-Type: MIME-Version: References: Message-ID: Subject: Cc: To: From: Date: Sender; bh=FBXv1OEG0N3B6hZlapLTMyecBYVCSlwsfuCoe1hhnzA=; b=Mb1CLA4oLCLHK/rfcEQs3+epvPb9FOPa5Ja6JZtcrCMAs6q+4tnaW/3Nk83a4fE82SDfAqng tUbu76vUPxgpffF172IwckLlZoMxxOOHzdvaM3IAUFCjLP8bl+tvU9v8R35vUir9JdBmrNor B69DtWQisNyjniywnUe6SWLioYY= X-Mailgun-Sending-Ip: 69.72.43.15 X-Mailgun-Sid: WyIxZTE2YSIsICJsaW51eC11c2JAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd 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 5ff81973661021aa28804613 (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) 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-usb@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