Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1330573ybp; Thu, 17 Oct 2019 11:09:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwB9j/mpC0LsfYmX/eWVAEghLTciFpia1uQeWILbKj8aiP3gW5Sit6Emc5IV5tInHsV9tCX X-Received: by 2002:a05:6402:1687:: with SMTP id a7mr5246069edv.222.1571335775193; Thu, 17 Oct 2019 11:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571335775; cv=none; d=google.com; s=arc-20160816; b=aNGs3ukrdQUwdR3beTSrNxsJHbABre1ramTiXC3LPmhGButoMwv08cDTnKEnAbMsAd Q4kQAODv/w5vzlBLemAgDC5wnbpi6gsH5ajhDuhis4GiS0c/0EPZkmjGy3szfL6lBCQJ 13zHXjN31M4f7Buja4AWI1TTuvR+2oWl8fq0zX2moo2cW9LiaGUO0xodR5Ou9jOXJEKg exo3+ZVhvG/n2ODunoW5C4jFb1sMQGF4EfhNk7nJiEX2ipl93gQF2bFgCpvJcCmsAvU7 CcOXt3C1EiMjlBOVPLGEq9Ik1x/nivDX1FfFUgBJ3bekqUw0y4PnZFHLKXWmvItObtjn iBkQ== 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=CaRkGJComru4BHdifeywGYSEli+UnSxEn0o2N99ig90=; b=051jYeSkE5JamMgiC7rcSIuHog+v5dJKrkKkdXUuFh3bJYKjV79t0LSl87k9pfgAeW oy5S+AXO0jY9YhosGoqVsfzv/Z8D389Lh2nmql9tn4P+EJhMXPWwmVD4Mq+Fs36r1C6p Xl3FyVo8qe1FeIamb1sS7XpHYNDGlQADNpVu0xjttg7klJDDaO0YAQkmydaEqov64RKQ qmYR47M+gKqQVyWaTJDLbooJ0+nJbls0ioBCtSd8gbQ7W+yrQgd6pcFvLKS3xTcm2qHW UFIHd2kTsiRKzdQL1CaPw2cvU3vQAnMHW759VzOsHIiS8v1FSFndqwDOsMvI3Um9Rfmk Tq7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PYpZMmW4; 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 z10si1776121ejp.397.2019.10.17.11.09.12; Thu, 17 Oct 2019 11:09:35 -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=PYpZMmW4; 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 S2438535AbfJPV7c (ORCPT + 99 others); Wed, 16 Oct 2019 17:59:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:52140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438164AbfJPV6a (ORCPT ); Wed, 16 Oct 2019 17:58:30 -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 B586D21925; Wed, 16 Oct 2019 21:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263109; bh=Hm2bO/RDltKNgb/ZjztRh+l33r259jfwpk6W8oAqsqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PYpZMmW4ZociwpWybXflDqYDcA/+yG0TG3zQNNbQcYXC4JM5u+1f44b4I0UzEu4F7 25ElEoQgm8qKU4fF/xCAYr8SpbxUl6LG5U9Db3UTYLhz3mGxkvePELU2ZbLCPKjYIz qJRlU4naJ8f5RM7hdIxcvz0Ns4OwX0ZNllyVF33o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacky Cao , Alan Stern Subject: [PATCH 5.3 033/112] USB: dummy-hcd: fix power budget for SuperSpeed mode Date: Wed, 16 Oct 2019 14:50:25 -0700 Message-Id: <20191016214853.416181811@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@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 @@ -48,6 +48,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"; @@ -2432,7 +2433,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