From patchwork Wed Jan 26 00:02:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 537554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F3CCC63684 for ; Wed, 26 Jan 2022 00:05:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235099AbiAZAFT (ORCPT ); Tue, 25 Jan 2022 19:05:19 -0500 Received: from mx0d-0054df01.pphosted.com ([67.231.150.19]:64713 "EHLO mx0d-0054df01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235042AbiAZAFS (ORCPT ); Tue, 25 Jan 2022 19:05:18 -0500 Received: from pps.filterd (m0209000.ppops.net [127.0.0.1]) by mx0c-0054df01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20PMWGMN019211; Tue, 25 Jan 2022 19:05:11 -0500 Received: from can01-qb1-obe.outbound.protection.outlook.com (mail-qb1can01lp2056.outbound.protection.outlook.com [104.47.60.56]) by mx0c-0054df01.pphosted.com (PPS) with ESMTPS id 3dsyrhrssf-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jan 2022 19:05:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jXqjo2Nq9Wj+Mwr5MEpmRD5vZJfcu3yA5FOeILCXjvc+iy3F4YCi550dTLru09VdajKVMgJAgRO43Qol8Vr7JhDXg016LZS/WGZeskiuhFZASdMn+DSPvrG0+aFmK3hXf0SUe3x4F6eyCjT3URDjYnUuJgB2O7HlraYYxyzDKantSfjQQecOC5ROPi3/5JpVX/POwzyc3PAd5Hn3cyEp2ghr1dwjcDHgU6EvjSK9uHzhzarNtFcwuK+IdBiV3QvBQWIoTUUlSzhapNFVc2+hKqx8QQ/6RAFKWL4H0rhoQzx4xwkuzasO8l2jL/y7if90hI0ulULvS8GfDfqNQOM6Mg== 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=TB8w4NHXrz4wo9AhwquxzScWDCoe/omfno4EycAboM8=; b=EIVRf3yytHQvglly+kuqO65ZtCyyHDLfoACmGDD8RCF4fBb3SadhXkMdGet3r4mlNsNOUGKf7SkE4mqZNdjmALV7Xv2hmI3c2CLRIntn1GXJ9MWhjRQ1/GQItC0HoODL4NbpPNpVZKCCjpaueAG1/cz0GSiJqT7jAL6lpR0zEwVyVsWjAa/KVlACYPfBD1S4mrTOhduyacLD85+CWdpanGp8dhdbmzAG+j3tfh3ay45aX37IODsVaW6GBnowNMDhkQsT+B5IC2w8XYA4heeJQfBYj7faZ11tcutSHUNV6yDgilWYCPb74/nYPNy05zVdEP8ifKaR1FEJr4MiJE+Bsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=calian.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TB8w4NHXrz4wo9AhwquxzScWDCoe/omfno4EycAboM8=; b=hkQkq5DZp3j19iQ8bsocci1CvrbSh24z1FIcbgHhVfvHFA4BBeqW23bN4MYZT11cKDQaBQwSIQ6IpGtlMW5k2xsGO2nEhE7vLQUcRZoBRhrfUpIJ2E4Alh32Yxln0dXJmANV2IaDzv2w5/rvycu8mf73ojqQiu0S7j8LDnypdWo= Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) by YT1PR01MB4172.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:28::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Wed, 26 Jan 2022 00:05:10 +0000 Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::6929:c39f:d893:b6c8]) by YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::6929:c39f:d893:b6c8%2]) with mapi id 15.20.4888.020; Wed, 26 Jan 2022 00:05:10 +0000 From: Robert Hancock To: linux-usb@vger.kernel.org Cc: balbi@kernel.org, gregkh@linuxfoundation.org, michal.simek@xilinx.com, manish.narani@xilinx.com, sean.anderson@seco.com, robh+dt@kernel.org, devicetree@vger.kernel.org, piyush.mehta@xilinx.com, Robert Hancock Subject: [PATCH v7 1/4] usb: dwc3: xilinx: Skip resets and USB3 register settings for USB2.0 mode Date: Tue, 25 Jan 2022 18:02:50 -0600 Message-Id: <20220126000253.1586760-2-robert.hancock@calian.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220126000253.1586760-1-robert.hancock@calian.com> References: <20220126000253.1586760-1-robert.hancock@calian.com> X-ClientProxiedBy: CH0PR07CA0016.namprd07.prod.outlook.com (2603:10b6:610:32::21) To YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06e812a6-7cfb-431b-1d2e-08d9e05f84a2 X-MS-TrafficTypeDiagnostic: YT1PR01MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: By/DUoW1NPZ6qqWAntT0ZfkrL7WMvh8xNhcFDQl6vJ/jtfFqMbkbpQvgcIw2wGtmCm8AeS0qnQftFiGLEY9M2AN8C6PDBmgUJLiRMfofR4Y3Rfk8cGz3a/KTT1o46wAXCXMhtgsRWLYitYWcmpA3oW5YHwezG/V5Piv2CH1y37OSi9wrS6mtdykxzPkoK/XNpH7K7IaUPfkhXzHWgI6GX/rnqHiUJkRJkomhVcStNdnu4cScA5cFUVSHCFuhRQROicq95SpLuBkRiyRWgX4n7wrgEBT2Fc5AsxeTMGIJ8H/0Bj8lNNECPH2U/yrXp293RlYovBrAzEKfON07M8rDgC/fanaEG1qmSmENHZwPvOMAqaTbOt3BEKeyVKDmlMRdnDRPj2sxvpZeNnE082oorzMDZAPuNBZtjRO+EuH/BiM1OSwes4Vz9BpMde9CuOzslf37DrJok/pTnWW1tA+8kXjQ38+XdjoZdqD5SXQN5uby0MKzslx5C1MKAD/x/r7tQbzfhPDQtU+gPi2+MbmYg6t035CLAW85FiQvfkKQUN1AaxmBCy2Z0/Nnv+xwKHBBzsVn1akXhF14VD5zoZZoF7iIlaNCUEfL6XhdE3N29VpI2fGhKHCymrIGNouFLqBXc7CtEJv44gRCScgo705Pu0J3LfO7KHCDKdIrSXnUSgLGcdvH//9/vP0cNt/5T3lQqwpaZm99cKCSyJGGCYMIDA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(366004)(6512007)(316002)(8936002)(52116002)(36756003)(6916009)(66476007)(83380400001)(186003)(2616005)(508600001)(66556008)(66946007)(5660300002)(26005)(6506007)(1076003)(38100700002)(44832011)(2906002)(38350700002)(6666004)(4326008)(6486002)(107886003)(86362001)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JTgIGkrw2MSXn9n7JGCMc0DxTAqHgkpaz4M+SnMXxsAE/y/lAXGPRszYlLngrgAyVLfB1JanqOynVBiSRiMqb7z4MJ+bWaBtFiBl96VKQ99D37hMhTLjL/b2OXBP5MHUnb/F4fqtlS3RbQOR3amRTWK0YUtE5eSI9vJRXrGSKseQG0/J6XVZcz4iW04ZxOnA5xG9xx/CPZt75sobo2PyxE4kW+WoUCHWSj7T6W0tZMFT9y8h/iBBBPs7P8cfhVf2bX1e9FnEWVP04/LVnouzrfNtAuemvQ7tj3FREx0UzR24yXhX0l6sEL7IW/MvrYJvIWmoS7sVhD3uodv7WMZPlbQg3WDUWR85K3NDbv63jWlJ+50deTrDxgJI1E8kLUMjPeGGhTkG3dJSkAGCp17FKNnsfQV0ZVMQi302WvFxa8k/LFdFfOLv3vk8OFUUEjB1tPOGTp0nOhts6Dn8N1JBNnpazRnYLKCMlwh4m/9IXX9KK47H+TGXAuotFHmLRcb+HcIlJVV7R6D9IiQSD7dcDv3wEu4VgHCQ4v6l/dLicnCJzOJzghByYyLgf+uAlhK95vva3qc6JXAQnWpRcm7aOfsBVcyxlmg8KWyAqG3oVJlLESOv2yvEyHyFDR5m63I1SYwmOUBaxCH0qJYiPnhErkjHPw+ZM0ACUCDLO6eg0ToSE9cOvrWpMiLjxUNl5klDPY8mkf9SCoDMVN1zOuqTk0h6z1CbS/wuY7lS7Z9Pz3YaOChjNn1axpGDOwbi1b4x3PM3vG/89SVMgKNgfz8B+rlxf/xucD3iDYKSjHCftVjkFZszsRTFJmgR/+0chSNOVI4a2NB6pbBaJhktSLOS/pml7mJSkwWvjpls74/zOi7XlUjkUVgMJAJ76CoY4sdKF6GZvU8HxW2fA97jjywAt4SagRsPdM3R70d/RDTzhQaop9wmoU1S3Z2tZanWNPc7fvdJ+WeavCwa9mR098TjnHsmCEng39cyLdloTkIg780jbwATMvGZ5ckqS2xJAknMYIAt/ZuET34xnxU0N1YWTbZGgLWJCygG79rr55/EV8V+8BbmwB6GqMj384Bf6Thhr4K4EFSEPj/cwoaHMXCN4j0TrZFoxZpZyfcoTCnljlPCA1/842Gy4NaL0LUsCF6w3iJquYxLgdbGHRzQibPFQsIvA9Cncwt94C5rwNlg3IDnVR+R1/YQNl8Usjjvxtb4CEEZz1hD45NZpyCgr1aIPZuzpnGO+rwg0p5zCmTQzIBtlq6gUngkvw5yr2WUYVBDHU8+irRUvyf/BXHjBMXrzQx2LZOTktDVgLaZthbp/19+FTdYi8BGTW845ojC0WjemKRFJZqglNcL6Nd3EOuODS0CNUfF2OD6Nlbw/wl+mrafcf1ckd4ZQBQjv7mz46TfTxWiY17CVuIS1CmS7bpSRHAW9B1oagJMxIHmkJxlSc88kIiFEUTRBXo3N99AMXtb03FPmBVOQQulkIFpY3JYEw3fjsM9MXfR/97j9rlWBJ5wC0bcs23xUkn4SsPbl8kjrw7JLR+Z1yz15v9PxGMqpblNhyabTCtgeidHpaU9w/3N6CNJ4GHcrGFiu26QJHp9ywKPZB4zeWL15n3keiB9omaeOl3mxckEgvkpNMfrjXVFY2Gym4J2T00yyPTuKGkTYXdppxaCNkKbdfzHAFylPzRGvnm//wV/fAzyZyEO5Ow= X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06e812a6-7cfb-431b-1d2e-08d9e05f84a2 X-MS-Exchange-CrossTenant-AuthSource: YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 00:05:10.2617 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 23b57807-562f-49ad-92c4-3bb0f07a1fdf X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I4lJsSkRxPy0T/+vILL9ZFNZt/rf+JhckyLgtjb1TbalcuQgHnyY3mVkHH6LmeWFDE0twTaKNKeqB4OExQUfFYDwQQG1KVI8Kc/ysxX7+74= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB4172 X-Proofpoint-ORIG-GUID: NfU3lfKYU1e-ArH8yqk3jIUPK6aTfVZb X-Proofpoint-GUID: NfU3lfKYU1e-ArH8yqk3jIUPK6aTfVZb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-25_06,2022-01-25_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 bulkscore=0 priorityscore=1501 adultscore=0 impostorscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201250145 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org It appears that the PIPE clock should not be selected when only USB 2.0 is being used in the design and no USB 3.0 reference clock is used. Also, the core resets are not required if a USB3 PHY is not in use, and will break things if USB3 is actually used but the PHY entry is not listed in the device tree. Skip core resets and register settings that are only required for USB3 mode when no USB3 PHY is specified in the device tree. Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms") Signed-off-by: Robert Hancock --- drivers/usb/dwc3/dwc3-xilinx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c index 9cc3ad701a29..06b591b14b09 100644 --- a/drivers/usb/dwc3/dwc3-xilinx.c +++ b/drivers/usb/dwc3/dwc3-xilinx.c @@ -110,6 +110,18 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data) usb3_phy = NULL; } + /* + * The following core resets are not required unless a USB3 PHY + * is used, and the subsequent register settings are not required + * unless a core reset is performed (they should be set properly + * by the first-stage boot loader, but may be reverted by a core + * reset). They may also break the configuration if USB3 is actually + * in use but the usb3-phy entry is missing from the device tree. + * Therefore, skip these operations in this case. + */ + if (!usb3_phy) + goto skip_usb3_phy; + crst = devm_reset_control_get_exclusive(dev, "usb_crst"); if (IS_ERR(crst)) { ret = PTR_ERR(crst); @@ -188,6 +200,7 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data) goto err; } +skip_usb3_phy: /* * This routes the USB DMA traffic to go through FPD path instead * of reaching DDR directly. This traffic routing is needed to From patchwork Wed Jan 26 00:02:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 536758 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAD41C63682 for ; Wed, 26 Jan 2022 00:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235094AbiAZAFS (ORCPT ); Tue, 25 Jan 2022 19:05:18 -0500 Received: from mx0d-0054df01.pphosted.com ([67.231.150.19]:64533 "EHLO mx0d-0054df01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235091AbiAZAFR (ORCPT ); Tue, 25 Jan 2022 19:05:17 -0500 Received: from pps.filterd (m0209000.ppops.net [127.0.0.1]) by mx0c-0054df01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20PMWGMO019211; Tue, 25 Jan 2022 19:05:12 -0500 Received: from can01-qb1-obe.outbound.protection.outlook.com (mail-qb1can01lp2056.outbound.protection.outlook.com [104.47.60.56]) by mx0c-0054df01.pphosted.com (PPS) with ESMTPS id 3dsyrhrssf-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jan 2022 19:05:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JPstjHYf9qW5c4hclkAK5bz7NlGZ82WjzNc1dNs/BudB7UYjjiJ2dwC8C5WQyuTsI/TZni+bICz/dsGNX8+EuJ8PuoNnW6GrEMzRcem9n9JixIsTdDpNLRnv+/rfEgK1evQ2CC3NLvW/CGFT/cRKx1ouFaDdEjSj0G3Up5cPvRnYNOCxcaHNMRMgw/vIRur5fDH4bAjtp/x12WXa0URlB6P0+OX0KhRGtA+VFxirQtwwQHqqUyZ0QrOjIWszZlhNJm0vAJvja0ILR7kB06cpeXn/mad6Jtlm9jKN9ppxxuhqtTJgvyLykv/gzvZriw9/rnlcSz4U5HyMb36DRbpJSw== 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=Mwq2Gm/DfxYNkLivgHsuOWf652GunozTKLRE7iW0p7c=; b=cWr2qc4TJUAvEUL7PO/tBTq42AqbQKaf/j+wyvE5LD0H3fUVdFRdCe8pkmLxLDDQMQLpgRPM54CQEpdBGdNNKsoUU1FO5GUdmlySsEEisLrW95v5zx+VB0XOSBWAdTCqxMH1p3KJ72BGOMaOa2N+yIocVI03Lw/aPAfJK75bRnjFZE+eiimGCf/bfpsI9xBrfk/nFXyKzu13zBKlhCcChLJHQRAapVN97+1WZsZZNrtsHFDElVX6WKhffDHZgfUrSlbEzCEokIA22VOW61GCQVPepZyv7MxTy0hWDiKPvMrIu8/+P5ZgvDSIyodk6otKe76BbRVCoXRef7x5XT8TzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=calian.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mwq2Gm/DfxYNkLivgHsuOWf652GunozTKLRE7iW0p7c=; b=IyZZ9H/bguxCU4UyK55dg0TirEL8Yr7ntbVLtXLhrpOkGahnnQ0OQE75DxJ43oQbyniJqqNNTtNcHkJl9BgujNkVoLBKmqLX3R7HkQ48eyj4YSu1NUcKiStyrYURZOv/o2SKm+reu0ASxwXz308RR/jeqsjeYgCwn/14Kev0wYo= Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) by YT1PR01MB4172.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:28::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Wed, 26 Jan 2022 00:05:11 +0000 Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::6929:c39f:d893:b6c8]) by YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::6929:c39f:d893:b6c8%2]) with mapi id 15.20.4888.020; Wed, 26 Jan 2022 00:05:11 +0000 From: Robert Hancock To: linux-usb@vger.kernel.org Cc: balbi@kernel.org, gregkh@linuxfoundation.org, michal.simek@xilinx.com, manish.narani@xilinx.com, sean.anderson@seco.com, robh+dt@kernel.org, devicetree@vger.kernel.org, piyush.mehta@xilinx.com, Robert Hancock Subject: [PATCH v7 2/4] usb: dwc3: xilinx: Fix error handling when getting USB3 PHY Date: Tue, 25 Jan 2022 18:02:51 -0600 Message-Id: <20220126000253.1586760-3-robert.hancock@calian.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220126000253.1586760-1-robert.hancock@calian.com> References: <20220126000253.1586760-1-robert.hancock@calian.com> X-ClientProxiedBy: CH0PR07CA0016.namprd07.prod.outlook.com (2603:10b6:610:32::21) To YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe7df729-f30d-4690-c10e-08d9e05f852e X-MS-TrafficTypeDiagnostic: YT1PR01MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jYQxlUs+Eh7pKkMzkhq7eDTRVfSniOgJnV2bTyLcscTdSReBv+egKjkVVUbKQ5TH4XBkK//vsB/ngSVfRqXvzvKfPYCbB+GOcm+Aj6+UIqD2jfWcujVp8dqNUZeBjdXF68d9zDH6IIumDfhjekZEQqcE1B6wKF2Ks+lKqmLqaDeS279XynaO9Dom0HJCj2632NhkvbTmxXJkAgWG4qJzsU71WRIRot6pBmOHf8Xj2jGOiJW3zx8gv8G4dAZ42dy4CBDd2OOON+YThblyzhTxm4/Ft9jvNjwHoi7b2bsWaj9HanJJ3hOBRDM5HQ5eHP01yyUqQwDsHJ0lF5h8+XrviF59QuwK51vOmXakmHf4wCv6unyUKT9r1WiUTF/hujiudtJxxkLaS3yihLl3/dYmwnSR2216qzLDaZ97pt1S6KtadJbrae6VRwoVY8Yo7Vjyzlswu9EG07jYoCMglr1ChIg24NJosiutzm9WWGF1owl988cSNFuG3VIQp4y6sw7JnChr+DQ0Cb/xyOIgwyinbZK1S2vvPvlYFJx+LCpgg8DQT6S/PVUzhN6GUu0mh1Fu7vCqM+El4brZzXaKAlI8gijpC1r0BkjPfMLnoHh4WB4wv8ZWe3A0r7ZX4MgsbRxniMUuGYhRNY45NXesYL8yY+MCqkspFYEtC43En8w3bhOB8Vkdj43ef1XEd0uPspEqm05sBSSA2yDHsXOD2bUnwg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(366004)(6512007)(316002)(8936002)(52116002)(36756003)(6916009)(66476007)(83380400001)(186003)(2616005)(508600001)(66556008)(66946007)(5660300002)(26005)(6506007)(1076003)(38100700002)(44832011)(2906002)(38350700002)(6666004)(4326008)(6486002)(107886003)(86362001)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5apsMSXUucgVIdoOa9R9/HFjXYcPAMzAhQa53n6sr2RlFYxgZyTmnp9phSMlv2iXAQWoAIAeRNYKBlOximx3z8u0zNZS6WVCNUuBaw2OvEfikMFPSaYwmcxZk9qjcAhhgfr2WVlX+C7dNn+MaFZmQwkC0J7J2jZu00nJtEEXlbHf0Wk+if/DsIHh3DnnqavSiWgMO15UTGrL/a2TFb0oXP5Rf6YeUQ/ZR4UmosEd7VwLoJkq2WPJzQj+CntAwn5LRzHaKadgtesuyBaoCu97bN4RVUdGWUDNbb1mjz+kPNGoSY9x2Z95YpAuywBkLhAQO4dPJL7Eg3nxS2BFKg6Vs9rwp0BmhSd/uSUQ9mN2X0b087f8WiunusqHHhFsHcNlHUua3gkVPNp/z/SHNsTFk/5KE+0R5odNgXyjyoWYRlcyIAivegiAYkLGIy7P31CEF13lEu/VE8C/Rv4ZdA8KhILVDdiqKf2Ue10qPYsqjzL+1ACGllejsajlSpLgDVFX5Svs2bifudv4ArwB72jQWD2JwPH68F8HbUKYG4CWm9BSaHrnkCx8B2NgeG3l3oMFJcX60ZnDobl4xO7okNxTDXfwlLxcgTSx0GKXQMtMO2/GvzmARC21w4zYrMdpJf7YBMtkNTqNXxT7tHaHU/ZAzgGudM9nLmXJlDBR94EWp//zi9KWddZBcLR/UluYDZJ11GDLYMBK9MhoTZ9OdF3srsIckRQeQ7r0yf5Bukrndl6cK1vQAB26lT/Yfl7yyzuOdTPVVBkKbHP4ZHgMUNJ0Bv9FvYlnb1On/UjHH3siCme7YtRILPhf8NaWJbrF/PUFSrF+ZBbQxps8m8mwxvUb8wQUhHxHnZQ69HtZFIOgbT6zjC1wrO5EADmE/uQYNWVCiO+ORaaS6pJBnehBhTjin8u3v5W8zWStAYY1r4zAsePLHrwIWdh9WZGpfr8WYvDMMpcNe15ZAb7B27Mw0rZTEZH+GcwVIZfdhJ7vYg/zQRuiI31tEYEosvlOiTurFJHbjj0BDZt7qo035iixc3/TQccyXDip9Ugv0qPUBRCZKrML5XZTzx55yLEzobNrHp3oZ5SsLs+fYJ1PJ2pwZU3nWPR4wqkZL2PXeDuRRfZpYOllMCCEIQdLyt0szmcPKNd0hedlbH+wEl//LTqWFyv9gAwbxsvW+baK6sf32n5XbLOZHg3RiLQdpUoj59gBKu5oYg/Z0d6iMVQyFpq611HYgqQ7WRm/zPSK7Klbn0Nk064rmmuM0aPcO6yhyFcmLFlv7VKLMG/2hlLFajAcXfM2Av0JDTMzjeDZzakZHlrCT9mkA+ZcLPNxYfsjtxi0atRfcOfta86OaENFsCj5IadbWxD/XUyLVDTkfJ4c+zeiMEwTar62oMA+N2HgZU7PxPLuxhFHEBr72TfYWBgCVz6vguReM+DhhSc/CV3VmBg9kDLloEueqjiMQwjEVzvppeMSDkVe9DyyIzp4VOGqB6PM7Hb6s6xG1Ydyd02ikFh2D5tDchf1cuYZnY5ufa419Z5PmpRq0sDwbGpxAlQ0v0YTleBI0LdLlOK6NbBOqwA4HU14/LzR0um76wyP0Gt18DoLuItxmxzsT7ep4/6KAWhlskpBQCX5nNy2UFYNbPnwrgwJIsFYq5g7dPdQqtDfSAYXAP3cjzaSnxhK0vy430iVw5Mc+x00WOMNv1IKmY/PUPU= X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe7df729-f30d-4690-c10e-08d9e05f852e X-MS-Exchange-CrossTenant-AuthSource: YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 00:05:11.1834 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 23b57807-562f-49ad-92c4-3bb0f07a1fdf X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /yGiRcJJRp5bbQbuyYFdQDVPiNgt7Wf6wS3sapa6aEKWnAEao8NqSSt/ZVVI5Q8NAdKp/H4HBOiSq9GmbZVO3vwP7gQPuwlDxrsiFlc+i9c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB4172 X-Proofpoint-ORIG-GUID: 71TiUZaQqR0dmeS6YuUpt45dIfb7Xv6S X-Proofpoint-GUID: 71TiUZaQqR0dmeS6YuUpt45dIfb7Xv6S X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-25_06,2022-01-25_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=599 clxscore=1015 phishscore=0 bulkscore=0 priorityscore=1501 adultscore=0 impostorscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201250145 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The code that looked up the USB3 PHY was ignoring all errors other than EPROBE_DEFER in an attempt to handle the PHY not being present. Fix and simplify the code by using devm_phy_optional_get and dev_err_probe so that a missing PHY is not treated as an error and unexpected errors are handled properly. Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms") Signed-off-by: Robert Hancock --- drivers/usb/dwc3/dwc3-xilinx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c index 06b591b14b09..e14ac15e24c3 100644 --- a/drivers/usb/dwc3/dwc3-xilinx.c +++ b/drivers/usb/dwc3/dwc3-xilinx.c @@ -102,12 +102,12 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data) int ret; u32 reg; - usb3_phy = devm_phy_get(dev, "usb3-phy"); - if (PTR_ERR(usb3_phy) == -EPROBE_DEFER) { - ret = -EPROBE_DEFER; + usb3_phy = devm_phy_optional_get(dev, "usb3-phy"); + if (IS_ERR(usb3_phy)) { + ret = PTR_ERR(usb3_phy); + dev_err_probe(dev, ret, + "failed to get USB3 PHY\n"); goto err; - } else if (IS_ERR(usb3_phy)) { - usb3_phy = NULL; } /* From patchwork Wed Jan 26 00:02:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 536757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3594C6369B for ; Wed, 26 Jan 2022 00:05:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235101AbiAZAFT (ORCPT ); Tue, 25 Jan 2022 19:05:19 -0500 Received: from mx0d-0054df01.pphosted.com ([67.231.150.19]:23922 "EHLO mx0d-0054df01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235095AbiAZAFS (ORCPT ); Tue, 25 Jan 2022 19:05:18 -0500 Received: from pps.filterd (m0209000.ppops.net [127.0.0.1]) by mx0c-0054df01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20PMTh2t020266; Tue, 25 Jan 2022 19:05:13 -0500 Received: from can01-qb1-obe.outbound.protection.outlook.com (mail-qb1can01lp2057.outbound.protection.outlook.com [104.47.60.57]) by mx0c-0054df01.pphosted.com (PPS) with ESMTPS id 3dsyrhrssg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jan 2022 19:05:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d1wVKbQvzSHdD3H4g7RjebSwJzqJwAn4OBu13NGYNcgQYiRHjodrJp/HQQLWccYs3+DecDPJGtel/vD+3oqumw2WurzbNusrdmSJgL2UB29WpzRVN8qmWGALj0gppknhWjLEvnbdmN801pYZ5Z28morSaIX4DaK3jS9/3OY+cz4niP8PVXByihuU0NPqqvi3SRmgga4FutN/JdvawUH2fLoHR20u/sdDy/Eh4nYltjW7uIP1hcS9wt1isP9QRDj9U9pK19W09dZrLA/J3/Vq2D+kvReAoSTRs5DykeixxHEeLdfXhgcsGTwTCwia7cXjxst9ecIk4iofnmakDHafwA== 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=ghBXjrKj4h07yKXjMO/OAnSWqzE9kD4yknqRBRLKyFU=; b=gXjsKDeKBoKZ7Uw+/VyWa01+xMChqoOh6ppbIWi49aFitS608CSUxHs8zzW4whzBS/N4z95bL0dwB5MvxuRkAJNVUN6yvfUrTUloMOOzPrHSAvO4/dasTLndy6tvT+2dsTk11dq/bbHSl8pBOXakMt4Quoq4WkbkMlvnd4a/np0KRXEiKeh26sRik+/CtrMl0oLcBcCcLY8XqIY+VaZYXuogVOF9xnU3UTbWVVa0+8zxzVWoYOBlOJfYtSuTFwsnKrjIKDA/CgJG1AzHo/3PbkV79Q6uNb1kMkPV5Pa8bqn/SCeyu4QRx3J7yOD90DQu95ZAnTiDK2hU7kQ8qq4RHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=calian.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ghBXjrKj4h07yKXjMO/OAnSWqzE9kD4yknqRBRLKyFU=; b=Xf8G3272sS6OUsRObywWb2qreagAllemWLIHO1K3a1F2a6Y4Xuk0lIGmzG9lcQALfF03diniMdRfv5vLvrO7PRq7NcFxBum8vq9WoWXsHWO4n/zmOn2FqXx09iea9Byc/XYZFaGfW3/wUSDvAhJ3bxFTk4VikCyK6ByCs/ZLrU4= Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) by YT1PR01MB4172.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:28::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Wed, 26 Jan 2022 00:05:12 +0000 Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::6929:c39f:d893:b6c8]) by YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::6929:c39f:d893:b6c8%2]) with mapi id 15.20.4888.020; Wed, 26 Jan 2022 00:05:12 +0000 From: Robert Hancock To: linux-usb@vger.kernel.org Cc: balbi@kernel.org, gregkh@linuxfoundation.org, michal.simek@xilinx.com, manish.narani@xilinx.com, sean.anderson@seco.com, robh+dt@kernel.org, devicetree@vger.kernel.org, piyush.mehta@xilinx.com, Robert Hancock Subject: [PATCH v7 3/4] dt-bindings: usb: dwc3-xilinx: Added reset-gpios Date: Tue, 25 Jan 2022 18:02:52 -0600 Message-Id: <20220126000253.1586760-4-robert.hancock@calian.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220126000253.1586760-1-robert.hancock@calian.com> References: <20220126000253.1586760-1-robert.hancock@calian.com> X-ClientProxiedBy: CH0PR07CA0016.namprd07.prod.outlook.com (2603:10b6:610:32::21) To YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e62ea10c-f817-4812-000f-08d9e05f85be X-MS-TrafficTypeDiagnostic: YT1PR01MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:418; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mJ83tTplCzddqk3DmPUNy9EHMv9txvM4EAkSwE4NZ515ir/kOFOU7uW5FzhKc7zClsKshrdMtUBwqGVuzxL5wGUq/95Qbn7OiSpjRw/eD4u02IsiLEKUj2Wz+t8tKyq6eHueoJpWLpqZvURkcBnL19VLz0oPt3oNR383UlFzM4XVPDlzApmAqFXfVNMa1iZxJ95uNlhu5070uGMNkDcDQ+PqYiMeFiY4hiGXfj0OSlwfbCkhINqSGA1YZbzIBgiGA5eztsczxBoc158u1rmkR4SsVqzstEW+zhGvrYL/h9bzJOEJ5EvZCmZF0+DVdTpP7Oa7L3+zRAJ4CJdasURj2A01LetNZaLnaoT8vZN5bb7rqVfTEQo+RPd1/B+R+Z4pIjIMhF6wpzthXFVyVUySY4bRdkrTyrVKFMhaydl1KBIoke/xx/QroVbgFhFEh1uNra6V5jsMxJ0zojBCjAvBpZ5/YXUyDwkoWhAGr9t7Dbde7tSHRo0WpYrSwVu91zhZEdi2KisfprUJepa5Y8cIO6df9XfFmVEIRlQeqBty8BEyWC3EnUzNT3bHDAh532JOByoKLE8tkVFv0waK7Y0tRNy1juzwtQIyfSo+8j5q840X396OfKi56OGrvzddYdTUH6Pk3envZ829nfkxnpxI9G3eE/KAAKab/rCpVCiYHhrP7yAVwt6fTCGzX1z3Vtn9fqmIN5eESC1wnE7EjMDuqA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(366004)(6512007)(316002)(8936002)(52116002)(36756003)(6916009)(66476007)(83380400001)(186003)(2616005)(508600001)(66556008)(66946007)(5660300002)(26005)(4744005)(6506007)(1076003)(38100700002)(44832011)(2906002)(38350700002)(6666004)(4326008)(6486002)(107886003)(86362001)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u+CQ+HXHA6rFrUf75thcdaWuUpkPCpngADFvGkgBW/FYdBV+KrmU+FzM4T9CMMw/rgTpehruyCoTjU5VgtGNOY4H9qd1GAPatSoCV2JxQbp9yPgo+umnYETrT1H8hmtyjlBRfsIM3BA22EvCj8xbcqIXj+PpiAcYKeh/lpVnSeUujGAB/JNPHvwZG4d6hRFldbi2gP5CCyDco65RWSMfusd6xWhSekDaVWxGCgZrDA3l5PBxP+CFvh9A+KIgJ9EW4cPgeCI2lZyRdsmLYadSrWFKIDLWzuZ2O+bJca/RifuoNsPQEQ+iA8ACw1G4mSU1ntlT2UmK9KDgViieXDgWIVH8ORTbugnYVoQ/7BsceAjrgBB/2bUc7Mn0+3QNRb6d7emRnkFXj5frJm17ei+LLsDTRGHX88hiHQVmzEdkTQv1k7H6XJyd1+TMMG5XbHUHV+EdgLPUyNmppWLphANbtvWsFnEty63ktBK59Z2Rth5xS7OH0FhKBnGxxrL/eL6XvftNddGZFFpuXQolEKn3BKOBylgFtjzwBWpTCZY2hXXPj99TECn/q7gEEKFMbgV2L3+4yXTVATcKMy8cQgNpm1k8SUT9ELpwE3L26q5/m31Y9jKdmohkBmGfi0y4v8utcAtx3QKdnoGUznEQbJAcuFvioMlQH+r9y4oACA7wXN74LrDu1/imzAR3UtiEl8Tr+C7W9evd1jDsBoPFQotJQMJnt3uRZlp7F+B5ijhaj6ER/xA7IxxTKmu4nyAb/rSZaUiihLehieMbePQHhQGreJ1Y5A/v+Edbeo4SY3niO0azy0YajbtwzHCDFcIk6szEOZChjMvNJ27u0C/FQhNy+hutrEKFRXMSOPrUQr04dztJdFw4HfVBGYyfm26LY00IYEQRfv1W5HJsqUtdhLFOxaXBTUZSNL680qSJ8u1f5m+n/Bx4/es3dAARv4MLMXFGbT4YngOU5wRphzAZAX03T2YrszXjaQNoYeEzQLyYI9C/9fRN9a67VC61N4Ce9zhvuKFM97DYwHpTn7ffpQ621FlhsXYIEq/mdSO2GiPtP6RBs9vRAmY3LDoUQ6xJxfTgjzr9hy0EwkV4z1fnrw07HD6hKmFXlcI1KUfZ9LimIYXLj1u+uX3wTyCcFg3Wodp2ri69gLozf2e1qcpQGoM3gwu/3IfunO8SBgPGF7DUR+xb5UpiGzXJ9h5gJKh/EkvK8LSLsI7PquBv2tXfBH6KS/sU85NTctOwWZt7/DP1pYynCgi2TH1CKeoR39cIvtomyqQXx/yIcPIZWi5ZM1cfGYxtFqhGvYSWyIHVbhT2G0eWB0gwVpwJEs453NnGVNNqMLKIekACT+kb1Eddp44nut8BB7L42CeYDmz6d8x2sSXKEJiGKc0Zy33ga7BFQm3Zft4Wci5r4JDab7Tfjo0NsDslc+GezFpMC35CSevD5DhZVBaVNc5FV0rj7yK6OhYqxl9E+ev9skVoty6Y5Sq02CDtI/DR3EO11jCuxSEEB4noYPr6A8jRJexbkEEPDbboMInzDNQcOdhpi4IysoPO0J3MK8hzLxJM2XipNBXxa+/uMtZeHCYx/LCONsLPp/zYaoo7Tw0N/pgHHDIPnhWhjFRNoPg4caeeaCz8UZZwZgJMt97/DmU2shpiS8HMKf//wk6cqTCYSRxbcrN1BsDlZuBOD6oYTIaSVSyqIFfwaPM= X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: e62ea10c-f817-4812-000f-08d9e05f85be X-MS-Exchange-CrossTenant-AuthSource: YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 00:05:12.1378 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 23b57807-562f-49ad-92c4-3bb0f07a1fdf X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YNScaU/77Gq35tCzTLjPUU1bdCwNIG/zfyxkWqbyDpdMJ1wXNXo5r1D08giEyVte66Ba3uj6P4aMgCjY+54WHJOqGclMU6vdrSCd6xbaBm8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB4172 X-Proofpoint-ORIG-GUID: Ee2b3bHtrheEmALjxeQJLQb_dwl0hh-q X-Proofpoint-GUID: Ee2b3bHtrheEmALjxeQJLQb_dwl0hh-q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-25_06,2022-01-25_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=722 clxscore=1015 phishscore=0 bulkscore=0 priorityscore=1501 adultscore=0 impostorscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201250145 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Update DT binding to reflect new reset-gpios property. Signed-off-by: Robert Hancock --- Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml b/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml index f77c16e203d5..823ce731e95f 100644 --- a/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +++ b/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml @@ -59,6 +59,10 @@ properties: - const: usb_hibrst - const: usb_apbrst + reset-gpios: + description: Optional GPIO connected to ULPI PHY reset line. + maxItems: 1 + phys: minItems: 1 maxItems: 2 From patchwork Wed Jan 26 00:02:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 536756 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D673C63684 for ; Wed, 26 Jan 2022 00:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235111AbiAZAF1 (ORCPT ); Tue, 25 Jan 2022 19:05:27 -0500 Received: from mx0d-0054df01.pphosted.com ([67.231.150.19]:22397 "EHLO mx0d-0054df01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235110AbiAZAFW (ORCPT ); Tue, 25 Jan 2022 19:05:22 -0500 Received: from pps.filterd (m0209000.ppops.net [127.0.0.1]) by mx0c-0054df01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20PMsNru008783; Tue, 25 Jan 2022 19:05:14 -0500 Received: from can01-qb1-obe.outbound.protection.outlook.com (mail-qb1can01lp2054.outbound.protection.outlook.com [104.47.60.54]) by mx0c-0054df01.pphosted.com (PPS) with ESMTPS id 3dsyrhrssh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jan 2022 19:05:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=giylEG9MA/07f/Z05qOO6dTIGdo3i86eIWLTHP2H1ScoAFZx/I7pgbbxllOXxBSfmbXBh+NQREtT0DZyNXcHWzY50ELbi0le1dOrfKLarkn/jkSdSLJ6UxJZoQuJFQFsNjfR1et5VtFyrHHN4k4xjwC0AWVuT/TFgmY/ZqYX4ZO9PpXJABaFGI+YA48fypbEH5MjgNqHV84Y42jiuo9hKsZCgSNbQGhDOE9ICj4kY9rnoYEpTuTi8E4LODhI+JEOTowRRvEqKkicOgfw97BfbPkXUt1tXhExs70w2Y50ot2keZJ/FVpsNgC9+L8uqriHHtNL4R29ZhMm9FIWMZxfxg== 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=XlIhxCy2al0R85WxKbglTRjStDZSw4Lisg9na0PGouQ=; b=X06LZqlFiE3hGjHRmcCIHBRq8o5ZzPkYxCGCqKog9Tyuu9foVjM3BHa64aSCVmyVfrLytTNdvy0eD4XtsmReU6CorDGzD8b1rOpUNhyr4/wUQFZ8bruqrEGekDnxm6IDeQ5y9IvcOWR9mLTGiLh3VekfkW4JJL6Y9H2oQ80LmEn3xMP/bJ6hFsoXnlHPnzVJOcHjAdJCLmJBudnJPrqb8Aqfh2YbcgJkLeY5FN1GpaZbRnLHgmppO0HUxG+F/UBTETGv2qK5jgWepr5Th6NEF1CLVfbi7hV/uewoge6fTEywQDAwKM+RGKOCt73ompxYJRrIhYNBuba7FzaYiB7UPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=calian.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XlIhxCy2al0R85WxKbglTRjStDZSw4Lisg9na0PGouQ=; b=UMtb1jY2TFClIiCcY7c6/btJuQa+N3gS9XKdUMebKoGtDKcYjMMjq2k4Nj2Egkhd3RBY8g6slUrHp3j3uRcv5rdixb2KKFezlCaF5QV9rez3RBAJOSEP4rhWiDspda7pv3RPxFLPU7ENIf+6Ry/VUzdMo/eY+O3FG54KNuqavbY= Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) by YT1PR01MB4172.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:28::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Wed, 26 Jan 2022 00:05:13 +0000 Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::6929:c39f:d893:b6c8]) by YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::6929:c39f:d893:b6c8%2]) with mapi id 15.20.4888.020; Wed, 26 Jan 2022 00:05:13 +0000 From: Robert Hancock To: linux-usb@vger.kernel.org Cc: balbi@kernel.org, gregkh@linuxfoundation.org, michal.simek@xilinx.com, manish.narani@xilinx.com, sean.anderson@seco.com, robh+dt@kernel.org, devicetree@vger.kernel.org, piyush.mehta@xilinx.com, Robert Hancock Subject: [PATCH v7 4/4] usb: dwc3: xilinx: Add ULPI PHY reset handling Date: Tue, 25 Jan 2022 18:02:53 -0600 Message-Id: <20220126000253.1586760-5-robert.hancock@calian.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220126000253.1586760-1-robert.hancock@calian.com> References: <20220126000253.1586760-1-robert.hancock@calian.com> X-ClientProxiedBy: CH0PR07CA0016.namprd07.prod.outlook.com (2603:10b6:610:32::21) To YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e12acbf-db9f-49a5-e5f5-08d9e05f865d X-MS-TrafficTypeDiagnostic: YT1PR01MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NPjWkPxA3n73KiwtbLCKPa/8ZN37ddTzos4jdFUVG6T8UaSeWpHIMoSW1A/jt4JNCd8DbyIWFoehRYa8a86P5GYPtMyOOGgIuh/rK874gtJ81z4Naoqp+SFgX0rOqTyztdnyWKlb79k3aRhoF0xb5UHgBeAG6SF/Co2oU2tbZvfFI4b2syUFb15dMDe5jlGhn23cpaI5EmWvOjbtIqsYm1VTSNzUkhTnvfUoGBuVTtpkJrbZGaFdfGp1tia8b4Cjhfkew6vsbLdSFh8Y32qvxa8J1n7g7aJvsdcGfO906V/8K55vRZqiPvwEQpoO9ycB7lEwIFD7SzT7Uhy87vQz09olq2D5sMez/Lo66Ot2hPsdAaVd7qeD3mSxuBfd/pWuKL+bfypmX5HZM9EC1CtfOz4VO2g/6iFupJaKx+aQYbgMIwzD3uM5SUrmo2FzVqFXNKuwYX5DcA7wBT/f5jt8vSNLu5AfoIXk+1COc3j80jggeHWsZyylqZb0MFBfw9Y4MVJlGNV1tuEVRSi7gKeT/mLB3OuarvJpc1jh9bmb8xYMGBuuG+1ifyC16Xw+nzqu0Pa+hKwy3XHsAo420Mm0Eaz6X2UxioEOmo5nVVnPKO8qpV2lhC7AWLN80TqkEB2wNWCNMyuOFCHnTPaUPBEueUjJ6BTc6Qx58yVGXKsJgnGvDPgkrc+3qad1z/5xNP1W27TEH0kBNSBFPppK90lunQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(366004)(6512007)(316002)(8936002)(52116002)(36756003)(6916009)(66476007)(186003)(2616005)(508600001)(66556008)(66946007)(5660300002)(26005)(6506007)(1076003)(38100700002)(44832011)(2906002)(38350700002)(6666004)(4326008)(6486002)(107886003)(86362001)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RVLel/bzw02+0I0xhONBHmhxlXpN1uLcuzWv0K6LDoXrU2w/BgPTEuSht/+yg3MZoowDS6X1GuLxjLsuoqaXburJF6oxU2saD8U56UTWqNY/BPuESP7MlTKrFqcUnNH1jh8XvYNvs7vzUbQ4d3mEtkgQ+8Y6R0QlrKvMJFf8SsU0KnwAvWrzLMcMkRytPeiqx2nalVzVN63Dci7a20TcXvZDcFTuo/8aSncidOZ2Lw1t5hN/gS5flf3/YDP+ww4aUDT2r5Yn0DnSJdxO+yKdfj3aU/Ttz9pEv90PCifR7oyrayFyCSCWGkiImrtIBVM+BK+Og7PdPNg1UlkmkuYpqkSdkGkrVs3EYznaKq8Osqc+7R9Z//oKj1hO4Wy9LBPx/5GhdAaYeNIbsstNdhpUT9qlOKSvyHM/J8h9XOeynMI9NVfCzeTclzI/aDGGeRStop1n3MpHEVopeQLdJhj34KcXRub66+6VYhA8xb/I0idOV0MiZUKzt4hNZQbZxswf+QuzVbgkOFSlRUp2//Mqk1XBGAERHr3wThjH0zrAc98EVXI7IltldyqUn+isu7SIh/HNYnXSUattXl0pO0XZIBexybm622pCh3HZsRs/RVr87AzPzrGcqOeH4ItuYaZgFSU+aak/dQTBbJdTk15GBSPBd41mzQahWQ6iDArlEfaU5TKBvFCaYmmmmutIbBFwWbGUEOrR5h5diuBk0VCLn0jz5Md//WTZf6vEmBr5b5MsBqhBBUGeCX5bO8ESug8v3ltCfCoiVCgjxzq3DvpFeZn5WFDEKONaxQheMyx74Ow+y1+DN4izMuVykTj90Aqcq0sSejmxK1HxX3c2hSw8cFV3o1XF0oVIy1cUtf+oo8QIWc/bb4xv17a/ftKoZq7Aol3eDedXRrF1KyATdQQ6dBQL9UbkdaCMBoKxhR8/i/w2LnYemgkF6sYx0v6ztTQ8eYZssqrdCH0JN8mdPiK894wEJZuunmPs9woa4ehHGtixhpdVLQxJF1Fv5QjbncOli8Lr8oR0KmWSW1kaM/wJnXEZQyw+88D5jmP7vAMDAzVulVSDCQAjPiwFhGRn9IvPL0UBMLH4g9D7hju5rW7WMc/CdA0/mcfRWzonEsnofd8ApkTgPmCeZzIuSL7ReZjn3VoLoHZtuIGQ5121L9yjeRrcMSgVEWRz4UxJCs97vWj3ilneZJM4Oph6Sf1ehArK0fBhs+zNanePkfwOdGjnQS5gmin6yTJqT/Z2M1+MBdo37T+8ZYewQcT1xInjz9y5L6/uZjR80Eb6sovEsFw8WuPxohCCq8vtX9WluramnuIBTgrLJJ4ZI7XMVmxQyml1lFA9NXABaBH96pWUzQZ8yc4Kw1QwyPHDxn2cf0ed6lZ87fFvdi8YqUV5z+doTYutuyxwXmOswfYdnSDlYi2fVEVaQRr7ege/ZyNgbvE+hsGjkMkDKJvok+++isEoOOZbmLuEo0DgcXcyobt+USUoiHS/8rNuzy+uFuAZrNeENmEtVoE58/YxzuWqeB/NE3tPiHtTGHQy1XsnitcpXvZSSmpF2SJkcOD9f2fC2vaEDtXJ08EmryD6Hd3UDixlFYz8QYRgAocoGID7Oa6h5ViIju5Prl4DBLl3NopzuVh/Tx058Snd02f5kZQeUBBlBboDgdGv+1K7WPCMzniAx4raLgfGJGZLrMExPONR9WNH2y0= X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e12acbf-db9f-49a5-e5f5-08d9e05f865d X-MS-Exchange-CrossTenant-AuthSource: YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 00:05:13.1388 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 23b57807-562f-49ad-92c4-3bb0f07a1fdf X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jOMJEdwvyF/LS1tuC3uuo7X/6RJfg+DByNFJP1HZlFW4EoDH45HjHPdJxCmZJf+8Aj4NB8HEJJjSrFi7cOpf74vebk6eVErNgbvzO5qylbs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB4172 X-Proofpoint-ORIG-GUID: ZpCSi-SHv0aSyJcAAt6mp3pamhr_tJlq X-Proofpoint-GUID: ZpCSi-SHv0aSyJcAAt6mp3pamhr_tJlq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-25_06,2022-01-25_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=810 clxscore=1015 phishscore=0 bulkscore=0 priorityscore=1501 adultscore=0 impostorscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201250145 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Hook up an optional GPIO-based reset for the connected USB ULPI PHY device. This is typically already done by the first-stage boot loader, however it can be more robust to ensure this reset is done prior to loading the driver in Linux. Based on a patch "usb: dwc3: xilinx: Add gpio-reset support" in the Xilinx kernel tree by Piyush Mehta . Signed-off-by: Robert Hancock --- drivers/usb/dwc3/dwc3-xilinx.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c index e14ac15e24c3..0778236509bf 100644 --- a/drivers/usb/dwc3/dwc3-xilinx.c +++ b/drivers/usb/dwc3/dwc3-xilinx.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -101,6 +102,7 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data) struct phy *usb3_phy; int ret; u32 reg; + struct gpio_desc *reset_gpio; usb3_phy = devm_phy_optional_get(dev, "usb3-phy"); if (IS_ERR(usb3_phy)) { @@ -201,6 +203,22 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data) } skip_usb3_phy: + /* ulpi reset via gpio-modepin or gpio-framework driver */ + reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(reset_gpio)) { + dev_err_probe(dev, PTR_ERR(reset_gpio), + "Failed to bind reset gpio\n"); + goto err; + } + + if (reset_gpio) { + /* Toggle ulpi to reset the phy. */ + gpiod_set_value(reset_gpio, 0); + usleep_range(5000, 10000); /* delay */ + gpiod_set_value(reset_gpio, 1); + usleep_range(5000, 10000); /* delay */ + } + /* * This routes the USB DMA traffic to go through FPD path instead * of reaching DDR directly. This traffic routing is needed to