Received: by 10.223.185.116 with SMTP id b49csp1103236wrg; Sat, 3 Mar 2018 15:39:10 -0800 (PST) X-Google-Smtp-Source: AG47ELsHM4tyZW2UZ+DNP0eFPTjYZflCaSMyy78PuavcuBrZsYQWyIZmW536JFdvQvFP1gjQJQL2 X-Received: by 10.101.68.82 with SMTP id e18mr8300331pgq.329.1520120350342; Sat, 03 Mar 2018 15:39:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520120350; cv=none; d=google.com; s=arc-20160816; b=s0aPAVxA5anfscy0XzwVb4GthBuUSXigQMRr59JlcFpkdPCepiOYwg+qf9w/j8u2Tb rWPcsaB8GZSQNN1Uk0bKk8/g+ztlxzjemM9ainRjWZSPSk+wP9OCxIDr8L8UVzDzhR1P Op6+3O9xZhhbsFSIJDz+kQbAE3LEAdQMUajKtXBECEI6rW8LLkIBzTKL3F+N7Gpm9Pb3 EdChWT0UNzjmb2IthbQcHWgjqYHcUhZ31eZycp2+Q476yg+jza6J9mqzQRS+ton5B6PH R5R3jmR8BE3bKa/j9P155deIe3kahpvM2gJmhspy6hz4A18fIS2tSTsbUTylBKRnu3ca Ucgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=e3dQbi92RMyy1c2PcXnZkvt9fmqvDHSEOJbTAqUrqbY=; b=oeSu2OKKWIAR3MS+NRtY/WN1hZiuTM6tGjjB43RDP+pdzMq9nX9ViUgObw+KJExKbq BE+Oq4MzLG61m09GI1TA36Mud/gr/NYYhsR/yES68fNKok3xhfoOGxRG8rigcHtnGGia R8RICoFS6ucOZhN8NINidYUg4n/pPMhml8ih+cuhPOE84CUcNkR2WdFKkp5ngEsAcjVm GUq7z4x/syg40b6GASXA7X0fc7DZwSNYQxtoNOqrer+CVSvgUjwiVihPUpUvkqcjMCjN RLLMZLoL2LVBqfveL+ekK2EUL1uAs2TjvV/fIx12Egc2m77JUS6W3RCtFWdL0sPNm2UH 8isA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=kpcct8A9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x11-v6si6992845plm.218.2018.03.03.15.38.56; Sat, 03 Mar 2018 15:39:10 -0800 (PST) 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=@microsoft.com header.s=selector1 header.b=kpcct8A9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934456AbeCCXiF (ORCPT + 99 others); Sat, 3 Mar 2018 18:38:05 -0500 Received: from mail-sn1nam01on0132.outbound.protection.outlook.com ([104.47.32.132]:20800 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934352AbeCCWfN (ORCPT ); Sat, 3 Mar 2018 17:35:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=e3dQbi92RMyy1c2PcXnZkvt9fmqvDHSEOJbTAqUrqbY=; b=kpcct8A91dqVsa3hZEs9ZExbi/JHpspn9qyJM9DbLPMUe5bzpIVheAjrdhBIwn1jduaNUCO4qPWDN6AseBrt3HWtIWn7+J2g6Fh5gChFaqZI0Yr0bFIx+xHdS23x/6Qq4YZ2X0onAxZSaz6NLSbszrjrcn4a9IJsuiybfSzE2v0= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB0924.namprd21.prod.outlook.com (52.132.152.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Sat, 3 Mar 2018 22:35:01 +0000 Received: from MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0]) by MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0%3]) with mapi id 15.20.0567.006; Sat, 3 Mar 2018 22:35:01 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Yuyang Du , Felipe Balbi , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 147/219] usb: gadget: dummy_hcd: Fix wrong power status bit clear/reset in dummy_hub_control() Thread-Topic: [PATCH AUTOSEL for 4.9 147/219] usb: gadget: dummy_hcd: Fix wrong power status bit clear/reset in dummy_hub_control() Thread-Index: AQHTsz8TUwQDu1s0HkydiZITn3c6/w== Date: Sat, 3 Mar 2018 22:29:21 +0000 Message-ID: <20180303222716.26640-147-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MW2PR2101MB0924;6:HB41Oc4MUjLhLH+sQKNn24iGAMMA5M4zA/Cf7bCc8AHujy2y8jhLr+16o8JbujVNrtLCHFNQkb5OdjOm+Zio1cKuhBGZ6DvjRkAUlAAEGzZ1ugNSE8A/j9XNs5MRIP72vPLHjQTtFNqNJnK2G+V7UpJL4CfKDUz37zIfh/BXGr7faIU+P9f6ooj4/N3wYr8xNQQSQ+xLGCCNF/v7kvIEkt8HcyaiPOXZgI0hwLbKXJI8tTZ/CWIpuL46IqnnDj29aId1SKGnYBC8vX1eh9rESR0vfmSO1oBDAOU+ojhl8o7YX76LQxtYmvVw3Bij2wiso5IUJBQMQhiEDq5jZiPINH3MBqhNvppavbF/nJQtn+E=;5:H8yr2Xc0BQNKphDjklNXIhhvodBRw5kQw71erz0hSQZP5kiLEunuYztC6aY3NAKqVcbtOgMa6eu4pwqACb6hbiS7raOoNcMiRplzExT/yUk4muOj+t9Qi8DC5s/vGjA+MAtwrDGIQ9mLuM/dP0UTYT5eHeAXO8BpCmzX7nnsNHI=;24:RFSiuG7KHyCELkorZflpa38rJrDJtHjHzgi75T0noqXPG9TWLstgJ5l6u8AJchzWV/MwnXLq9l0iTmCYJvCACXA16Wd5RQtN4mTQUklTGAQ=;7:vT5zHKVl09q7uV8Ogv9URnNveEFJqa5KaJFertrBeBwKd2CSzzYnEnAcQJVaY4u/qNDlhvI99Rpgq5lza8m70dCCL9FzQpd7NTSGhirKYfmbxPX6bpaKD1Wru7TZ7TvHnh7TQrqdGjEFCBf1bcg3hdSXL4dKW/JJaZU3KQiYM0AYLHYxE1LyIDrz3rZCnRgiyo/OQ+duv9y9xmTKZ8q5cTLs/McE5s/lgApq5NLqw81qML34USHTzhOTULZaBQia x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 1c101659-80a9-472f-f011-08d581570056 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020);SRVR:MW2PR2101MB0924; x-ms-traffictypediagnostic: MW2PR2101MB0924: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(35762410373642)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB0924;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB0924; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(376002)(39860400002)(396003)(366004)(39380400002)(189003)(199004)(102836004)(2950100002)(10090500001)(6666003)(316002)(26005)(186003)(25786009)(2900100001)(2906002)(54906003)(22452003)(110136005)(97736004)(6506007)(7736002)(4326008)(305945005)(5250100002)(86362001)(575784001)(2501003)(99286004)(68736007)(72206003)(53936002)(6436002)(6116002)(3846002)(5660300001)(66066001)(1076002)(76176011)(14454004)(36756003)(3660700001)(6486002)(86612001)(81156014)(8676002)(81166006)(10290500003)(6512007)(8936002)(3280700002)(478600001)(107886003)(106356001)(105586002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB0924;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c101659-80a9-472f-f011-08d581570056 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:29:21.9007 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB0924 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/usb/gadget/udc/dummy_hcd.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/du= mmy_hcd.c index b62a3de65075..ff4d6cac7ac0 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -2103,16 +2103,13 @@ static int dummy_hub_control( } break; case USB_PORT_FEAT_POWER: - if (hcd->speed =3D=3D 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 =3D=3D HCD_USB3) + dum_hcd->port_status &=3D ~USB_SS_PORT_STAT_POWER; + else + dum_hcd->port_status &=3D ~USB_PORT_STAT_POWER; + set_link_state(dum_hcd); + break; default: dum_hcd->port_status &=3D ~(1 << wValue); set_link_state(dum_hcd); @@ -2283,14 +2280,13 @@ static int dummy_hub_control( if ((dum_hcd->port_status & USB_SS_PORT_STAT_POWER) !=3D 0) { dum_hcd->port_status |=3D (1 << wValue); - set_link_state(dum_hcd); } } else if ((dum_hcd->port_status & USB_PORT_STAT_POWER) !=3D 0) { dum_hcd->port_status |=3D (1 << wValue); - set_link_state(dum_hcd); } + set_link_state(dum_hcd); } break; case GetPortErrorCount: --=20 2.14.1