Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2550881rdb; Mon, 12 Feb 2024 08:20:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW96qW/hqjv1+LRhft7rfR0faltWC2NoxbEflyXS0DG0WUKj9vWI3UjQpXrjAVJbOMtWCKBO9z54ljr4V4hmy1sQ67y1jpz6X9pUumf3Q== X-Google-Smtp-Source: AGHT+IG+8d7g+bg3gHt0R9LcjiyDagbhSNjKr0AGtzdVcJ7wt7dM78/cpwfOLxs/oM99Cqz5Um4C X-Received: by 2002:a5d:9955:0:b0:7bf:d163:1e96 with SMTP id v21-20020a5d9955000000b007bfd1631e96mr10310385ios.6.1707754819739; Mon, 12 Feb 2024 08:20:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV4d7Px4BrDubBSGAlFYO0eLN/zMwSvwo5PeSozeEpUUKeRAiP8pWPOw/12pwLJKVNcR/79NBI03yHqwMs3GK5yiA2h/kN8llpjN/XcDA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g18-20020a633752000000b005dbd0d798a7si441192pgn.558.2024.02.12.08.20.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 08:20:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61949-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=qMxMH0Fk; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-61949-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61949-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5CCCC28116A for ; Mon, 12 Feb 2024 16:20:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02FB13D98A; Mon, 12 Feb 2024 16:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="qMxMH0Fk" Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2058.outbound.protection.outlook.com [40.107.6.58]) (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 109BD3D552; Mon, 12 Feb 2024 16:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.58 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707754775; cv=fail; b=QpNgpfbACbilAEZdojVovty9JsGeT+Flqy8Q8rOaYPfHKxBJ1tg9MkF0v8y3K6+QytGZz4kRYBZfBGB4g3A/RJ2ThMrztKAFwMOxBXu/kY5YlyH1va8JlmuXOMEBW4Vqtdm7FdcNgC/1y/rKVP94geyADsevjKEvnixVSao4oxo= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707754775; c=relaxed/simple; bh=RVZanAIO2cvNYwqNO1H2+H1kfQCW0KHxJ3QV94uN8yE=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=TnH23vePvQaSH4//BwpJFB43RcrDOKROo5vSMfXtnwGZp+lQUdl9U2bCP+em2OhTRI7Ue8jSqnpT8uk18i2NAIbp39EaWyqLOW4pgMq6X3dsxfrD1Xe5GFCASWxtr4hzTp549IjNzIUUTxZ1t2lsqfSAo9ePJzEq91xNRmEfTaQ= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=qMxMH0Fk; arc=fail smtp.client-ip=40.107.6.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CgAGTf6jHPeivSZd6gk/oXqAJ9m5O5NO/uH/3G4NE29/oudl8I5p1MNjetvvuSOGrmzZoje5tUa5ErEluqsJ3tUouaTKdcrIZhInLu7cfzU1nYrXW1iToJ5QBG1GYZSDRyeNulPXerJltdaK+gnApwwpjulU4wYztBx5zpeG4h7bnW1PyoWP9u/oaheezXh3C2K63w0RxZeARYiO26bK7vcV65SFhThQjyEdFF2rj0KmwQYf89d2swfQwnyn6PQssFdiEJklpi1Al7l3ItTEyZ+OnnbovalFal7YMW1dkghnZ5kbor43kg0jX/YUJKLry0nLQYzOB/m+eNzEs68ssA== 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=pjv7QnKdUodCbDCtWeMa8BZzh8+qG0XKvEheQHpbLE8=; b=mAlVImCzFYSzuM4GDwwWMXlC5EOjiEUOpsS3Ov2vicj6K4sY5K6NGjWiizJwe8jq8NpF7muoTBIg7oDqKLjXhirMFmN7DioA4xyvuSun+AMc01+oVvqUrY4E/cEiMx/hRUHb1wLK5e88su1FdNYMGaad6b5UWey4wT+5he4wooW2NIaPyJvYTXNm4AhGiqxexVhQum9kZMNqXMrH/PcFkMMjkISFY6JnXIZHaHiHYLQcj72L42CazCGc24U5xdHH9eUh+SD8YD6L4Ls8tHzVL3/RJANgobvlcqnepp6cO/tesSpDp8PQ5kiVv3+Z0JnO7fhG3yHteAoVEDbqPU9Uqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pjv7QnKdUodCbDCtWeMa8BZzh8+qG0XKvEheQHpbLE8=; b=qMxMH0Fk4t8T4euYIkQpIKS3HL0eStO30VZG5PfeCJqbYCpSHQe9vhxtEDh14aX0ogpy1T++c8NS0fQfwpDpdc0cbQau4f7IyDeEp/c2vcDfVn4IHWn4Z7Sdc5oDcv91ncvICQLyqAP5awNmYJhgFyijcyjY2ElSLjJINx/UHS0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by DU2PR04MB9049.eurprd04.prod.outlook.com (2603:10a6:10:2e4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.35; Mon, 12 Feb 2024 16:19:30 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::c8b4:5648:8948:e85c]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::c8b4:5648:8948:e85c%3]) with mapi id 15.20.7270.025; Mon, 12 Feb 2024 16:19:30 +0000 From: Frank Li Date: Mon, 12 Feb 2024 11:19:08 -0500 Subject: [PATCH v2 2/2] usb: dwc3: apply snps,host-vbus-glitches workaround unconditionally Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240212-vbus-glitch-v2-2-d71b73a82de1@nxp.com> References: <20240212-vbus-glitch-v2-0-d71b73a82de1@nxp.com> In-Reply-To: <20240212-vbus-glitch-v2-0-d71b73a82de1@nxp.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , Thinh Nguyen Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-c87ef X-Developer-Signature: v=1; a=ed25519-sha256; t=1707754764; l=2477; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=RVZanAIO2cvNYwqNO1H2+H1kfQCW0KHxJ3QV94uN8yE=; b=UDHEWzz3fU1LvjbSPirbztQdGXqjfNd3iHqO6GmfrBVppRfsEjnhT2hc3jYX53NlAmYGMNW9h +vnx1nUSV2lDyg9HTpsxJEoY3UkY+wjsL1LB48xPmGU9DqGtW7lA6q6 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SN4PR0501CA0001.namprd05.prod.outlook.com (2603:10b6:803:40::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU2PR04MB9049:EE_ X-MS-Office365-Filtering-Correlation-Id: 11c26fc0-abe9-4f8c-b337-08dc2be66444 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9MvcPLGXj1UyHo5GTB/5dhHzpG2cjs4vUQh3/K9X3DTMlQgsoEeGbuP0iW5XmJcbihgGTXCHe1ItVLS/rcsGt6L+d84VeOxrf5AORURMzqXoPYkrBSgkfufbUL3HPE9/qjKeh1pSSGkBqonmk59gZSQMDodY+Mtpc8Z11+LYf37pL1bVuY9tMvTP7X8sEi5MI9Ll3UysBYQs0xAgItkmxE+CwxyfDAXGJg3MDcu079h/Mji9S4GrZsYHE+6cXcXHn9GowPw68Al6Z50rKwf3wV8phHgc54Ijh2fkPz1jYFZGC93ZwUJ6WZaLx4n3Iari5ev8GfekAqY5D3coOAXIu2oUvI+hEzOYx7oM0/BcwuGl7MOLgpeCMhPX+CbiLFUgYXokat3cwVboyaMVlw+BWRXoVadFtTrFJOTfRazQPbzE5cs56d2xgq5HWGgLi2e5aQD5a8F0wgRp5L+oPtZSlscaD5qySlShMffoWPqbcViiNrqB4GtiFB0YRULE5pXOYp21y8MmKNoCOBQRZMLNBxM0v8t/7KctvBAWm8EWwgXR1KtPK3LcEARAcTVSncQHk+YCZAkIQ0UNLRADeGzuckUB7BhXCIz9LS2ABLIj5qzV7sK19/gg7l3Q/7wM1hu5 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(346002)(136003)(366004)(39860400002)(396003)(230922051799003)(64100799003)(1800799012)(451199024)(186009)(6512007)(478600001)(6486002)(41300700001)(8676002)(8936002)(4326008)(7416002)(5660300002)(2906002)(110136005)(38350700005)(66476007)(6506007)(6666004)(316002)(52116002)(66946007)(66556008)(83380400001)(2616005)(86362001)(26005)(38100700002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OXJFTWFaYmFOZTVqMSsvRm9WN040aXZzcmdxSEpManJkZjlTWFlvOEo0VEJW?= =?utf-8?B?a3RiUnVEYlhoZjhWbFRpZXRIOVUrdjJtNG9uWEN2SU9nZE0zVzl3eTJK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ElBNG45cisxT1hzUnFzYm96QWc2UXZMZEFWWlJiaDU3My9CWGY3?= =?utf-8?B?OU1jMzIvL010NFRNbCtnemNvemxKMnVvTXJoMXhSVkFDbGF6NnNuRDU0dTR2?= =?utf-8?B?NGQ4TGtQK2dnNUpHa01uTTkvMjlqVld1c0pPWDEwOTlRS2xYcEFrOTE0Wisy?= =?utf-8?B?Zk9LRHhGWXBtUDhVY2J6Y2k5cVFmZ3JhMitaN21BYm9pMkR2alF0ZW1GU2lO?= =?utf-8?Q?Gdjk=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11c26fc0-abe9-4f8c-b337-08dc2be66444 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 16:19:30.5521 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dZjJkGXhNVIGpybPBEctOi2EJrUCbA3u9IrvctqR/Uwc4qlEWa+zo/seKT8lLCTmAQpx3+TKyO1bF18mOWsTnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9049 Remove 'snps,host-vbus-glitches-quirk' and apply workaround unconditionally. It is safer to keep vbus disabled before handing over to xhci driver. So needn't 'snps,host-vbus-glitches' property to enable it and apply it unconditionally. Remove all host_vbus_glitches variable and call dwc3_power_off_all_roothub_ports() directly. Signed-off-by: Frank Li --- drivers/usb/dwc3/core.c | 3 --- drivers/usb/dwc3/core.h | 2 -- drivers/usb/dwc3/host.c | 3 +-- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 3b68e8e45b8b9..3e55838c00014 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1626,9 +1626,6 @@ static void dwc3_get_properties(struct dwc3 *dwc) dwc->dis_split_quirk = device_property_read_bool(dev, "snps,dis-split-quirk"); - dwc->host_vbus_glitches_quirk = device_property_read_bool(dev, - "snps,host-vbus-glitches-quirk"); - dwc->lpm_nyet_threshold = lpm_nyet_threshold; dwc->tx_de_emphasis = tx_de_emphasis; diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index df544ec730d22..e3eea965e57bf 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -1132,7 +1132,6 @@ struct dwc3_scratchpad_array { * 2 - No de-emphasis * 3 - Reserved * @dis_metastability_quirk: set to disable metastability quirk. - * @host_vbus_glitches_quirk: set to avoid vbus glitch during xhci reset. * @dis_split_quirk: set to disable split boundary. * @wakeup_configured: set if the device is configured for remote wakeup. * @suspended: set to track suspend event due to U3/L2. @@ -1354,7 +1353,6 @@ struct dwc3 { unsigned tx_de_emphasis:2; unsigned dis_metastability_quirk:1; - unsigned host_vbus_glitches_quirk:1; unsigned dis_split_quirk:1; unsigned async_callbacks:1; diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index ae189b7a4f8b8..98964e8dea1f7 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -114,8 +114,7 @@ int dwc3_host_init(struct dwc3 *dwc) * Some platforms need to power off all Root hub ports immediately after DWC3 set to host * mode to avoid VBUS glitch happen when xhci get reset later. */ - if (dwc->host_vbus_glitches_quirk) - dwc3_power_off_all_roothub_ports(dwc); + dwc3_power_off_all_roothub_ports(dwc); irq = dwc3_host_get_irq(dwc); if (irq < 0) -- 2.34.1