From patchwork Mon Dec 20 12:08:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Radu Pirea (NXP OSS)" X-Patchwork-Id: 12687721 X-Patchwork-Delegate: kuba@kernel.org 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 633A0C433EF for ; Mon, 20 Dec 2021 12:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232229AbhLTMJN (ORCPT ); Mon, 20 Dec 2021 07:09:13 -0500 Received: from mail-am6eur05on2074.outbound.protection.outlook.com ([40.107.22.74]:43712 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229533AbhLTMJN (ORCPT ); Mon, 20 Dec 2021 07:09:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yvr3DCVXjsCJLk8O5etiN3ejzsX3HJFrnl/3xe5TnLMjBLhuvw+W8mrPF+CiRJMTRyPmEIsS9oOjVgGQyoCc9a/YX/NDcvtw7exQOpJAcjAg/dhGvmDYuAqlo4oqWnZ+92hqk9c741ed0Sn4gaLgzIBmIxKtw4lRuGVYzK6l4YgjGDAvwTufzMZyHeMrJ45INSknIFNVB3hyIKuQfLoEm32ZNEZVDAHNek45A4QC6KYMRxuRbyhiDpbu/3XJF1HgdUbBfWB3oPG+7EYOCq5LcjOSFOEbZ9Q+Uhewxm+P3hkiofoh61GKwrfsuwuqCxYwEe3+dWh+ecKAlYBCzkFHNw== 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=4D6wC0+f7akCKlFQaQh2iwY7yJyOWUJfjBq2lDhFJHo=; b=UTDKKc2J3bKk/8tcqQ0Wxm/eult7gpT0yMOmSjkZYpVf/lUqDEv9AaRNQVtSEOxYsrLXfan0trtdk9MkioJlQC6eB8piNz+5OerssyKQyc+ghpUqOwiHCaH3h6nUtYHu19uP9iD37zkGc0lA/aC7opM2GEpKX95WGd2lL0f13rBhhrPNs10xKtebrOCix0sYAVvACa0rKNzrErksLROtNX09wLUYC2sihIIdvzGr3IEDT5m9hXjEbc+qnxWfOOF/m6c8+4pZHHIHeHDZ/fsoGdHr2JAb6pMt8iorLgFAHqXRqnU6c35jYAPyGiqOsZyeTf1VROFYJQVZ9hWfVN54Ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4D6wC0+f7akCKlFQaQh2iwY7yJyOWUJfjBq2lDhFJHo=; b=AIQ4F/84lfvDf+p126UKwKvkTR2lA9MmLcuhuegpwPCSkioLE7lg+McMAB/4DVE3j96f3jtJ6STlsVtRjCes+m2k3LUuUOwA1VG+2W8RXyZYGgqO3qAm6zz/uDX4TWRdqZVmWPjvXJmS3tAlYAojxK0WpXQ30Fo2/5Yt9SSWxNo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) by AM9PR04MB8825.eurprd04.prod.outlook.com (2603:10a6:20b:408::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.17; Mon, 20 Dec 2021 12:09:08 +0000 Received: from AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::1109:76b5:b071:7fce]) by AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::1109:76b5:b071:7fce%7]) with mapi id 15.20.4801.020; Mon, 20 Dec 2021 12:09:08 +0000 From: "Radu Pirea (NXP OSS)" To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: christian.herber@nxp.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, "Radu Pirea (NXP OSS)" Subject: [PATCH 1/3] ptp: add PTP_PEROUT_REVERSE_POLARITY flag Date: Mon, 20 Dec 2021 14:08:57 +0200 Message-Id: <20211220120859.140453-1-radu-nicolae.pirea@oss.nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM4PR0101CA0069.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::37) To AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd60fa5b-2e54-450c-8818-08d9c3b1868a X-MS-TrafficTypeDiagnostic: AM9PR04MB8825:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True 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: E9VwZpH0r25Xysvuc/eKS6arltWC+8QNYownFT4WOu76rsnbZZwDLOwTb17TwopyscRyzddXqzTLcIrpHTfXm05lXb5RhQAujjvFCPU/4Fjhr4SgieRMsGzm63F4njYV3VjxO5v3K1TrqYZ8knEf4Ou3qmzDRjdE3gWzq7YAz30FV0R5VlftUUdibR5z28CtGy/7vPCwU7ROsC71RwS3KOrpHBmA0zFFyAFoisHbRURp/J7uWN1Cn9TjH0tz8J2iKF6Eu85Qm0TvBh/oVTbCQStScph0HJDqXcVuTHEqcp5AkSQ8dOMN+yrCno0J1ojPvvOGPEv0Q5PsGsQGVsf867JyWTtpxXJtWinGlo/Zo2SYR7cUIQ+L0UJ46zq64wgSKN6R1tK/ZWMw2PLa9PL8P1dziarkezgwv0BpbMYSsWTt5yl9fsOGscYgTUWahGMf+f1VH9s3AXnYF9dWl/QFRtvuGVyH9rcsY8xniDjNRx2p+j3NZzI0G+5+VPgU0pUleXkgX7mIeBjf5y0oZL42kWOG7/9qxPh6ruVEPakBBOdD75IJA4eIaeTeDGtUdiEYfUoSkU63naPV6D1hEjgQPREjk7EYQDGSBUADNlMvYJwGSi3r7D/P7D95Q8Hb1QiSFV+xASGIM5HpOlesgraUw9O+ZOHOyaHCfnAV4vxcWr0ANh54pVyX7E4rE+YrT9FFUVf03F4a95skYxuuI/n/Qw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8954.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(1076003)(6506007)(6666004)(26005)(5660300002)(52116002)(186003)(2616005)(8676002)(6512007)(2906002)(8936002)(86362001)(316002)(38100700002)(38350700002)(4326008)(6486002)(66946007)(508600001)(83380400001)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gvakov7KcmyrcG62shBj9KB6MzUbkStRwSN1SaWmgmrdlzeI6CztyVCWrPTDraGayGRqGcPfsFp0x5hWLve9FNehz+ytvSo9tUUcUbSuBRVIP1vkl8DDEuEB5fa4cZyOIbtcJj9vxD0LDose7Ekbfp1ff2uz/FepJ2OVKBBvCa6W7s5iiXuxRzHxsiA5GMfv/0V8qha3cKNiQJOCk6ThnS4m4/4JWSYBwOw6FZkkBcQU6siyPbQNxOoeyg+6DqH29UZqYD6erIPsI+e+2swCZs14LqYiVk1y/tDe0cho2GmVCAWAZlE3X81tKxewPzhF4mb0ckC7nOYZ6WtEpYenO+NQI8qNXRvEUs44sVS0QR97XLB8Nilt3ujqX8cS54Z4hDD+0sKI2VS/+hOqHQtfpAk0J829j2x4F1IX7PD//g+ssLHIjsB47jKJTXMXmEenEwgJ6xb54kYgUQB65dcYz53p5tY/5LqOc5r86zJOdVI+423n20Qcad3vJvKcNMcxjm8sOifc0+joS2I2pZCYQxyoMxsru6SEfxAVBl7fEhgQs9dbSislkFeOdA2Jhs4yavEuJAC2cJfzYxO+WLLx2UR+nHG+ghtcdHszjYZt90D5VuORQ0SBZdS1fIM0lU4UHlFouBZJe7Pv7nzyfpIlxvm6KrPVJDqvcAN8k4SempW+T3JPmS24V7BL6i/vfHy94LAqxgl1XNO7vQR3wx772IUZLkAHXb2/hNWQMYcZKXsdWbITrSKeSikIaMSyzmsJ9AY4a2qbDCwHyKueHDupEu+yzZgw2UiLJv9M8iH/D6aNfbRuSCu5uPkZ5RUQZc1txeYKz9WZKD3AnZCZa0e4zanWtR7FtV5HG9HeERWQN2FkCVZk4gSp8j59h5Dyf9ALxBncJkiIWzFf6z0HvcSf8r0nFriqXkQrySQs3EKGPx6S4gfGufX463YYkKaUOc1aPM1h+aUWrSqMZ7uVmSdX+WEvCopTLGiNvYSSxlk6aDxnVT8+GDOZ44Uo2ltnMnhyJ7M4Pp+7w8sWUbkvEnCxYikBoPPNuESI6fh3IQIgdu6DFrLgbDdmgRwCKpRTzXtoJrfuEtoL4piDJ7qQSD/hv2lfJHNfhljdNMvopX6r2pj9YrqgLfEnMsBii293/dv/6v5Pn7BS7IrGq3GFGzBPOBywBDe0UXtaTDdwv3Dp8Nm3Zh5aGyRMOG0YGJraRiEcSKZ3oJ+Usm9iO38YbAzhafRWGpwIgWw0ZD51cmIJAPlhmUQ2BNJtyPWSa+Vi26vkG1z+dmoxTE1B8c4SRlLz0rVuOInOtxQiB+cfs7hPCuD+iNDyo0s/t6Vw/foS3r0YcAltL+qj7PAms2QW1/LK3J7IMQ1ovi6z0AF584NBTT08V2UxOZ6iqdQOl7jUmTEbQxwF9reR3MP604nH6AkfSEZKhZxy57syYSL7QvtgALnvY+FIquQteN1zkB2MvIrYMXCnbnPSmb3nWZFJ+QLHtk1kt6HvEWYm3SytXu5JWidz25QaziJkIt1df31fAMiYvBUuQzgrs8fWrYxIs2UuAmyN4wuEnwXLewt4WCOiwYAzwK8gPLV2EHvDWcpWWjhBdhSkpnRXZ2u3TH7nwLdqoBcQSkXIUyjJuDNQqixf+8ymJAEhaVmSGY9oeaOEWZ0aJKMZIMK57QyRvT5TvdlJyg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd60fa5b-2e54-450c-8818-08d9c3b1868a X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2021 12:09:08.5490 (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: sghjBlO7uT6rg7EhrWiE/xdTtQ2CwOL2rp+YAnSJYCa2MJFW4BcoRkklahUs3GwgRsnFlDpc88wFZNvSYU3tqX8bLaZrmXJeVaAiOB6v/DI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8825 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Some ptp controllers may be able to reverse the polarity of the periodic output signal. Using the PTP_PEROUT_REVERSE_POLARITY flag we can tell the drivers to reverse the polarity of the signal. Signed-off-by: Radu Pirea (NXP OSS) --- include/uapi/linux/ptp_clock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h index 1d108d597f66..34bc4ff89341 100644 --- a/include/uapi/linux/ptp_clock.h +++ b/include/uapi/linux/ptp_clock.h @@ -56,13 +56,15 @@ #define PTP_PEROUT_ONE_SHOT (1<<0) #define PTP_PEROUT_DUTY_CYCLE (1<<1) #define PTP_PEROUT_PHASE (1<<2) +#define PTP_PEROUT_REVERSE_POLARITY (1<<3) /* * flag fields valid for the new PTP_PEROUT_REQUEST2 ioctl. */ #define PTP_PEROUT_VALID_FLAGS (PTP_PEROUT_ONE_SHOT | \ PTP_PEROUT_DUTY_CYCLE | \ - PTP_PEROUT_PHASE) + PTP_PEROUT_PHASE | \ + PTP_PEROUT_REVERSE_POLARITY) /* * No flags are valid for the original PTP_PEROUT_REQUEST ioctl From patchwork Mon Dec 20 12:08:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Radu Pirea (NXP OSS)" X-Patchwork-Id: 12687723 X-Patchwork-Delegate: kuba@kernel.org 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 C237CC433F5 for ; Mon, 20 Dec 2021 12:09:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232251AbhLTMJP (ORCPT ); Mon, 20 Dec 2021 07:09:15 -0500 Received: from mail-am6eur05on2074.outbound.protection.outlook.com ([40.107.22.74]:43712 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231147AbhLTMJO (ORCPT ); Mon, 20 Dec 2021 07:09:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jbdpV1RIvgjYAM3iDev5O342lK3BG82aKDbwVTT97S/WT4TGoZrdFVk88tQ+dzgWoo1RTAIGFChZMfOChDw0G8u8quKmAVhT8L2Tg2GcYbFknkcwggunmgmt/9W2ZzJR79TtDxP5XH9UtcT3GV3hJD4a/FMukWx+AJM7zWbyNUVBAuYYQzWsX8O9v2Mlbiu2d/KIjPSnSX2r3KiHXVVa4NvaC2SVDxUqESMOXRcnryzizTfhR+I5k9zY18G54WbMpc4rJN8RMpT1hJdLUvJ3rpkE2xGT+InPo4fQVXeBYurgTi8WtybolpUc7gMVT39G6XqH2QhGL28wgk6nSDUm4A== 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=ot2gaRjZmnkVPsq30NzAzy29WaBGf8Z8A/GwMKhXOcs=; b=fOO+8NDOXwByam3WQEZIDAIfW1eTAZEaHXaF0sITcx7wyiBucq56PDYBG+xjUokVF7+0rtX+EN8OebIFv1+uNNCkds9gyiIs9R6gasmg4JmG8UWjXWc6g3OjgpOukefVFKqWllybxxFKpv9v8HCQaBi8ketWPZQEey9GFuhQEqmUyZjBVmFROkQMgDFOL7HfHfHy0IoePQ8DeC47fvNiUvQ84b2zjZtA+xyZWKQy4GeOYNEXnmKYB0U+DUE5CXE85KiuFzXwEX9bVGu4cash6WrTrXRseYSPRfPIXOc3bXutNWXEexKxJqEmyCiF3k/0JqM5A3OqvlZuqxYRan6kCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ot2gaRjZmnkVPsq30NzAzy29WaBGf8Z8A/GwMKhXOcs=; b=Y5rDxDPnrAsV5RB1SP5/hFddHO+zvZ9D9AfwPMqzwVCltzA/Itn8/Dhmh8wTJK+AtRXPdcJBE3Un73RrTlMO9Zf5BXmy1K7Nuk+9VWaTo1fg2aJCUgbzLutqvICur9w2fM+7jxjnwWHAF7YrKyzzP0JZZTO1x16W438luPbImqY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) by AM9PR04MB8825.eurprd04.prod.outlook.com (2603:10a6:20b:408::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.17; Mon, 20 Dec 2021 12:09:09 +0000 Received: from AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::1109:76b5:b071:7fce]) by AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::1109:76b5:b071:7fce%7]) with mapi id 15.20.4801.020; Mon, 20 Dec 2021 12:09:09 +0000 From: "Radu Pirea (NXP OSS)" To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: christian.herber@nxp.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, "Radu Pirea (NXP OSS)" Subject: [PATCH 2/3] phy: nxp-c45-tja11xx: add extts and perout support Date: Mon, 20 Dec 2021 14:08:58 +0200 Message-Id: <20211220120859.140453-2-radu-nicolae.pirea@oss.nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211220120859.140453-1-radu-nicolae.pirea@oss.nxp.com> References: <20211220120859.140453-1-radu-nicolae.pirea@oss.nxp.com> X-ClientProxiedBy: AM4PR0101CA0069.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::37) To AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1a66a97-b55a-4f24-1573-08d9c3b18715 X-MS-TrafficTypeDiagnostic: AM9PR04MB8825:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True 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: /8Ezw7dO+tzXb6tZ2FgvT4jcP/Xzx/c64KTsj8x1oQxcCDZh+5xt1SDcwWjPl6WFyZOv5+Pfw4bdRDxlQ6m1w9JpmNY0YCmW4onVRzxjMZDvwXec6w54XXjk9mebHEBCtZhU96xaN3Q0hv2kBKr6aafCcf8PQuy5ZU5Ta0Iiv1OcV5CAsCE+FcUjiy6yXZ82DMGp7qxwL+fteEDvjma6GZ75kMRyrc2U9Z3F1HCPiUgl/x1U5oD+4UU7QYWtCheSfazCDBFDL1o9+VcoJs2ZxHdFe6uZqyWd2tTmtvWSglXg+UaGKLXjy7oE+F6HbrenB3jJHaoBJWYNPvciNxURxwPDYPmGDj4C9o5f/GCOKe8CCpHLoQBFzjPZmjpEj6n6OWZ3nZce2xRKLjFr2zfphWVYbRc+PYx8rr27r3CZtUMTxJJgSYNEb7DvNrUbht4MmQtYetmqFwS8h02+knkKxTREIpt7B2M142hOAMZZKxMYUKgahCaRcbhqzoGgUE2Jx6yAtnD+S7cgjlQg70FlJP63Mv3jwL9mN79ViIAfxMsLm5jBpXD2OPpkzycaHVUyGei8LduFV2v075lbOM+jZgKVa9a5LocxzeZsVDNXL//qMn7Zlpy5SP2/tq0ZPbrMgk2Mu3d7958txJmM32AYV0GR0AYnO0U6xYH+BeHpAAdqyRQoQh++YI3XNSHykIhJdlyLaA+BtT5S4AeCG2YRiA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8954.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(1076003)(6506007)(6666004)(26005)(5660300002)(52116002)(186003)(2616005)(8676002)(6512007)(2906002)(8936002)(86362001)(316002)(38100700002)(38350700002)(4326008)(6486002)(66946007)(508600001)(83380400001)(66476007)(66556008)(66574015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: btE6/cuce9v+QMhTpaDD5OUayTXQSAw316W021zv0ru1ZfJmI1bnN0lFf0LvChmXHVtFDE8sb8MHZhsXXUQv9/rMHufviEqh6VgYaWAZZ4zgf0+etkEmuXktzzlTGrRLHYPFjDNIDPpUbFYhTPr+Tt9VDt2xExFTcFMpyW3EtXQpRMLOPYdIqiAmhkFN7Oxi8OtwHkR9ZuU5dhX9sMbw/QA/3AG6O1rbKbVi1LufgfBWSj1Zo00vP+yaUnqUo410wpfo2NS4OygKfPIypatfQWKmhswbpV8yOmv2ueVYWGdJdwGpeY86asEsgFoxTVJsPO2sOPI8/ZvX9iY5AUUFNhSnrO2AZ2NRsXPf0qQnPw/2m38KQ8P3aFe0byVVKVwdEzrdvCG5B5x3UYgay1iliWixd3Hc8a4G0Vt3QTYlFs2gQfiuIBnVwYOCh9996Shva+N2Loj7vOE3v2nDt6wgQXnxCXlADxw9Rn+075vscWz+Xv87mKnIjmJkcKmbfs2OiRVX2P+nAc17rcNXSqUOCAIBwUDVXpijhaueV+SI6wrFScPZ1ekulP/ht0sxJdanIUtTp+IU98gLo3yvX0qc4hyUN/3+VRUhL97fjZn8QsWTfwXI6LI2DT112kVgKV5K+Ve3mNv2kiAmY8DdRPYzV2wnI6iAyJsHokPZavpxtJKAH0Hlz925JdpMzOAxXdOswZbZ30yZmSrjv6iZfMDSmnB5OgrH+AEKX7ml3FhrzyIZs3qO40Q1xG4OgatmxDXlUgt3p2HiyTx0t3QnAWgfFaI28QNNBWIUB139kxOCqWJkJ7AS8qh9fuFHAFl9rz+q2AXTi4WHf1zAo9m6AuceZ8yzQWMr4Jdgj2JM95bOvAJzNwQQPq/pLM5of1xY8iy/cxrHUHHi5Buzh+YVtEfW7f38/W6s4oWH+QS/VdPjpqmzWf7fOjPaNblXuVMTpJj++IcSXCMmAM2tu5ZmzJlJ0PNYEYvfowLZMselgcTNAoTiTXcz28tdYSWb9AYvChlOEDeyu4CsP1ooeNAdsw9VOUMp09SChdqW1SQO0F29p1GKc8plRVrLZko5n4ObB6tIYC8dHsz5QEIPQYkAJfvE7QWu39zZ2NCL/ZDLjkG5LdhFU1QFtgTXrEgDujIp6O6Ulu/8fHKiAfk9yyru2/HOc5dXDyVo88ARe1XKFfmhu+VJkDKE33C2JkT2StSaoCVfr1KSCRJjR3g9AwaR20KYItsC79uTDugmvwW1TLiQqiVftqfsrzI5zsDyrzlRIKZljRXuNHYFjfwHyjFnFApBm6zGhj7/zpOlJcKQGWM6KxR5Kxo5Yol6v54cB0U9NzqCHf7+cYBwbMAvBdXlfS02upTT9OKY0X4aqwj19pqZkoW+aNKCk7jh7jbt0IevJcVWD6wAAYK5Bosneqh4HvZ2AJNqlg9GQZra2L8N+rd1Dz1QBR5NmjLOe2c+LFDtcpUWtXyyijRcvBy7iLbP5U5FKjm681Ja8TL/KHPvY97Ob74zQblCq7NZ1wnBJ1/far4tFxakoiTazqLaEcmPz5rqxfCtsjChSMtWTezu2VRIOrwwNOSG0haQVCoincJpA5cRH436DskMStxsQBkaszs4qCsArQHFBJmE5Vu3gzVurFUFJfC4PMAxDoV42K8FcJF9yy3nJH77M96chRV8FGoUfw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1a66a97-b55a-4f24-1573-08d9c3b18715 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2021 12:09:09.3744 (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: Kw5zjBI6vj2y0k9NBAnONLuDk2CQN7WVxadiuB+n0jM/HHZsSFWJ52Zc09LY4UIRQSEmLtLIYXdkC3WdYSV4Bv3HVNpGOFckCsXdfmjA+uc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8825 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add support for external timestamp and periodic signal output. TJA1103 have one periodic signal and one external time stamp signal that can be multiplexed on all 11 gpio pins. The periodic signal can be only enabled or disabled. Have no start time and if is enabled will be generated with a period of one second in sync with the LTC seconds counter. The external timestamp signal has no interrupt and no valid bit and that's why the timestamps are handled by polling in .do_aux_work. Signed-off-by: Radu Pirea (NXP OSS) --- drivers/net/phy/nxp-c45-tja11xx.c | 202 ++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c index 91a327f67a42..74de66c90f24 100644 --- a/drivers/net/phy/nxp-c45-tja11xx.c +++ b/drivers/net/phy/nxp-c45-tja11xx.c @@ -97,6 +97,11 @@ #define VEND1_TX_IPG_LENGTH 0xAFD1 #define COUNTER_EN BIT(15) +#define VEND1_PTP_CONFIG 0x1102 +#define EXT_TRG_EDGE BIT(1) +#define PPS_OUT_POL BIT(2) +#define PPS_OUT_EN BIT(3) + #define VEND1_LTC_LOAD_CTRL 0x1105 #define READ_LTC BIT(2) #define LOAD_LTC BIT(0) @@ -132,6 +137,13 @@ #define VEND1_EGR_RING_DATA_3 0x1151 #define VEND1_EGR_RING_CTRL 0x1154 +#define VEND1_EXT_TRG_TS_DATA_0 0x1121 +#define VEND1_EXT_TRG_TS_DATA_1 0x1122 +#define VEND1_EXT_TRG_TS_DATA_2 0x1123 +#define VEND1_EXT_TRG_TS_DATA_3 0x1124 +#define VEND1_EXT_TRG_TS_DATA_4 0x1125 +#define VEND1_EXT_TRG_TS_CTRL 0x1126 + #define RING_DATA_0_DOMAIN_NUMBER GENMASK(7, 0) #define RING_DATA_0_MSG_TYPE GENMASK(11, 8) #define RING_DATA_0_SEC_4_2 GENMASK(14, 2) @@ -162,6 +174,17 @@ #define VEND1_RX_PIPE_DLY_NS 0x114B #define VEND1_RX_PIPEDLY_SUBNS 0x114C +#define VEND1_GPIO_FUNC_CONFIG_BASE 0x2C40 +#define GPIO_FUNC_EN BIT(15) +#define GPIO_FUNC_PTP BIT(6) +#define GPIO_SIGNAL_PTP_TRIGGER 0x01 +#define GPIO_SIGNAL_PPS_OUT 0x12 +#define GPIO_DISABLE 0 +#define GPIO_PPS_OUT_CFG (GPIO_FUNC_EN | GPIO_FUNC_PTP | \ + GPIO_SIGNAL_PPS_OUT) +#define GPIO_EXTTS_OUT_CFG (GPIO_FUNC_EN | GPIO_FUNC_PTP | \ + GPIO_SIGNAL_PTP_TRIGGER) + #define RGMII_PERIOD_PS 8000U #define PS_PER_DEGREE div_u64(RGMII_PERIOD_PS, 360) #define MIN_ID_PS 1644U @@ -199,6 +222,9 @@ struct nxp_c45_phy { int hwts_rx; u32 tx_delay; u32 rx_delay; + struct timespec64 extts_ts; + int extts_index; + bool extts; }; struct nxp_c45_phy_stats { @@ -339,6 +365,16 @@ static bool nxp_c45_match_ts(struct ptp_header *header, header->domain_number == hwts->domain_number; } +static void nxp_c45_get_extts(struct nxp_c45_phy *priv, + struct timespec64 *extts) +{ + extts->tv_nsec = phy_read_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_EXT_TRG_TS_DATA_0); + extts->tv_nsec |= phy_read_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_EXT_TRG_TS_DATA_1) << 16; + extts->tv_sec = phy_read_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_EXT_TRG_TS_DATA_2); + extts->tv_sec |= phy_read_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_EXT_TRG_TS_DATA_3) << 16; + phy_write_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_EXT_TRG_TS_CTRL, RING_DONE); +} + static bool nxp_c45_get_hwtxts(struct nxp_c45_phy *priv, struct nxp_c45_hwts *hwts) { @@ -366,6 +402,7 @@ static bool nxp_c45_get_hwtxts(struct nxp_c45_phy *priv, nxp_c45_get_hwtxts_out: mutex_unlock(&priv->ptp_lock); + return valid; } @@ -409,6 +446,7 @@ static long nxp_c45_do_aux_work(struct ptp_clock_info *ptp) struct nxp_c45_phy *priv = container_of(ptp, struct nxp_c45_phy, caps); bool poll_txts = nxp_c45_poll_txts(priv->phydev); struct skb_shared_hwtstamps *shhwtstamps_rx; + struct ptp_clock_event event; struct nxp_c45_hwts hwts; bool reschedule = false; struct timespec64 ts; @@ -439,9 +477,167 @@ static long nxp_c45_do_aux_work(struct ptp_clock_info *ptp) netif_rx_ni(skb); } + if (priv->extts) { + nxp_c45_get_extts(priv, &ts); + if (timespec64_compare(&ts, &priv->extts_ts) > 0) { + priv->extts_ts = ts; + event.index = priv->extts_index; + event.type = PTP_CLOCK_EXTTS; + event.timestamp = ns_to_ktime(timespec64_to_ns(&ts)); + ptp_clock_event(priv->ptp_clock, &event); + } + reschedule = true; + } + return reschedule ? 1 : -1; } +static void nxp_c45_gpio_config(struct nxp_c45_phy *priv, + int pin, u16 pin_cfg) +{ + struct phy_device *phydev = priv->phydev; + + phy_write_mmd(phydev, MDIO_MMD_VEND1, + VEND1_GPIO_FUNC_CONFIG_BASE + pin, pin_cfg); +} + +static int nxp_c45_perout_enable(struct nxp_c45_phy *priv, + struct ptp_perout_request *perout, int on) +{ + bool rev_pol = false; + int pin; + + if (perout->flags & ~PTP_PEROUT_REVERSE_POLARITY) + return -EOPNOTSUPP; + + if (perout->flags & PTP_PEROUT_REVERSE_POLARITY) + rev_pol = true; + + pin = ptp_find_pin(priv->ptp_clock, PTP_PF_PEROUT, perout->index); + if (pin < 0) + return pin; + + if (!on) { + phy_clear_bits_mmd(priv->phydev, MDIO_MMD_VEND1, + VEND1_PTP_CONFIG, PPS_OUT_EN); + + nxp_c45_gpio_config(priv, pin, GPIO_DISABLE); + + return 0; + } + + if (perout->start.sec != 0 || perout->start.nsec != 0) + return -EINVAL; + + if (perout->period.sec != 1 || perout->period.nsec != 0) + return -EINVAL; + + nxp_c45_gpio_config(priv, pin, GPIO_PPS_OUT_CFG); + + if (rev_pol) + phy_set_bits_mmd(priv->phydev, MDIO_MMD_VEND1, + VEND1_PTP_CONFIG, PPS_OUT_POL); + else + phy_clear_bits_mmd(priv->phydev, MDIO_MMD_VEND1, + VEND1_PTP_CONFIG, PPS_OUT_POL); + + phy_set_bits_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_PTP_CONFIG, + PPS_OUT_EN); + + return 0; +} + +static int nxp_c45_extts_enable(struct nxp_c45_phy *priv, + struct ptp_extts_request *extts, int on) +{ + int pin; + + if (extts->flags & ~(PTP_ENABLE_FEATURE | + PTP_RISING_EDGE | + PTP_FALLING_EDGE | + PTP_STRICT_FLAGS)) + return -EOPNOTSUPP; + + /* Sampling on both edges is not supported */ + if ((extts->flags & PTP_RISING_EDGE) && + (extts->flags & PTP_FALLING_EDGE)) + return -EOPNOTSUPP; + + pin = ptp_find_pin(priv->ptp_clock, PTP_PF_EXTTS, extts->index); + if (pin < 0) + return pin; + + if (!on) { + nxp_c45_gpio_config(priv, pin, GPIO_DISABLE); + priv->extts = false; + + return 0; + } + + if (extts->flags & PTP_RISING_EDGE) + phy_clear_bits_mmd(priv->phydev, MDIO_MMD_VEND1, + VEND1_PTP_CONFIG, EXT_TRG_EDGE); + + if (extts->flags & PTP_FALLING_EDGE) + phy_set_bits_mmd(priv->phydev, MDIO_MMD_VEND1, + VEND1_PTP_CONFIG, EXT_TRG_EDGE); + + nxp_c45_gpio_config(priv, pin, GPIO_EXTTS_OUT_CFG); + priv->extts = true; + priv->extts_index = extts->index; + ptp_schedule_worker(priv->ptp_clock, 0); + + return 0; +} + +static int nxp_c45_ptp_enable(struct ptp_clock_info *ptp, + struct ptp_clock_request *req, int on) +{ + struct nxp_c45_phy *priv = container_of(ptp, struct nxp_c45_phy, caps); + + switch (req->type) { + case PTP_CLK_REQ_EXTTS: + return nxp_c45_extts_enable(priv, &req->extts, on); + case PTP_CLK_REQ_PEROUT: + return nxp_c45_perout_enable(priv, &req->perout, on); + default: + return -EOPNOTSUPP; + } +} + +static struct ptp_pin_desc nxp_c45_ptp_pins[] = { + { "nxp_c45_gpio0", 0, PTP_PF_NONE}, + { "nxp_c45_gpio1", 1, PTP_PF_NONE}, + { "nxp_c45_gpio2", 2, PTP_PF_NONE}, + { "nxp_c45_gpio3", 3, PTP_PF_NONE}, + { "nxp_c45_gpio4", 4, PTP_PF_NONE}, + { "nxp_c45_gpio5", 5, PTP_PF_NONE}, + { "nxp_c45_gpio6", 6, PTP_PF_NONE}, + { "nxp_c45_gpio7", 7, PTP_PF_NONE}, + { "nxp_c45_gpio8", 8, PTP_PF_NONE}, + { "nxp_c45_gpio9", 9, PTP_PF_NONE}, + { "nxp_c45_gpio10", 10, PTP_PF_NONE}, + { "nxp_c45_gpio11", 11, PTP_PF_NONE}, +}; + +static int nxp_c45_ptp_verify_pin(struct ptp_clock_info *ptp, unsigned int pin, + enum ptp_pin_function func, unsigned int chan) +{ + if (pin >= ARRAY_SIZE(nxp_c45_ptp_pins)) + return -EINVAL; + + switch (func) { + case PTP_PF_NONE: + case PTP_PF_PEROUT: + case PTP_PF_EXTTS: + break; + default: + return -EOPNOTSUPP; + } + + return 0; +} + static int nxp_c45_init_ptp_clock(struct nxp_c45_phy *priv) { priv->caps = (struct ptp_clock_info) { @@ -452,7 +648,13 @@ static int nxp_c45_init_ptp_clock(struct nxp_c45_phy *priv) .adjtime = nxp_c45_ptp_adjtime, .gettimex64 = nxp_c45_ptp_gettimex64, .settime64 = nxp_c45_ptp_settime64, + .enable = nxp_c45_ptp_enable, + .verify = nxp_c45_ptp_verify_pin, .do_aux_work = nxp_c45_do_aux_work, + .pin_config = nxp_c45_ptp_pins, + .n_pins = ARRAY_SIZE(nxp_c45_ptp_pins), + .n_ext_ts = 1, + .n_per_out = 1, }; priv->ptp_clock = ptp_clock_register(&priv->caps, From patchwork Mon Dec 20 12:08:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Radu Pirea (NXP OSS)" X-Patchwork-Id: 12687725 X-Patchwork-Delegate: kuba@kernel.org 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 0E622C433EF for ; Mon, 20 Dec 2021 12:09:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232263AbhLTMJQ (ORCPT ); Mon, 20 Dec 2021 07:09:16 -0500 Received: from mail-am6eur05on2074.outbound.protection.outlook.com ([40.107.22.74]:43712 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232250AbhLTMJP (ORCPT ); Mon, 20 Dec 2021 07:09:15 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B/V6JQNprpBaOi56CRB5F9zfB+EkSnOcGl43haBYyKqQ77hLmcAPASC9/v9hMd/NlsdZdLSxrEkOwxraoHoOBl3YFkfzw837AfPuBzNxPjH0tearbZCKsbShjZj3hZloj/XEkzj0cYV4w9Tzq8QghhUSuqgY8nSFCNxihCtG+Tpj4ZXgn4hstc7xJiJ/FQ+P9J8Q9pCj1lZ08Gh6gpWYic5Kb8S8DGpe8PBkHpjAm2oQN6GumNb0fROLgNr7q0Y7Fl0TYAHUGaSBpmL2qjtBRfauBYTB3uWslfcOYYxmLh9zIPMrPEa2OdhdyVTcAgibSS8sJzbCl3Oj1r5yquTOxA== 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=xiKs4RbiP5F3ZJi95EuDmpral1G8vZjBHAv7Lci9Z4A=; b=HUXszB5/xTp9i2GdncRJGbLzEyiMZ37nDsVy2rGZV2Dt+HyOja7/kinNFdAtxQbXEFUuF1aP1wfUdTBTNcPwndHNaRrfymSq79QrJy8f3k15JyezPnkaNWE+m2GcR3qets0pzBMKRBE9XNDzsQ2N3pEo0cHWsSyn9pqUkUogQ2CGpPu7RLIdW3TV6Ue2Eq3uB5B3haD3MUYJT0XnyJLv5mw4fsPzTNX5++2LZ6FKOSDZ93K/cWUd2Njx6vjKmv+xQDNQnechCAMI0oTxJy34kVPkhbao7F+8oADZ7WKLVjZlA0WYUJN9bj1MsJw03E6xnEHxbDzuuVtDbabY/da/1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xiKs4RbiP5F3ZJi95EuDmpral1G8vZjBHAv7Lci9Z4A=; b=WQgNNZxIc+Up0qEb2JvzL1Bq+Ga2sG/9DfeJUXWFgeIog5VxrIhXVbgolwYVEPBgeQZgqmPeRJQfidl2Ie3SmsXJm8gRhjzof82Onjf1DUI15pCR/Kn8WPbmIux9po/kWgs7/e9o012ve4dGHrlj64Bf09DRAC4qqKwRg0bGZJo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) by AM9PR04MB8825.eurprd04.prod.outlook.com (2603:10a6:20b:408::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.17; Mon, 20 Dec 2021 12:09:10 +0000 Received: from AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::1109:76b5:b071:7fce]) by AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::1109:76b5:b071:7fce%7]) with mapi id 15.20.4801.020; Mon, 20 Dec 2021 12:09:10 +0000 From: "Radu Pirea (NXP OSS)" To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: christian.herber@nxp.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, "Radu Pirea (NXP OSS)" Subject: [PATCH 3/3] phy: nxp-c45-tja11xx: read the tx timestamp without lock Date: Mon, 20 Dec 2021 14:08:59 +0200 Message-Id: <20211220120859.140453-3-radu-nicolae.pirea@oss.nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211220120859.140453-1-radu-nicolae.pirea@oss.nxp.com> References: <20211220120859.140453-1-radu-nicolae.pirea@oss.nxp.com> X-ClientProxiedBy: AM4PR0101CA0069.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::37) To AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5dc467e4-69f5-42a1-a15e-08d9c3b1877b X-MS-TrafficTypeDiagnostic: AM9PR04MB8825:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dGEvT+RWhiqxeEO/noCgOq0/uuv4yMILxmkgUTKKiqMwhbkxgptkV4ZGFjOJr2B6u/nWEtA7pw/ylAxExBS9KMnnL4TWouOlUyNwQfzoH5QTa9PfeJvNsRpzgfaDOKpM9nXAea499+5eFZkUV3tWc4sfN2lNKoAxDkBxCwHBOGNzzuZdPPLsSE9LshT8/Ix+bblulT8CG2OWE2Gm3DG1LvLjFDEQFWihFFg1isWdVzpB+xt+jqZyoJm5fxkKxH/p+czm89mjPPKfZ3gHov0Lg8644L8iQMUDOH+V2PNDn9v8b8t98vRYvQcBJ2K1X69NsOhyVajb+ujgxQ04nD196tE4J4mYBkm7Y4y3gIOi3s6Yb7CKF6+lNXZPoSJVjWVLosOrQtxFuue5mFpp7ip5n1GxgzDQAwFjDRfRu4SnVJS0YBmnpqpSN456jJDymy60BgZyqwulW6HXNKMlNoqrkrftVtJBJVAJ7u80Fkgldyi7+RfxYvKKuHU1tu7U3FX8tKajCoSjPEnmFm/YxB3m51Zy4XrlYWaajui4a7JENxgGAlb/QHQ5sb4p5H8esPoKlmpmIXs33F3Emb1EFqpC78kTREK/cp69iOFymAEGeMPuN6pMJpT5P3gYonMKKutH0Z9Pr3gF6jXaQWw6kndlZIryIc57TJ0elVLNaMhvPdMgN6titSN5gsAK+HAwNOjfJWPfY7JLeaOxAH/qHWzEIQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8954.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(1076003)(6506007)(6666004)(4744005)(26005)(5660300002)(52116002)(186003)(2616005)(8676002)(6512007)(2906002)(8936002)(86362001)(316002)(38100700002)(38350700002)(4326008)(6486002)(66946007)(508600001)(83380400001)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HyTCyKcWHJzIjIpO/0VGplD2C5vHAY5raxCb3MiACJI897c30Wr0FxtoxNnk1cCF49w1AHR1YA265ZMq5l/uvddRK0+1G3syS8Uk/XwAEm1wVBr/x9Xx1yMdSQfPyxuiFNnbQSSldLE6f3yFUcCuj3TPS8Q0EufHd+7FF6xKauS3Acf7yuS93kP+Ezx7EpRu0AkT72l2cqyFfJwnLut537cp/e8pdPwuoPkWOo5K9nUKq4SkCFaVpBhqwlPoqowODqK3td3V/DbAREaIFpbNOCkFeHOmUW4gwgL2dgUFscADaMJjRtFsBmZTMSROo1iBfL5umom9Mvpzc2wc8AGfnyAewxfjz8pBuWOMD93L0XJBP+iCBYgKdnhR+190SBtzhtkfyHucTFZsMKIDTTxMBSKyJs6geiJ5ebTiHRXNFvv9Zi4YDBBa4j7ej5pcnLx/ulcgPBsHIOC23w49o1wIotcUT+WRGtpSruKD+rMZ6TU90B+fy2iQeE5e+bLSdVEsCK4boupOdyU1g12G6hugczIAV8msaQ2qmu5DbLKah4uJyJMsqfwMNx1jJ3H8OkmKfOp2ZzxtafhfjvatRR/ey71Ph9Y//ukxJWWbVVvWNlG2lTkXPwwyiEV9DBQNJniR2XQ7sYg5RHVHQN1qF6JgsTFUMMmJSTlwoJTUCO6y1x1GUvFRDvHJMoSu1Q6tAlUeGAp/Mn3PuLua04t+2XMy8xiWZ9AHq7b41FDmLE9awLGMa6/S5USL42luLqd6Xtd9I6DvgGFlwQeDj5D1oLnnWrybMV3FdtZbphXy/EHgYa1szkVZRbDS6MIfWakCraVwjBLgEl+zDsMhsOt/7iIeePmyHcg39Cr3LNFXh9+6K+jlXtGh6pZErTmn+hqSD3PIqU3SOER8drwc/JbRYKOrkETOC7B8H2KQjuNGvBDGn3feXIZaeT/+2FGaLOVxKNPgA/PTGdXQVCdZE0zL8KnTraoLnmSkXRb68fHUmC0Hoqyy6awV2xAij9rqlciRrdlKhKGquoF6vAZhNBWSM0pa8/kVG//J1FLxmoJjxYs/X3h+kllnaDneuSq5aasWVg7knPhrOb0Vyx1f7OQ4POdke7AZdLG1N7a8ip/qNRxENOvL9UBK2z4urLm4rGsN43a6qy7jBWGKlhzLMszef+dsClQ5OVKTM1lMzwpgQZpO8zcyt+EXxfsOWEDzxwPtcFk4re2LkYFEu5Nl6zkyW9SIj6E9Z8sb32pw6MjlDwHdQLsaciShL9SmTq9Jf1g6QvC/N9fiHd6pONcdH8GkpU9LEJpAYQsn7l4cbIvy9UvFO56MEGYIM2EUV4BZ0TnsHX1lO9PWQRO4LF2mzWA2A9gErQ2q1WsblDh+Ew63QrLdb1yzN+LJhe4pQ7oPEu+LmP2w1SCj241KJEsM6TucQ2E6r3oEUvCA/ceErGXHcOmFlWLBRixumNKQ/iB/clYlcpUqual/tXfOMIiygedSV4b/X5XcXVvliAcufn7bTyPfZkrt3x23gsnFYdID/q3kdKwFzaHoBZNV0QzywzBoN8jq7AGIr4wz/hWNPjZTlt2bKy7mXthryJN/IELDGfLhlfTUYguUfnOh8XjTphcBIaPG9En6xjkvjWvZzeeh76s6iZQ83yndN/kgmpLQWX4yB++MJLC4uSoZJAzTZ2KpW9j8+g== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5dc467e4-69f5-42a1-a15e-08d9c3b1877b X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2021 12:09:10.0723 (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: WJqTNnKPP8WsC3bF78gVtHCZmSY0g5KkWu6EjMYxJjc/uESWYo7iMxeRDTRRH4UYepphp1cRuLHvAONTEPcnJrXYdTYJ+bC+J4cvmth6KbU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8825 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The tx timestamps are read from only one place in interrupt or polling mode. Locking the mutex is useless. Signed-off-by: Radu Pirea (NXP OSS) --- drivers/net/phy/nxp-c45-tja11xx.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c index 74de66c90f24..5bd8c166d726 100644 --- a/drivers/net/phy/nxp-c45-tja11xx.c +++ b/drivers/net/phy/nxp-c45-tja11xx.c @@ -381,7 +381,6 @@ static bool nxp_c45_get_hwtxts(struct nxp_c45_phy *priv, bool valid; u16 reg; - mutex_lock(&priv->ptp_lock); phy_write_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_EGR_RING_CTRL, RING_DONE); reg = phy_read_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_EGR_RING_DATA_0); @@ -401,8 +400,6 @@ static bool nxp_c45_get_hwtxts(struct nxp_c45_phy *priv, hwts->sec |= (reg & RING_DATA_3_SEC_1_0) >> 14; nxp_c45_get_hwtxts_out: - mutex_unlock(&priv->ptp_lock); - return valid; }