Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8205495rwr; Wed, 10 May 2023 20:23:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ua4oyXp1+cOEXZqmbEFS74hCRFN2d6GvWqsBQx6+dK4MYUs3W5hvevIYI3EIrdyDbtull X-Received: by 2002:a05:6a00:198a:b0:643:791b:892d with SMTP id d10-20020a056a00198a00b00643791b892dmr24916782pfl.18.1683775437783; Wed, 10 May 2023 20:23:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683775437; cv=pass; d=google.com; s=arc-20160816; b=z6X41qGIoBA/25AHkwhgDbojC6JKpjqIkSCXguPex51i3jqN3fYLMD1D/vMalIkjnW 9Jwt3phESCB/g5a8FQ8HsxtSaaS86WtMVxOsx1xmL+SrzvG/KmhbjuX1oIcf4xrbsre1 5Cw5TpOIv5Re1auhACEiX8320ZFR1XIY3b9bba9YsoA3aHdBtz1YDznjrimoBx04P4RY eoJ155r0ehF9ahzcGWuQ99qTRK6nnGurGplCssRQsdBsPPHQwA0TMTAdnC9AbS8Htt6w LjqTV78wxeX7jRXitVLkooQj2nMwBuPdS315RmREwH1I9pdHclBT5Ug7VGa8yNaztK3h O44Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:subject:user-agent:date :message-id:dkim-signature; bh=glWyDnuvbjfn81dMPnk+8ciNlXFS5lnuqIM+dQrnTh4=; b=BSmXgkTsYr0VLhN2N27NlAewIFZp8zICndhXwkZNsTJTkEc3k9j0ObNt8J7TpLcGce xec0LQEySCmN7h+10/c7WJJaXwZ/NQh2PCcx/d88QMH1T6r3pEWrA1O0l0woSuITOdeL N9E7L88lHI7/6C5n6bMm9ARuOybFXL/QD2YvLRHlPpghjuYL8FckZ+Ur3ew8NHmq6wOY yGQ4yTOC+FRL4mKawgHHaJxk87djOrzGkvmpf3cvQngUXck+MFvT7ot3GHMjbauqcDbI Y/6PfklSkWqWjUlkiXaV7dca/srUN5H8PhxdlMunPQCFXM8QmZbECh+0FPHWwn03OV6V hxtA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=IzPLyaM0; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f144-20020a623896000000b0064105588e53si6474855pfa.359.2023.05.10.20.23.45; Wed, 10 May 2023 20:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=IzPLyaM0; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbjEKDUQ (ORCPT + 99 others); Wed, 10 May 2023 23:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbjEKDUO (ORCPT ); Wed, 10 May 2023 23:20:14 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01olkn2063.outbound.protection.outlook.com [40.92.107.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B4DE63; Wed, 10 May 2023 20:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mquQVtEYcXivlFycGoKg1jX/k2m1zXsyOw9qB9fIgEZCtQ8CotnPX+g1bvVaw7lZT5d2qPFF6TKKIVavaV4/xsqog9169/LLfuzMQF5QZqlqNgJedjPdNxN5OJ2jQcFOB5gz93XoSVSU5ShP5T6cy1VDvdlW2QGN7lSqKPTx/dA6zf94Wiz/0lPmhB9rQig9cHeb4/gnZYjSYl6pzuD+CY1C/ntaJFEg4+90MVoEkZGBu/qwPe/DkSzrcL8ymg2pljwHGg7l8f87I9t9nzVuxH6BMgJDiHvRlaXu30hz3QC0sKUegE3PTNeKNim9mspGj13Ph5/fiTcL/+qItMmb+g== 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=glWyDnuvbjfn81dMPnk+8ciNlXFS5lnuqIM+dQrnTh4=; b=VSsmRrywl3NcUVCuocKyY8w6HWRh4r40O/GDTugdujtk7sqf3/5cro/2xTfDNl93hdwq2PGdZzx507vfgEy4hgQV0TiAT44VVhz2MUuIFMrjEviM3uT/mn7Y4o/0Nh21LCRCwzc9Z0de4iqowVHWVPDvtCeADb+CueKehU6HB+FoGXmmv/xE+2+QFM3CiaezoUaLtYCF6HgJNoXdbRMrQ1raEUFGMwZT0Ers9bf8Fr1AYUzKJ7rkpc6D56e3v9Y9AidF7+ukTpXnwbcKp7bz/U9VJVbnxsoin2cTeShe4m1OdX+N3j+A+VFzxFa7WNh3SgSAXLyD7yehSDOiJvpPqg== 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=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=glWyDnuvbjfn81dMPnk+8ciNlXFS5lnuqIM+dQrnTh4=; b=IzPLyaM0Kukk8akDJM6eCBmkSFC1ztnhtP9f7igmmucbTETtRxO43OukiT1nrosaKUeM8j62uAfcnFqGCrniR63hppFoqkp5M0KPEjmwJ9RQ+fu2KN40bO5lXkQwgOROg1A7jSmqInhGU6KesM2FCyjwT72RX7+NcV5ogAqX2xrPdSQiptFEiRcB5CbkV40aaHP31scq+odkjlm1lk7gQhKMQc6iXJlT26tLSIa6LzdVNedAsdTBiMcK49N0qUt01c7YRdTo008hajDLzbPdrbzioqPRKjiMSXdNrzMAJo/ykPijhk0tnqNWwn7jvmi42VaOeMBn7dgeaQxE8J206w== Received: from KL1PR01MB5448.apcprd01.prod.exchangelabs.com (2603:1096:820:9a::12) by SEYPR01MB4486.apcprd01.prod.exchangelabs.com (2603:1096:101:8b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Thu, 11 May 2023 03:19:58 +0000 Received: from KL1PR01MB5448.apcprd01.prod.exchangelabs.com ([fe80::93cb:1631:4c4c:1821]) by KL1PR01MB5448.apcprd01.prod.exchangelabs.com ([fe80::93cb:1631:4c4c:1821%4]) with mapi id 15.20.6387.018; Thu, 11 May 2023 03:19:57 +0000 Message-ID: Date: Thu, 11 May 2023 11:19:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v3] net: mdiobus: Add a function to deassert reset To: Andrew Lunn Cc: hkallweit1@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk References: <5b6eb4c3-1ef8-4ed5-bcf3-0bb11897ce24@lunn.ch> From: Yan Wang In-Reply-To: <5b6eb4c3-1ef8-4ed5-bcf3-0bb11897ce24@lunn.ch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TMN: [hYhotKpWPvhX91KTWl08UYyiKjm2Zh1X] X-ClientProxiedBy: TYCP286CA0107.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29c::9) To KL1PR01MB5448.apcprd01.prod.exchangelabs.com (2603:1096:820:9a::12) X-Microsoft-Original-Message-ID: <0ce1c312-3987-740c-ac4c-4ebe0e27f7e9@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR01MB5448:EE_|SEYPR01MB4486:EE_ X-MS-Office365-Filtering-Correlation-Id: 935dfef2-07c4-449d-4597-08db51ce98c2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8ZsD2gTYivl9v3AHDiv+/XyCjfhVoQxCjZkVcRYIbv8+UgQFBgDNsMnoc8Hexk//gSyZhmpTFIPKIBxgdcVI5BvBZiqccjve50iBLM+C4uA7FIsynkT5me1Ko+AQsHjzlhv1hOwmUKWS37A1eNDLAcbo6LaJfKK7OIOYzM+HvEjoTZ459DxgjRPM4tgHMSHq5nqO/RKotHTGjN87Bfs7X2mINwqD3MT/fw6v2grHoT9/9eUervFWMj0xzFgijpBDTf3gWpiEeHM4aZAXpG3kjZiODXnvczwB1FXkRfipbdfdBEA/ZHyj1m2/t8ewT4aIdhoewp0dTt0HErTeYa3tJ3Cd3dhepqnrwu5bTjGEXg5wWpUtX77nb/yGmui1qQRpy1hs70XnsilZWQCsvDT29zkthPOyEsaphP8ADTUN6Zu7Cvd+u0SV+hfjni3nSLjat7Yqzvg4pCP8N9m/Ems2SYMa/+xtmM0OvXMWtAGkVR+hvOqRS4jLCZ1VOqAhl5SeJtEXsRnSOUZ1Ott76oaucAt/9AMjh2+rtqsvU27tPn+n58QJwqOKs9m1zjamNpX68sYo4BjU22AunzoAbGSH3vr0ozVBMBYTdXKdvELbft1KLK7NMLsB0oQ0wClY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2 X-MS-Exchange-CrossTenant-AuthSource: KL1PR01MB5448.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 03:19:57.2890 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR01MB4486 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_MUA_MOZILLA, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/11/2023 6:15 AM, Andrew Lunn wrote: >> +static void fwnode_mdiobus_pre_enable_phy(struct fwnode_handle *fwnode) >> +{ >> + struct gpio_desc *reset; >> + >> + reset = fwnode_gpiod_get_index(fwnode, "reset", 0, GPIOD_OUT_HIGH, NULL); >> + if (IS_ERR(reset) && PTR_ERR(reset) != -EPROBE_DEFER) >> + return; >> + >> + usleep_range(100, 200); >> + gpiod_set_value_cansleep(reset, 0); >> + /*Release the reset pin,it needs to be registered with the PHY.*/ >> + gpiod_put(reset); > You are still putting it into reset, and then taking it out of > reset. This is what i said should not be done. Please only take it out > of reset if it is in reset. > > Also, you ignored my comments about delay after reset. > > Documentation/devicetree/bindings/net/ethernet-phy.yaml says: > > reset-gpios: > maxItems: 1 > description: > The GPIO phandle and specifier for the PHY reset signal. > > reset-assert-us: > description: > Delay after the reset was asserted in microseconds. If this > property is missing the delay will be skipped. > > reset-deassert-us: > description: > Delay after the reset was deasserted in microseconds. If > this property is missing the delay will be skipped. > > You are deasserting the reset, so you should look for this property, > and if it is there, delay for that amount. Some PHYs take a while > before they will respond on the bus. I'm very sorry, I forgot. Thank you > Andrew