Received: by 10.213.65.68 with SMTP id h4csp1715657imn; Mon, 19 Mar 2018 11:16:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELvLN1WG1xEaVcbYJusH6A0f1KykufkmzThSKyLNuKZLVW1iB8i9GAIY7Kk0l/Nr45NMoHiu X-Received: by 10.101.87.201 with SMTP id q9mr9948016pgr.215.1521483364223; Mon, 19 Mar 2018 11:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483364; cv=none; d=google.com; s=arc-20160816; b=Gv2eI6kYi3j8dSvxIlhxphXY4OwqIbG2Qhp8TNSwxyBtcPgnaSLHBhrU/y+HxTZg8S iMXaqPy+8SJopQbiNOA313qZ4NdWEJkzLc5nalXffrwMEp4X3hP01ddg3MnmwCRLungd mpAuFRQk/3hXjyAp3wtVBNZ6SyLp1T1js0EAAaKIbTztoB40f4PxIZKO+OSxg3PB06ZY eYz9AFPY1EZrQ73kBXP54W5/Hf62knMdUi9J11qSwI9GCkXfwOoGJVJUQL9NjTamRAoq 1BtocJ+iCm+5Qf2ZXOwf4O+q3/OnceiRbJJJV+hoZgdXM973Ff5+KFgm2l1LK8SJ//Kt svzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=s2wICw4G3+CJb7iSGNhehL53jJac4GX/VHVIFiD0lPQ=; b=nRDT5OuZeScWztaMokWTCH6pvt5tZ5RmcJnOkhFHuyEq6NFXlWbvfSAU+UDJ/KaSFh 7zGEBglUP4DxfwGL3jqDhiVZRdr/lM2RNW0oR0upuhd6Z4sCRIhjhV9FPON85OfJk/Lh V+I6q4Aj+kNxLOwQ4zQgyHVPEtIR+quRwNR9F/dyZ5g72Yi/LZLxIZ6WJkTcBpQCw5kg 9wmdMUUWLhlOGGkJVefcykmbW88CJxwC4ztcqb6ybYQ9EIwz/A2JlfWe2rlP+Ub2XraI a2fcl8B+SlYM3cHgxOEzs+fCHMFekLiNazaGkVh0TUm0sEy3jk/EsaXdGVc8FuBNd4S5 novw== ARC-Authentication-Results: i=1; mx.google.com; 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 m70si308378pfk.344.2018.03.19.11.15.50; Mon, 19 Mar 2018 11:16:04 -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; 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 S1030723AbeCSSO6 (ORCPT + 99 others); Mon, 19 Mar 2018 14:14:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44362 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030714AbeCSSOx (ORCPT ); Mon, 19 Mar 2018 14:14:53 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B9BF8F37; Mon, 19 Mar 2018 18:14:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Yuyang Du , Felipe Balbi , Sasha Levin Subject: [PATCH 4.4 069/134] usb: gadget: dummy_hcd: Fix wrong power status bit clear/reset in dummy_hub_control() Date: Mon, 19 Mar 2018 19:05:52 +0100 Message-Id: <20180319171859.198844633@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yuyang Du [ Upstream commit 9f20dfb44d03745d0d3cef2ffb3abf8d8024fa61 ] This fixes the commit: 1cd8fd2887e1 ("usb: gadget: dummy_hcd: add SuperSpeed support"). In the case of ClearPortFeature and USB_PORT_FEAT_POWER, simply clear the right bit regardless of what the wValue is. Acked-by: Alan Stern Signed-off-by: Yuyang Du Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/dummy_hcd.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -2105,16 +2105,13 @@ static int dummy_hub_control( } break; case USB_PORT_FEAT_POWER: - if (hcd->speed == HCD_USB3) { - if (dum_hcd->port_status & USB_PORT_STAT_POWER) - dev_dbg(dummy_dev(dum_hcd), - "power-off\n"); - } else - if (dum_hcd->port_status & - USB_SS_PORT_STAT_POWER) - dev_dbg(dummy_dev(dum_hcd), - "power-off\n"); - /* FALLS THROUGH */ + dev_dbg(dummy_dev(dum_hcd), "power-off\n"); + if (hcd->speed == HCD_USB3) + dum_hcd->port_status &= ~USB_SS_PORT_STAT_POWER; + else + dum_hcd->port_status &= ~USB_PORT_STAT_POWER; + set_link_state(dum_hcd); + break; default: dum_hcd->port_status &= ~(1 << wValue); set_link_state(dum_hcd); @@ -2285,14 +2282,13 @@ static int dummy_hub_control( if ((dum_hcd->port_status & USB_SS_PORT_STAT_POWER) != 0) { dum_hcd->port_status |= (1 << wValue); - set_link_state(dum_hcd); } } else if ((dum_hcd->port_status & USB_PORT_STAT_POWER) != 0) { dum_hcd->port_status |= (1 << wValue); - set_link_state(dum_hcd); } + set_link_state(dum_hcd); } break; case GetPortErrorCount: