From patchwork Fri Dec 22 22:11:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13503808 Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37B792EB14; Fri, 22 Dec 2023 22:11:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=synopsys.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="J0JtDF75"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="d3McN1nz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="gAXp2XKP" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BMK4jsk032659; Fri, 22 Dec 2023 14:11:33 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= from:to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; s=pfptdkimsnps; bh=EeYVhC+5avoKmOCAWnWlk9nAmDFba9xx6c/2Cnoqkcw=; b= J0JtDF75Lk0TcqLPnLtjL+skKwvBW7sZurVM8ncjZvNKZYk/u2eC7qsSIbtXWgga RW18Qy7YbNlTyRXdjLbWFzLaEe1cKnzOiOalkemofFgOvdooSOPF4oYtaTHD8BwQ 8xWmzF3hyExcCiMEtuDY/R8AraLUp12xY4CAndLh9mY1dG4I+ck3wvRhvD2zCsjv 7TcvxUXbxn9ErRONltldi5CPy8WFWxMC7pT1sBwRBAFjaE1fM7hwMrrQ6tt2/LDj +PwRU7Sr6PAB6ebhKxPSPAAnG12aOy5ymF8ayDPWg/lRNuEkFJdCtbJYociVEE2V nUSpi/Qaf4YE1HlkRiFqEQ== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 3v5gpw0dus-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 14:11:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1703283091; bh=EeYVhC+5avoKmOCAWnWlk9nAmDFba9xx6c/2Cnoqkcw=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=d3McN1nzSCKBI4vZwDryZMbBMSIms5R04NavIThGp3DKx0dEUTlaLn2/FF3+tkBqv gech659ghcdXjoRlxls2g8+faM7PV337j/EWYDBXPpTq2mZGmBx/+hKb/7pg0Dg4O/ 8HYbqatG1MgQMpGSss7BPR9NKl+8l33pIwMY0qbprY/Gd/cv8tOu3p+S2WWMRtMPFn 7Hzl0v0165ZMvzsC7X+PxESaQPolb/ZtAjUAPl7wVxsxgBCTF1pRHdidShAQXVc1HV x1XQwhzDpUgCnirXJFjX6ZxXxirDknAh4bB76Lg0mr40LLS3w5Avf07/wkubET2vIf F5VMNLOF9YphA== Received: from mailhost.synopsys.com (sv1-mailhost2.synopsys.com [10.205.2.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 61AC140542; Fri, 22 Dec 2023 22:11:31 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay1.synopsys.com [10.202.1.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "o365relay-in.synopsys.com", Issuer "Entrust Certification Authority - L1K" (verified OK)) by mailhost.synopsys.com (Postfix) with ESMTPS id 2B9C7A0073; Fri, 22 Dec 2023 22:11:31 +0000 (UTC) Authentication-Results: o365relay-in.synopsys.com; dmarc=pass (p=reject dis=none) header.from=synopsys.com Authentication-Results: o365relay-in.synopsys.com; spf=pass smtp.mailfrom=synopsys.com Authentication-Results: o365relay-in.synopsys.com; dkim=pass (1024-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=selector1 header.b=gAXp2XKP; dkim-atps=neutral Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 0426E40363; Fri, 22 Dec 2023 22:11:31 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cSeFyVyZzEWz6yAehVBP7F08dtLx/3DbyUfNrqslMS0XCiXRdnYmfA74KAkJDMtMUJzKCFjhe9kFI55DzGIENYUggt6fCUAPZBUaBrDuM0FvI9+vfA/NoEgK4yQ5FfPdJxHpgc74Vcht/rLZCIixfyMJl7q+8lWZE6WkQfQaM+ja6ikOvKXMTi3CLcxS6GI2UzBHMBxkSfE2BNnnKCoqwje4b0Sp6ZzZF9OtE/pZvZBI0h/VBhhiegA+d5Vw22HvJ7xXZAOk8lhVs4FFS6edUv9hf1HHdT6M/ExiVzfnEiYb5gy2A8+e8NK0HvDYQj3LJcA4q5WKMPG69CPbF7ajnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EeYVhC+5avoKmOCAWnWlk9nAmDFba9xx6c/2Cnoqkcw=; b=J9x7L7mQVMW/Qf18Q6/kt5Mh1KHCOGvSeLM/0w0yUMO4mwbnhE+6x9wsipcjyd0EIqwm23S4HuTLLEv4V1MQsOR+r1MTBOGAn+Pf7nu0nT9WPYS8dUbObjqcyN3Gj4FXXinyvDiFCdOf4jMAWbN0FM1NaDUz/Vcl7jfGJ2wf3QpdhilTOdenpQUd+MIPb5Lk/QmpyG9EWwsQGtYGcxDLdlPzGnuZkdUzyd/r8T1tkZ7YT9ufec05qeccuVBIo6NhnDugD4f6auw87Hw0bfGR5F+ClzMaeWqF3EkI1wi/DPx0mQt7tvo1JbKDmWkscW7+d0inYyFBTsKPNtmqeDsUoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synopsys.com; dmarc=pass action=none header.from=synopsys.com; dkim=pass header.d=synopsys.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EeYVhC+5avoKmOCAWnWlk9nAmDFba9xx6c/2Cnoqkcw=; b=gAXp2XKPIbrq6DraMGw75iv8NvNMoYiifrnTHFGDusejYh/liTSe/fJ1Tag2EWR63OLZnU5P63mplS/nXNlirIi5E9mIJ43uG905aHhvgIkymKeN5hLeQ+VF1x04+ipnuNOahN5hw7QjuaeNVu6jvk1etJSSnESL48A27FamDhc= Received: from BYAPR12MB4791.namprd12.prod.outlook.com (2603:10b6:a03:10a::12) by DS7PR12MB5982.namprd12.prod.outlook.com (2603:10b6:8:7d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.21; Fri, 22 Dec 2023 22:11:27 +0000 Received: from BYAPR12MB4791.namprd12.prod.outlook.com ([fe80::d931:a262:ec3b:3e56]) by BYAPR12MB4791.namprd12.prod.outlook.com ([fe80::d931:a262:ec3b:3e56%4]) with mapi id 15.20.7113.019; Fri, 22 Dec 2023 22:11:27 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen CC: John Youn , =?utf-8?q?K=C3=B6ry_Maincent?= , "stable@vger.kernel.org" , Kenta Sato , Jisheng Zhang , "linux-usb@vger.kernel.org" Subject: [PATCH 1/2] Revert "usb: dwc3: Soft reset phy on probe for host" Thread-Topic: [PATCH 1/2] Revert "usb: dwc3: Soft reset phy on probe for host" Thread-Index: AQHaNSPPlaq423qkj0iUa62ZUsn8ow== Date: Fri, 22 Dec 2023 22:11:27 +0000 Message-ID: <29a26593a60eba727de872a3e580a674807b3339.1703282469.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR12MB4791:EE_|DS7PR12MB5982:EE_ x-ms-office365-filtering-correlation-id: 451f5c3a-00d8-461a-10df-08dc033af183 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JOv4t6Y+Eh+wI3LZ1+lOw+CtEDCHZBRHYMCQZQainld/bKFBWlqeO9wlvHUduJBBJ+cagdElIhulnZ4lsdEaD0uePuYpPzNdc8fC0qZJxKsWhzmsgPGFCZDlr2dRhFtm9ZVxSYPD4dd9IQ0PfxLkweOyfSxOwbq9b2llHJ11Fm8SClBESGOz5AbtZYy+cnP8C9UY2kj3CsYxB9vWnwco7y43I6yiML+9e0qpyXBbIslWBTWEDtzkzVgr8FI9la5xzB6pqOcp52PwypXRtLxUIYcaLOEMWJDjVtAIajXapKsZVv5fIlw5+GZNIooh09eHKwnJgw/sXekkFMrp57+p4qqndfpliUTeSY/YJ6aIs6OEOq3f+X5X2Xqc+aVFo4QeSZoMlwXXqIKuviq5WnYuYuqtkPBVLN0E791Vkd5CFgciAv6EpAv8NlcsKDxqwwBNctjm53kXJNT20kB+JWpUhVqCS65xFj8RwDrG7PP5f3AnGcK1LBcZPhqElJ8s57ib4JgBtFcJdaClHD6W+dkkxsUAoOvL7wKNhwXFegpZZmWCzPujtUjhp9ETcG4gU/E3w54hxzTDCdsslYZ1VfMtdOY60sJcwsTMN9qK0LYpNUY= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB4791.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(346002)(366004)(396003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(86362001)(2906002)(5660300002)(4326008)(8936002)(54906003)(8676002)(41300700001)(38070700009)(66574015)(83380400001)(26005)(2616005)(36756003)(122000001)(71200400001)(6486002)(38100700002)(316002)(76116006)(66556008)(66946007)(66476007)(110136005)(66446008)(64756008)(6506007)(966005)(6512007)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?4Xd92lIN73RLjrpKO7UpuZOuKaKs?= =?utf-8?q?h//CFlnAeU/6ZBchif2g4urm+3I0JUeXMD1TPr9pgvnhy91W1hfAijh/rnuJyGCEc?= =?utf-8?q?hKeGTA2dsDlc/uR6V8bbQcoog6+aLRiebN1wcqrAdjbWPSpwuuo3O7l9ec5Ijrz0O?= =?utf-8?q?O6P2MkbXj6y1vv0Enuxj9HBw1GcdnPN7qRMEz3CpOKQ8bruRwkUWNHPp2An3vZyDw?= =?utf-8?q?MoFGgR/H8rRfZZucQD13ZiysDWdASTU3+wJGA4ln+1D4slmAspVKLfdV5Pz8727DI?= =?utf-8?q?IslOE8ZZmX8/Z/7ryPxV5PaJpvq3NbGcty0JW0AYcBqSXrLYOJNIsOpt1SVWnhy9r?= =?utf-8?q?dXdWQfn9VeJMpt6Vfgbgq1nI7c+RGmGaZ1SK4jMqbjdoo4pD8ZMs0CHugliy/HLdU?= =?utf-8?q?up67mp38F3QJjRCM66SDJiDlSrCBJJApraMhOotYf1+i7DNldLrwulOhgQSDQbV44?= =?utf-8?q?ba+T8/pU6dS6Oqe07SDImfeCN04EeluX9OdXhSJaBAXclBBdR6cnxlOxY29D27sak?= =?utf-8?q?4f8Us1IaG6Vxz8/8nGJk14VCGthZsKO6rZLoU9d7/REnQfhoHPVdJyZhZExzmhWfS?= =?utf-8?q?3AHfIsS2rvqCHg4VNKVRQrbyo6EHxa7FxOMDzg4+SwpmZBWeFwqKk3hpmVnoDvv70?= =?utf-8?q?25uvJ9DCJiITXuRxurWB3CAmjqHn8V1CtmHVSYB6S42BKnvOYWrwd4ifRgOiFvQMR?= =?utf-8?q?cyjZO6keC0c9XINuzPZMrP+yM9SQ/2XUjzR4b8lhxjQGbLc5weq/dFd0Ug+0h9tjx?= =?utf-8?q?gvjhqOuRNqMLI3WRsneW9H+Fd1rnuDGyjZoy4CietCZqR/kfrnC/3dApptQL53ok8?= =?utf-8?q?Q0sjPJqSx9XhoacvLSns1Yap4wtlfhoXZdcXkwRkL5fQhDNj/WDrVDWC9Xuq1CegP?= =?utf-8?q?QQfhiNpVngHFnZGXTOgRSbsgh0J1xKmiUBG33B7T8YT0i+lad7GAq/hvXWsQlhUxX?= =?utf-8?q?oPrgBOY0Ml7jNcXeY/WtBIGhc8GP6FFEvMyAqBIfbD/MIUItk7f4rGsKwja9fL7PB?= =?utf-8?q?oBRFY690obo0LvuKFIp+TWmrG0iZIIMs3XygpwsNyT3A400hTG4OvX35dnPYDjTCM?= =?utf-8?q?WEZPd0HM+GbQ6Z43vpFJLXDF8WQcPmW4Gr3YKC2GbOgeQq2tdmlxh6iVOqK9+HURB?= =?utf-8?q?YN7+KeCZcJzfIpxtPtH4VLn7JgN99kqQNKCA+t3NyJUo33Amuov1J28abMv7nYYhL?= =?utf-8?q?TrIrpxOn+pVBCApO7wrQspaQRts3AGovfJqEdtk9bdE8eV/Rj9gDHI/ZSsfB3gq8N?= =?utf-8?q?bOzaCyOfMIkzVSZNaqkyGwN4zn32ZhowYkGuk/w1rXPnCtymfdyjFlYtS+o1zUH5N?= =?utf-8?q?/CTDCWOMkmXBn9B+sBpGcdeei2XJGEy2Dds+oQ2oI79epaVfzq3ZaYd2NC3vLsWbZ?= =?utf-8?q?Qlv7BuNmHGLJ+exUi6vIce4hAynZMoibcNjZ3IGSTrM87/hqyAcTgaeScftnLYE+i?= =?utf-8?q?qXOKpy0x8wdxndLDob7IXjyn8TW2wXwvfociwzSG/qFAyIWDBtFyF2fVFC4SKGLER?= =?utf-8?q?kdGBjYXA4cSj?= Content-ID: <600D4DC898775743A93CE96EA2B57B4C@namprd12.prod.outlook.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: qOR/WdgIszmuB2ORdn9Xu7MD39iBNKp8m+CZcX4irxg+0bCe4uxGAprPbogDRXQVnKoWvjzmTWV2JBbMpyBXfPqJxQb2ySzfDv6WZNLlKumRdSqnklZ4cx+nBzbwqt2bm4H3uqMsRIFAXTpxrj3Vv6Vl/ciJOsD77ascQCqL3wctqoxYHa0awnCVSTXM9Ud67F2QzaZZKPt1rmabujIDtPhhC6a6CSmkXqdT2r5tgOchE4hCW6/Uw+wiAthcD5C3G1rgN2gD46I6R40i3iTAbGo6POFf9mez9b9iPbSG7W2q1Jvtj/J7bSXvV4JgtKYnlbuOrkWY+0kf9Dkx22JM4Wp4lH+Nog0kCdJJuEtOmBOcwGGBy7jc47Y77YqP9Cl2fmVe2f7E9qFI9r9eOrZ2rONpcEtY0UmASA+5JAgHL1tHvbZZeyBwakmJ6ew1Ds6RHC8zapaa8dJGJ1xnE3xeUlw2yroCaE/CXWyK7nERY3pQvcv9BNTGNMu0U335t9GMvrMRzQU49g7hZATBVnG2OezEMxYcbirDhNnPh/KIr81gt9xCjUeXupbHVF4SxAXjhC9uKFGkHFYilLicTQeOdYi1YcwKzQ9hndbKzkxrElBqY5W9savw6zcGrbgvd2tMhxeclRvXX7mrGfIsU3VdPQ== X-OriginatorOrg: synopsys.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB4791.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 451f5c3a-00d8-461a-10df-08dc033af183 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Dec 2023 22:11:27.4459 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c33c9f88-1eb7-4099-9700-16013fd9e8aa X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: juqvwN+MBL2bRS8NUNlvBrW2044omgT/s3rOOgIfDBOHcjW/ZZW9nmJw6gyRojIxeZGQdsJY4Z05ofrp22u9oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5982 X-Proofpoint-GUID: BV7LyiMkQ93BuKqahkyRsrJOMt5aarK6 X-Proofpoint-ORIG-GUID: BV7LyiMkQ93BuKqahkyRsrJOMt5aarK6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 mlxscore=0 clxscore=1015 phishscore=0 spamscore=0 impostorscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312220163 This reverts commit 8bea147dfdf823eaa8d3baeccc7aeb041b41944b. The phy soft reset GUSB2PHYCFG.PHYSOFTRST only applies to UTMI phy, not ULPI. This fix is incomplete. Cc: stable@vger.kernel.org Fixes: 8bea147dfdf8 ("usb: dwc3: Soft reset phy on probe for host") Reported-by: Köry Maincent Closes: https://lore.kernel.org/linux-usb/20231205151959.5236c231@kmaincent-XPS-13-7390 Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index b101dbf8c5dc..832c41fec4f7 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -279,46 +279,9 @@ int dwc3_core_soft_reset(struct dwc3 *dwc) * XHCI driver will reset the host block. If dwc3 was configured for * host-only mode or current role is host, then we can return early. */ - if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST) + if (dwc->dr_mode == USB_DR_MODE_HOST || dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST) return 0; - /* - * If the dr_mode is host and the dwc->current_dr_role is not the - * corresponding DWC3_GCTL_PRTCAP_HOST, then the dwc3_core_init_mode - * isn't executed yet. Ensure the phy is ready before the controller - * updates the GCTL.PRTCAPDIR or other settings by soft-resetting - * the phy. - * - * Note: GUSB3PIPECTL[n] and GUSB2PHYCFG[n] are port settings where n - * is port index. If this is a multiport host, then we need to reset - * all active ports. - */ - if (dwc->dr_mode == USB_DR_MODE_HOST) { - u32 usb3_port; - u32 usb2_port; - - usb3_port = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); - usb3_port |= DWC3_GUSB3PIPECTL_PHYSOFTRST; - dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), usb3_port); - - usb2_port = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); - usb2_port |= DWC3_GUSB2PHYCFG_PHYSOFTRST; - dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), usb2_port); - - /* Small delay for phy reset assertion */ - usleep_range(1000, 2000); - - usb3_port &= ~DWC3_GUSB3PIPECTL_PHYSOFTRST; - dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), usb3_port); - - usb2_port &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST; - dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), usb2_port); - - /* Wait for clock synchronization */ - msleep(50); - return 0; - } - reg = dwc3_readl(dwc->regs, DWC3_DCTL); reg |= DWC3_DCTL_CSFTRST; reg &= ~DWC3_DCTL_RUN_STOP; From patchwork Fri Dec 22 22:11:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13503807 Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBC1F2EB07; Fri, 22 Dec 2023 22:11:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=synopsys.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="ZAHuTlie"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="iWiNwJyF"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="HyWeJPaw" Received: from pps.filterd (m0297265.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BMK4lU7024491; Fri, 22 Dec 2023 14:11:39 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= from:to:cc:subject:date:message-id:references:in-reply-to :content-type:content-transfer-encoding:mime-version; s= pfptdkimsnps; bh=S+28CK3vbeUDV0pm65PMqk6+OAxsQ/le4cHPrGFUngg=; b= ZAHuTlieZRlFSBAx0A6hjaay5RETvzAQqvqvU2KcC0OUPSfhyHygnGaFEr4WK0Ds 4UJQ/yy4To2TkBE2OkJDwgDO9UAEj0E+NrlYV+StZRRDG4uG/YDexx0WdW4ORpg9 sSRaBUR9rck7KEY7Tg1l+lwpCLQ2wDLdwFfW8+C+sO9BeFhijxvGdDmNopfFDoKo iAZlm9ec+4TrLYL1GHfXkhZ7dCNFiGESwL4mBTj7S8lMLodh4kE4A1igeZ+BG3tI O3M8+Hk7TqkFrbNnaPaOrqbLnckiTCiXy6C2swqnvcigqwhkiNtLVrFIskRw+SYt NyHcpDi79J803/kuHV5vpA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 3v5gpwgdw1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 14:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1703283098; bh=a6UYVAxdmtxIh98LfvpW/viRFcu3qLNKdsnXFbFe4SU=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=iWiNwJyFEbEVvbBZkF/P6sIjnTaW46USGphytIEYnfC+h/+n+LSoVkym0GY/J1YOv N/V9UjFd5MhKro+ozUmP7KNymkuPPzAj1EIk1p12WT4xPd50Vd1A86eJbqc5zjmj6L +/1DDtDpAbtUu4Rh2XA37UyBoRB45rZQVBo/4O8p4WhqP8AdYcKTpWoKIagH8jaYid 9RdcTEtENVJuatij/L6WXifSKyXo3WOG5bB+wYC4bIYjjqA0hoeRO/1CM0T60bEurY miJx8QS6jzrBQcFWY1PFWZWnJln+Ulj03seeEZVOh/QZKadfFIAIgsafEmKDASL6rp jl6YLjbrLxXWw== Received: from mailhost.synopsys.com (us03-mailhost1.synopsys.com [10.4.17.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 1039140540; Fri, 22 Dec 2023 22:11:38 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay3.synopsys.com [10.202.1.139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "o365relay-in.synopsys.com", Issuer "Entrust Certification Authority - L1K" (verified OK)) by mailhost.synopsys.com (Postfix) with ESMTPS id AF806A008C; Fri, 22 Dec 2023 22:11:37 +0000 (UTC) Authentication-Results: o365relay-in.synopsys.com; dmarc=pass (p=reject dis=none) header.from=synopsys.com Authentication-Results: o365relay-in.synopsys.com; spf=pass smtp.mailfrom=synopsys.com Authentication-Results: o365relay-in.synopsys.com; dkim=pass (1024-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=selector1 header.b=HyWeJPaw; dkim-atps=neutral Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 9FFC940130; Fri, 22 Dec 2023 22:11:36 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cdbw7xYClAamUP+cuPRYGJvlxiF+1AzJS1MX6A1/iu/ywxYrv2hNIgRdnrhbBn9vSNNqGkuPSjEgw9IUy5Lx+h9FAdI+CnsRcZqnS/dTHp3dg6ydFRnN9ZdoIWQ7f+BTc6pS+MRDV+ReQsPAYfrjVqs/22OyeI7+22fKNepmhf6YshJymwgLtsJknsFRfuo3/G0bf1DWAyBt58blqYHmBf/8QAy1fTpnI2qSGKJURTcpW+PcLXNJYZSwsziKrehzfXnJXQiZ3OBE0NuQ6TDkEZE9QtM8VBDF6BeA5sU57hO+VpyRZeFsT67rqnEchC7O7Huskb69n6qeCKiBkdr8jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S+28CK3vbeUDV0pm65PMqk6+OAxsQ/le4cHPrGFUngg=; b=oXOgEesdoTVt3+Ajob2iAx259DOK0Oa8KvB2hu0sTcMGQiTQoXukbqgHUJH/WiAS2zWMB9FPAo1hrPQGGZGoqiG72dob0yzR5LeC5kGw3XJX5qhdCU9srqN9JJzeSEkoq54F6BN13zjo1PD/+IoUa0hH140xFJkLVgJ0K42SgoyY3/Xff299wBalB7QmB0tYbTR0XsBAo/0JSQiy961AfbvvFbNMwxM4XQb2CL3YlL9KvyIxQZgnM0Cmz8HQDYLKZ2ht3dwYqN7JOggr5UqHtK8GTdmeBbMPOoNUv5U+fC+4rwv2MUHPii3U80LfcTOGiAKjy4RqHpJjlWYdFQ3L8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synopsys.com; dmarc=pass action=none header.from=synopsys.com; dkim=pass header.d=synopsys.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S+28CK3vbeUDV0pm65PMqk6+OAxsQ/le4cHPrGFUngg=; b=HyWeJPawi1IqwJqcYctv4yqfJrSS3fPxcSldk6MyB1xfgUtHHG4bwMai5y/fpzeliwh06P0br1rQLHt8D5rpAkQ9IHa+6lV/QpX2OOQHxhOzOIpl9WSGwepM3wraYR8+vxRM4H997X3J5cVPY1wfzPpVc7nalJik3ngre8/QyfY= Received: from BYAPR12MB4791.namprd12.prod.outlook.com (2603:10b6:a03:10a::12) by DS7PR12MB5982.namprd12.prod.outlook.com (2603:10b6:8:7d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.21; Fri, 22 Dec 2023 22:11:33 +0000 Received: from BYAPR12MB4791.namprd12.prod.outlook.com ([fe80::d931:a262:ec3b:3e56]) by BYAPR12MB4791.namprd12.prod.outlook.com ([fe80::d931:a262:ec3b:3e56%4]) with mapi id 15.20.7113.019; Fri, 22 Dec 2023 22:11:33 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen CC: John Youn , =?iso-8859-1?q?K=C3=B6ry_Maincent?= , Jisheng Zhang , "stable@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: [PATCH 2/2] Revert "usb: dwc3: don't reset device side if dwc3 was configured as host-only" Thread-Topic: [PATCH 2/2] Revert "usb: dwc3: don't reset device side if dwc3 was configured as host-only" Thread-Index: AQHaNSPS+cGPjMXbgUm0J7Qyb3cXKA== Date: Fri, 22 Dec 2023 22:11:33 +0000 Message-ID: <7668ab11a48f260820825274976eb41fec7f54d1.1703282469.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR12MB4791:EE_|DS7PR12MB5982:EE_ x-ms-office365-filtering-correlation-id: acbb1203-1070-4a13-d4bb-08dc033af4f2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AnAsCtfyuENwIlYWIaMMCWi9dxW9CdQAaoAnCujnEnprnLundJjuv0E/H8LfZ899gaj/5r0jFMWs06FJhoo5+0SgCnw8t50lJMSrHgN+c32Tq9xDLu51G2nxX/vA+mYnVnpJcChCUn1NBNB4IerAScXletlvhayUlDacSyG1M0RO0ndMYvogGigf9pqlqLQqYS6+D0C1Ods5+GfBdlUQ1dURVePe8M0zzmmEXAqQcDtkpGs744Ri/Ir6VNjGe+oeINmeD/qI+EfcC2NXC7LPwhBt1wl70NOcyGhfRNxNqeW5FzZbpPjYlwzp6wvHsmKeAemSumgxtPlC7XEgyoxc3+63U97nZgQMzpWC8GVMBczY5dTcEw9Mm90+c21hSxO9IRzSs2m1YeKfKFLQNUsx72B7XWEtVQJrtQgqVEc7vc9l5vs+vyYtGIOyjs8KJPIuUOqTV3KJ/9WlIG2ezox7ApmWXqd/GEA0ds8W+5aRsqqA8TqN/RNBxkWFanuEQMCMbCyE8ItrwYFo8U1WfKX5yUnT15kyfkhlDUJNDiQG+bg5plERiVefz6e6zZhFANo9N+rkDUXEmps8/4pKZBF+dhO4J2hS2031PtguHYrkzaLqRTWcCMZ18wKpmRqvm0Uw x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB4791.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(346002)(366004)(396003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(86362001)(2906002)(5660300002)(4326008)(8936002)(54906003)(8676002)(41300700001)(38070700009)(83380400001)(26005)(2616005)(36756003)(122000001)(71200400001)(6486002)(38100700002)(316002)(76116006)(66556008)(66946007)(66476007)(110136005)(66446008)(64756008)(6506007)(6512007)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?utGOnKFVjNUELHH9RHUK96O?= =?iso-8859-1?q?SO3n0ZmO0SPiEt24Am0agwPVZNWs/ovz6YIcXxL57MCEAyq4IwZLk1YHw+ud?= =?iso-8859-1?q?ExOBfz9pyycZNdWwuKg2a8w33Glx9o6W0zKwi6tx4kBXgHuh84BVYoqWzk53?= =?iso-8859-1?q?pgVOMPV6UOzoroAkBa6W8Q/jdnCmzHQaHCOWo6jW7wA209BHpdnvtud0W15K?= =?iso-8859-1?q?4x5+gDHRG4UBpB4tJ3czYxxBdh3TfZ8WL825P9S3D7Z2qhLGBAOlU3DxANOB?= =?iso-8859-1?q?5hcOY1eAS+mVKCPnC/t+otNuw6ls9cCIzqrEPDGxY2ENF2x+Wgd2zX/Uh8aX?= =?iso-8859-1?q?SHcadSyCKXEKc6eyUyJocbNn4IkhbFo9yzYOVMLHFp7eMJmdKhoqS0ENXwM2?= =?iso-8859-1?q?B0vN0wz5QF9jSlyB3Rw7opJy7UDtue7+YZZPEpe9Wd3RFB9QGHUBoMANmNlD?= =?iso-8859-1?q?enG14DQjj44YOzaOu1ovWn0/yZu3turRgaY0/MxWPA2Wu8MQs7mkQC+ACR4v?= =?iso-8859-1?q?a/cmgDdRX8/BZKMnhtnrk2zArrq6CkC0xKvvxPRZkyPXT+RrNCShsuPQLhuo?= =?iso-8859-1?q?4N/JW5SPAOfnQrYyamoNGd8HIWauvVxnDDTBkR97JrjKfA7CnWA1kt+MP2TE?= =?iso-8859-1?q?lejY0sfhV17jduEfEp1EsnxDsELDIIum7Yuf/2EhfaYnJryoX/3OzcceJNbb?= =?iso-8859-1?q?+2RcVwA+NWNJz07yJ90DV9VwqOYFQDCjVgxnKP1zfTLXKH5szFXSx3dpkhJ2?= =?iso-8859-1?q?RMpRgV/rZ7fCXPy5viOoX2kLPDpxDXLflvyjA8Nqe6vqhgPwqm62AXjSI/rf?= =?iso-8859-1?q?e+YqEgpSYUgEB2mmqpMzvEcJcD9MR4+td0OcPaXkBO/SWyGD6tfq8STj7TZn?= =?iso-8859-1?q?8D2MVxc0WqFxWQWAna+vcUUCqXdLpSVw+P4vtApF6Sj2lQvBbAoj5UmO3BBe?= =?iso-8859-1?q?zGC/3dYMbDinWtgtB1grdvwj13GikU620TZb3sMUMTbHBbu/GWOPcMc96u4u?= =?iso-8859-1?q?B9ejoL0H6gOIKrbaSrTuUEXutftg0ALx+uLSLoSfLalpj5oAltwfXe/9X8p2?= =?iso-8859-1?q?7k5juakNo1GbljnUYbcLhbjgNghL3T/uDLCw0VmxIiyUvpMyhrm1MjvyyiLU?= =?iso-8859-1?q?vT57PLiLDWa47RHf2nqpzfBb1l5x77rNhm0srBynnpeJgoGQuvoDdcoY120T?= =?iso-8859-1?q?34sK0pyNb8/ljc+bs4ttnJPsI/oOJfINayy4xBKj+6AxguHylnrnYghPVndd?= =?iso-8859-1?q?TM/SbNwgACZ7fpujp5d4IxePeqd+EM2+ev6a3n8ow/0vu7hnxPtZe9YJl6/r?= =?iso-8859-1?q?QNaXD0PKmvu1sns3esTwDNhXc23oDFApTwoMDMSPlGT26vJcY+J3qb+7gNe/?= =?iso-8859-1?q?bJbVFUBVpt0B26obiUxI4DDTgXmG3SBaIj/0nCE7yYgohK+oYd8ctvxS9mN4?= =?iso-8859-1?q?GbLfbJ4Bq91xAkrK+W8oldpeHuCpT4v3C4gu30aC9ADPU6/QG517tjQXPqWY?= =?iso-8859-1?q?CHiNtNAiMvympUhsOqHypJ+T1D6lvwVmTDDis3ASoAKrb6ygNQtA4PyO5eus?= =?iso-8859-1?q?iZ/XJt1cq+FJQBcFINpsh2VsSgjgGV1ny5/OhTCmONVtReFwjEypJ5Gb/liE?= =?iso-8859-1?q?apx7MuCBGelrN79Co?= Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +j+4it+dY3MI9n5o+ZyAoKclwBZj78FBpiID2ybg3SqI+WDsrlwumuWnTgU6knGNxkP3kJ8DVNYf/1S7INeIrvkCUJVnc0wGLh4lsaWltnY37UhhkfzI3VT3gPEnBJkgOYEq+543j61maZOsaD/f072+SmJQc2+/+TJl48dBzu5VbavGad9ArJ0ykS64bxG1fimBMuPhTvY98xiQFny9uk1bKIrBvzfvPzoL3gIsSfF5CAhSN+jFvbGnxT0arx9oKy8EVjbY6tEK8ZAC9VB3KlWKUr4fmrNfS3Vht3eaiceHOSeMJWDJUV54U3NR8ZR4KgIGxj85tYLapVImTSV6PcGKAYDsxXzxIPskA5QBJhuBBpK+ZQGyXcUQLyrDnyyIxYu8AxzRic9E7w2lgua1xQsG6YjMJBkpaPjAehVXRigi8Wnaji2B4USI1CCuFCQ2izQYnG7zYe6LOtsoLAJb612elGBUxS+2/WfMdYCwPZ1+Salvy93H0sY577lJ14HJT9P8P0Gn9Ix0v7rzbFG9decDh46oDR/Tgd6lwiT5j+VUwbZj92yPGtglDkcwZDXf6O/FKIaDGnvhqDnBSus+poC1VCnKMqmLEuXbeIFhN9oWlMyyfLvX2lLVlGezT932FGtCxtrEOu6lFtWLP7U1pQ== X-OriginatorOrg: synopsys.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB4791.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: acbb1203-1070-4a13-d4bb-08dc033af4f2 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Dec 2023 22:11:33.2246 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c33c9f88-1eb7-4099-9700-16013fd9e8aa X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ihQQ7b53d+LA3m5tle3yDgzGc9QYiZ0YO86qrHrkfz0R5ihbvBTObTtxdxpAsPhzeSryk70zpffmcqnjIlB0Kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5982 X-Proofpoint-GUID: l9f6cIRz0VuNwmsYxNmGjT1uRpCvOHSD X-Proofpoint-ORIG-GUID: l9f6cIRz0VuNwmsYxNmGjT1uRpCvOHSD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 priorityscore=1501 spamscore=0 impostorscore=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 clxscore=1015 mlxscore=0 mlxlogscore=905 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312220163 This reverts commit e835c0a4e23c38531dcee5ef77e8d1cf462658c7. Don't omit soft-reset. During initialization, the driver may need to perform a soft reset to ensure the phy is ready when the controller updates the GCTL.PRTCAPDIR or other settings by issuing phy soft-reset. Many platforms often have access to DCTL register for soft-reset despite being host-only. If there are actual reported issues from the platforms that don't expose DCTL registers, then we will need to revisit (perhaps to teach dwc3 to perform xhci's soft-reset USBCMD.HCRST). Cc: stable@vger.kernel.org Fixes: e835c0a4e23c ("usb: dwc3: don't reset device side if dwc3 was configured as host-only") Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 832c41fec4f7..f50b5575d588 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -277,9 +277,9 @@ int dwc3_core_soft_reset(struct dwc3 *dwc) /* * We're resetting only the device side because, if we're in host mode, * XHCI driver will reset the host block. If dwc3 was configured for - * host-only mode or current role is host, then we can return early. + * host-only mode, then we can return early. */ - if (dwc->dr_mode == USB_DR_MODE_HOST || dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST) + if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST) return 0; reg = dwc3_readl(dwc->regs, DWC3_DCTL);