Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1397987ybp; Thu, 17 Oct 2019 12:11:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFpIzTl4zCwO+hrRUgRWkZ7u07hzx018+Lz6GNGUAiwP11td4mcA+TEvWQbfcKD4JJiLCN X-Received: by 2002:aa7:cf12:: with SMTP id a18mr5590011edy.278.1571339485472; Thu, 17 Oct 2019 12:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571339485; cv=none; d=google.com; s=arc-20160816; b=xLkKLtoqD+Xpjt+nR5ElnhjU2NSTPT6tr9VA0CWp3rs1LcWnfUDMH7QtWWOeHR3Yo4 9Ytq+PfhEto88/6CPigawvez7+qtDZWwZ8eBP3onxNpagYXJjgrwWG5mwKKiURso0amG N22aYPo8UbBvQCeP41vnmF9tQ5DMxv91FSCb3fUOLggZyp+FOS/HGepU7p4AjN3Lt6Sw AJr0/8DClmsDpls1DvENgtD+DAAuulrNuDGin7iEpBcE+o/L2yyh+k4HKgm+SstratnU 7bA54CjIeulxApp8T4kln3OR3BZcAzt4VgcczCb73taxNVMwA75Xt1KWsZY5FYp8MnMw xVyQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+NrXTAEhqBFqLGxnb/cC5/2VH4jdI2NZ8uZRZjqu9Is=; b=sO03Mn9K1FXnJ8c3sCD7fRnqCx21ZoU2qhufcX1AF0udz4/JLEaG3ljWSKLxGQ51tU 6aJe4NmYtv5iZTnXvPhwPyv++QD8QFcihNhlgmWUm+FzJSKDFhZGXj8AznWqU7y2Qa/K WPoDPqe80EVdT21u6vyRqYvCepN0p5uEcQrE3HBNXxeNwS3GCcapv4iwQCfo1MObBf7o gOyvZMjPrWlWLwskjSLU1bqM+u4w1tgH0D53/spkXnfw8/lGcuybHrnMjA9wSqrOmXne es2ufa0rRGSBGYnmnAsh1FQ6lVjtnP1PGisaUKcxUyOknXzxQRN41E7ihKhQWz6CG9Wb UHaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C9UnCAg1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rn2si1886116ejb.14.2019.10.17.12.11.00; Thu, 17 Oct 2019 12:11:25 -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=@kernel.org header.s=default header.b=C9UnCAg1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405221AbfJPWNI (ORCPT + 99 others); Wed, 16 Oct 2019 18:13:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:47336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727646AbfJPV4E (ORCPT ); Wed, 16 Oct 2019 17:56:04 -0400 Received: from localhost (unknown [192.55.54.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A575E20872; Wed, 16 Oct 2019 21:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571262963; bh=iBmMNpsMkaLFYz2F1wd4Cfv0fExA4wWb3h61kywWhC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C9UnCAg1B9pgmhNDf9vFxjsK1ntYpCGSKxMM1jROO5C9OoqL4x4wymRCYZuPnB+AV j5YfRz7zGRzdyImT2+IZl3Pggx8/Q1tw7qSMSvOsbXzdP4emHXcsLGzJwXd8hfnuNW 2XKLG90ErGjDpZUKvt7hAQLpcy5Z3lme5XnLqvNs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacky Cao , Alan Stern Subject: [PATCH 4.14 31/65] USB: dummy-hcd: fix power budget for SuperSpeed mode Date: Wed, 16 Oct 2019 14:50:45 -0700 Message-Id: <20191016214825.944488701@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214756.457746573@linuxfoundation.org> References: <20191016214756.457746573@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jacky.Cao@sony.com commit 2636d49b64671d3d90ecc4daf971b58df3956519 upstream. The power budget for SuperSpeed mode should be 900 mA according to USB specification, so set the power budget to 900mA for dummy_start_ss which is only used for SuperSpeed mode. If the max power consumption of SuperSpeed device is larger than 500 mA, insufficient available bus power error happens in usb_choose_configuration function when the device connects to dummy hcd. Signed-off-by: Jacky Cao Acked-by: Alan Stern Cc: stable Link: https://lore.kernel.org/r/16EA1F625E922C43B00B9D82250220500871CDE5@APYOKXMS108.ap.sony.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/dummy_hcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -50,6 +50,7 @@ #define DRIVER_VERSION "02 May 2005" #define POWER_BUDGET 500 /* in mA; use 8 for low-power port testing */ +#define POWER_BUDGET_3 900 /* in mA */ static const char driver_name[] = "dummy_hcd"; static const char driver_desc[] = "USB Host+Gadget Emulator"; @@ -2439,7 +2440,7 @@ static int dummy_start_ss(struct dummy_h dum_hcd->rh_state = DUMMY_RH_RUNNING; dum_hcd->stream_en_ep = 0; INIT_LIST_HEAD(&dum_hcd->urbp_list); - dummy_hcd_to_hcd(dum_hcd)->power_budget = POWER_BUDGET; + dummy_hcd_to_hcd(dum_hcd)->power_budget = POWER_BUDGET_3; dummy_hcd_to_hcd(dum_hcd)->state = HC_STATE_RUNNING; dummy_hcd_to_hcd(dum_hcd)->uses_new_polling = 1; #ifdef CONFIG_USB_OTG