From patchwork Thu Nov 30 18:46:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Min Li X-Patchwork-Id: 13474810 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hotmail.com header.i=@hotmail.com header.b="rqr4TBia" Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11olkn2081.outbound.protection.outlook.com [40.92.18.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 777C210E6; Thu, 30 Nov 2023 10:46:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DiYFcEa9dZ+Qm+JCwGKstl/U5ImQOfqIgOakfYuaIP01iLYaViGjwn+/CmCkQr/6HlMf2O0O50vAMhpNM/1Vi7nA8QuUmQm7ZX7cyWznkb56i4RU+cBv8hd5H6tTZs3yhLPaJ+ubud5xxB1th3To0dZTRd3RpggFf0BTWMRHRG4QrktyeL3KplSwnbUBhrlZP9+VoL/upwBEsWTekGsmm6BZJjubukyKZORjj2Cx5pMdWN7xJxv41rLimZ29YMMvW8uZbtYVWDfwMYsY4apeMn1p1tFLPUgxsEV5BmfFYqfbLqu3aBT1AJplbjRIvo/jdwS0roM+VhNGoRBZIYqKIg== 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=8CooryLmNa1dj1SA4KgSc3T9KA4dLeGUZnSc6Ztcfzo=; b=KDb8X6YK2YYyKar7sPDjY5J5K9yRK7U1E2UurE6rcf86j2Nks6/LkeHmZsZzPZRRMAmeP9vO5BLk7dzMidZMUCf0PVaZZytsrRZF+PTmB/UBA7TgU/WdhN2sxSXoY1SZmB1NqDp5DPbmvOri4V/XHkqY526sMFE2gXlhphntC62QOvj966ue3fTFXAI8GaQ1ZltHySNyRwKuj7rupMqaJaEwYc1YjKaD9L+3mzPwyVYaB9tJbagS5o4if464+Qs+FnCXhbrU/u+zKL/3OEahe/jkQg3w23SORXdvw2TfpmMa6hR/9jbwR4EDm7TLdU2ng6b1gL+RqnfCpQNMhFkfOQ== 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=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8CooryLmNa1dj1SA4KgSc3T9KA4dLeGUZnSc6Ztcfzo=; b=rqr4TBia4f/JgXFp/6Y3f+CXelBiF61O9yZ+X1YMqSHiwCCX3hhRcH/R8fG6NNfxZVCT54u/13EMt3D4uaCHjThLyDfPzw5Bf7hAU3qdmLqDuVuQ8AoQs25cikWIMO87tcyTh020l+Zb5kVqZeOs/022+KVbO3ibZHs9LJsYPM3bsV55OvC/0E1Udx4cuwM1CNOgvugnShfb3dIJ1ruPUVeo+xgWUOBeHdsz2IWoI3DX9X+OFehtfziiJH2E62so+VoU1ZOa0z59x9pF31/89Qmpju6+LFYBf+qi8SpGumyev/HQtfQYeTkHvnr5+pF8wTnCY9YVjaCKhdczf/+e0w== Received: from PH7PR03MB7064.namprd03.prod.outlook.com (2603:10b6:510:2a5::8) by SJ0PR03MB6779.namprd03.prod.outlook.com (2603:10b6:a03:40e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.13; Thu, 30 Nov 2023 18:46:51 +0000 Received: from PH7PR03MB7064.namprd03.prod.outlook.com ([fe80::9ca4:4c22:a89:9a8]) by PH7PR03MB7064.namprd03.prod.outlook.com ([fe80::9ca4:4c22:a89:9a8%7]) with mapi id 15.20.7068.012; Thu, 30 Nov 2023 18:46:51 +0000 From: Min Li To: richardcochran@gmail.com, lee@kernel.org Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Min Li Subject: [PATCH net-next v6 2/6] ptp: clockmatrix: set write phase timer to 0 when not in PCW mode Date: Thu, 30 Nov 2023 13:46:30 -0500 Message-ID: X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130184634.22577-1-lnimi@hotmail.com> References: <20231130184634.22577-1-lnimi@hotmail.com> X-TMN: [VWfRdhi9pgAXfe30cFSayPjHIqBz3suH] X-ClientProxiedBy: YQBPR0101CA0262.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:68::24) To PH7PR03MB7064.namprd03.prod.outlook.com (2603:10b6:510:2a5::8) X-Microsoft-Original-Message-ID: <20231130184634.22577-2-lnimi@hotmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR03MB7064:EE_|SJ0PR03MB6779:EE_ X-MS-Office365-Filtering-Correlation-Id: f7585186-b48d-4ce5-7bc3-08dbf1d4b6fb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nD4PEuLr2PPrvvVIe0lD2A0lKoK5M9giCOcpBM+8QT25kFkyvqxmI8ehXbWnvvTp/EOIPmeWEVRd6dEkgJO4Cn+P5QCbePTT2dF+h8CdBQ4hh0nmPQogqOsJEQJ6aASfc3LVvsNEuQVpGvKWUYvYKgob20iFKn4sYlIh2vIFxzMmR96ToaZ6bS4y/KZMa/cHWt4VBHqc712osoXYUokE6k+mYfyKlMO3vOts2Ak/rt7QIeQVS//p5ydPZLK7KKwYG8lmmL/BfbKNsvInbkDcvKMkaZM/ofCJVXVWDLV6GUV4RdQ1MuEH+ak5cuP9CO15kN9L9MZIn7a1pxU8JINMPipGRPOrX5gRhMAdFS4L/R9C/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ivml5h8Hs5WHG7gcSoZWMXBJryEqirWyVdpU+6Oqn9WcFCNQTQxN849ykysublf8YQ/E6uHjBBy7MRr7gyNj1nDoTtZ5A9hKyI3p5jzFa/0/vdQGj1ifsreTr1b79iwud1XWrX2Km6QuJgYrWV6elxbcsOJ7Mm2E9+qQYT7eJi6GPPmBw4k/S+jyIty/5gU0JLpyOWaeNz1xu61Potch8q+CGeRzuEjgQhIkcUOWanMUFTyQBza+mMGPNiVAsA7qRAVVbywrlIz/eVk5+VxgW8Q/+CPrH4G187mEZwIl2hYj95fYQLoMU7UvsTf3qg1UG+rM2RJwnsICAvQ2NPgrO62r8fZSlgY9gUtVRuNE1W1aSYulkeKZkJQPl/4avKt+vrTW1Gxv0Q8Q2jcaGJxjOfYRoyLILUymjKD4vTcb5Q== X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-685f7.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: f7585186-b48d-4ce5-7bc3-08dbf1d4b6fb X-MS-Exchange-CrossTenant-AuthSource: PH7PR03MB7064.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2023 18:46:51.3963 (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: SJ0PR03MB6779 X-Patchwork-Delegate: kuba@kernel.org From: Min Li In order for phase pull-in to work, write phase timer shall be 0 when not in write phase mode. Signed-off-by: Min Li --- drivers/ptp/ptp_clockmatrix.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c index f8556627befa..6d55da54e496 100644 --- a/drivers/ptp/ptp_clockmatrix.c +++ b/drivers/ptp/ptp_clockmatrix.c @@ -1396,6 +1396,20 @@ static int idtcm_set_pll_mode(struct idtcm_channel *channel, struct idtcm *idtcm = channel->idtcm; int err; u8 dpll_mode; + u8 timeout = 0; + + /* Setup WF/WP timer for phase pull-in to work correctly */ + err = idtcm_write(idtcm, channel->dpll_n, DPLL_WF_TIMER, + &timeout, sizeof(timeout)); + if (err) + return err; + + if (mode == PLL_MODE_WRITE_PHASE) + timeout = 160; + err = idtcm_write(idtcm, channel->dpll_n, DPLL_WP_TIMER, + &timeout, sizeof(timeout)); + if (err) + return err; err = idtcm_read(idtcm, channel->dpll_n, IDTCM_FW_REG(idtcm->fw_ver, V520, DPLL_MODE),