From patchwork Wed May 10 20:52:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13237265 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 C96DC21CCE for ; Wed, 10 May 2023 21:01:27 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2078.outbound.protection.outlook.com [40.107.94.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5B92E61 for ; Wed, 10 May 2023 14:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cyDaTTIUWSpYa0JmJB0KWOAp7zv8xnhDWUDvH778lcVMYRYtrF+NvjupBMCrl0/0846liJBcatmPvHQWjOw2mYV+UXo4/QIIMXHzTmbM/6QUr8KhdE1IsRXCtWcsf2ypYJyvRtemg+8K7wPV636VZTmjS0GBxuasVK/3VvHP8Rw8u0CJVs/NsxpdZOwTwkrZqlNBg+UvSXSZZQllkNkZNYnnt4VBo/Wr7+Xh0pqQalGggnm71ilBzo+KEUUFWf3RvhQnO4Khy+iBq9XcLyInohYLH4z2qPmQ3n03j75usF03MECNpoFIxJTHEWuU3dgoIIIdGqfOWTnsYeOMvWcOqg== 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=FJ/xMCqdKVjA/lFAgq2we6RsYGLYDigZg+OaKLHcnJ8=; b=iEg5e/JFhNXqeBX2X0nALUifqhrBQrHgtMEFIucyvD43jTL2m0nsS4iIwQzw4Bo4iz9iUgn1P7mLhBO0MFV+vS2AgGH9ySJQsB1OjuO4+QMPRL7rKPnLjuusUx2uIe8MUsffged9wDoHb3RqWAoVdlpLyxupKk6AvBzklJ3AitkVjqP6fPaXLC3yPeyTjTn5SNyheBkYnrGP+ChK6/XMDid4IQzXSGnw9Mq4i0OKM4J91xR4BgaXxKOVMlHlKcMpJs5yTxRyuUbw36llP4lC7zuLY9JpRAOmhpmR7FyL9pwq7/T1MAJ1nujTVC3qHtZwCG1jc0WXXq+Y2BpJjL3NqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FJ/xMCqdKVjA/lFAgq2we6RsYGLYDigZg+OaKLHcnJ8=; b=rOJdnVV3QLahpu2Sj/HPPyNqv7LB7CAU3bIaZG8+o0uFkKoF0zrevM3g1WfxatvwxBzocKtV0Eu+nl83kdM2k5zILrMQbCvJXJAPvy0BMY07wGA5fVEvRPNnY7YBfr9iJ4FuUqIZT0pt4ydl52sdNveok8nN7nTOAnxdBR1w4TRJzLzNAhvRVCSP9/hgY1c2kr3zGky5wLHAXzvwa5H8sa9I9QSNRk4vXno9OGPkVF1lq0+853tsGHJBvW4gjchb1iXILiZgKG4h+Bc52/6vVU1AyaTFmc0nTrOctEO7OLbVvB7WgF77wPBZSXbVtBH2iVxYbxXgVkW0Dbyq6oKufA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by MW5PR12MB5624.namprd12.prod.outlook.com (2603:10b6:303:19d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.18; Wed, 10 May 2023 20:53:46 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::de5a:9000:2d2f:a861]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::de5a:9000:2d2f:a861%7]) with mapi id 15.20.6363.033; Wed, 10 May 2023 20:53:46 +0000 From: Rahul Rameshbabu To: netdev@vger.kernel.org Cc: Saeed Mahameed , Gal Pressman , Tariq Toukan , "David S. Miller" , Jakub Kicinski , Richard Cochran , Jacob Keller Subject: [PATCH net-next 0/9] ptp .adjphase cleanups Date: Wed, 10 May 2023 13:52:57 -0700 Message-Id: <20230510205306.136766-1-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.38.4 X-ClientProxiedBy: SJ0PR03CA0085.namprd03.prod.outlook.com (2603:10b6:a03:331::30) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|MW5PR12MB5624:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e531a9d-1e47-45bb-c28e-08db5198a5f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5oXBfnXsqidRILjlpgJZjpDdwIX5FnpZ5QUp31tdKFk5rvUMv9TP9LBygStWXfeVKJypDjjcYNAQXfhKT/suBgu1Os2zERsbYTK+pRkLzJO086Bnz6drNkyzYZs2hCUhiVKPXTOjRm6s8UwfYGgPUSuDFRMhn0ihUWkRL1Xo5kwN0Tgk1Hnr++IVlVL7q+34S5iiKe2Kj35cqE8dfZjo/NqhWpgmMHKskdP8V+faD/IheoG5MkzlLMk70OlYnZsx+M3GrBGEWK8XNAP6PQiouDZqG9B4LX7DYF+9JhMTpS7crTbUQyEpvJnkM+I+eBYe+gr+iFRQpnTQlYpDDdZ5L3G95DOOjGEr2zhqc9p9lDH4DuI+6VOp5CRJtXq2k8CTP4R/0jsoRXq0Tx7JUYl4rYZR03IYTSOkJBighBgmnYyEFIIyP1vKE/Ecx1f1XHMbWJwA/TcehmynJJkE45axDmi7GNXY0FOZd4S9Fr+KNstuw51xsR4qQLKaQokGCqz+JX8uE+UhVk+x91gstP6djlRkC8TIrU2Ri4T4bu2pgqhpMLExUEwTqpwP3QKxDBd8w701DeZ4JEculiRhBJT5lJQZuQdp4tGbuNqW7qLjZGVEmXjMZZcOd9oZGAOdYRKIbMewJifnunYPr55D0G0GbA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39860400002)(366004)(396003)(376002)(451199021)(86362001)(5660300002)(41300700001)(4326008)(6666004)(38100700002)(316002)(6486002)(6506007)(6512007)(26005)(1076003)(478600001)(54906003)(36756003)(2906002)(8936002)(8676002)(186003)(83380400001)(66946007)(6916009)(66476007)(966005)(66556008)(2616005)(142923001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8Su5vs7m1KG8/mzHoCRWg9X6jMQLU7BZzJu+F5nP+EUAgDMh8+6TJlewErRgDOgGjXRBIeCoU6ONKVTRaclogMV3cIBjKVjQcZ5ukHrB9E9U+MzcyT5b1jf2ezvOALNiZN5Ap0ECjLjUinUSiLX0iTjAg6JBK2MkEJLoAoxa5AU2Sx7yDay19U2h8vsZNDAMFeFga7kGQ9H+JBwTcItcWgi/VuPu2ME43u65v50HvhQKWuc7Rho3/eHEV2O3yzL8hIc0BM/Lg2viP77MKpgKIkItVjpaGcXj/NI2l3xEV5zPQNicM7pyEY04dIAfkay7Iew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6Tns3tJkZUytuQu5MqeXxKlSmHQvGEeuTy/BYJtxNxsJHqxFL8E+Ibj6dExWIe9pTlpW09GXKGcOtWckphclbRBboVMWHemk3zEG3d05J4jZIh/QzX8TPw5oFCr8IqMjD961ltRJvrdEPh4c5cg2g30oWS9VRpLqHHcZKs5pYyWbjvuh3YsA4sFQiJ1EOgahCRmqQr82TQ== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e531a9d-1e47-45bb-c28e-08db5198a5f2 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2023 20:53:46.6001 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CRre5aJNiQx8fWK4prc1aDufGZTlUGf+Diq+dK2bgCT7JVmPjZd1oWLbzKkvxQTASDDeeqqtVDiH3Y7wvMdyeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5624 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org The goal of this patch series is to improve documentation of .adjphase, add a new callback .getmaxphase to enable advertising the max phase offset a device PHC can support, and support invoking .adjphase from the testptp kselftest. Link: https://lore.kernel.org/netdev/20230120160609.19160723@kernel.org/ Rahul Rameshbabu (9): ptp: Clarify ptp_clock_info .adjphase expects an internal servo to be used docs: ptp.rst: Add information about NVIDIA Mellanox devices testptp: Remove magic numbers related to nanosecond to second conversion testptp: Add support for testing ptp_clock_info .adjphase callback ptp: Add .getmaxphase callback to ptp_clock_info net/mlx5: Add .getmaxphase ptp_clock_info callback ptp: ptp_clockmatrix: Add .getmaxphase ptp_clock_info callback ptp: idt82p33: Add .getmaxphase ptp_clock_info callback ptp: ocp: Add .getmaxphase ptp_clock_info callback Documentation/driver-api/ptp.rst | 30 ++++++++++++++++ .../ethernet/mellanox/mlx5/core/lib/clock.c | 31 ++++++++-------- drivers/ptp/ptp_chardev.c | 5 ++- drivers/ptp/ptp_clock.c | 4 +++ drivers/ptp/ptp_clockmatrix.c | 36 +++++++++---------- drivers/ptp/ptp_clockmatrix.h | 2 +- drivers/ptp/ptp_idt82p33.c | 18 +++++----- drivers/ptp/ptp_idt82p33.h | 4 +-- drivers/ptp/ptp_ocp.c | 7 ++++ drivers/ptp/ptp_sysfs.c | 12 +++++++ include/linux/ptp_clock_kernel.h | 11 ++++-- include/uapi/linux/ptp_clock.h | 3 +- tools/testing/selftests/ptp/testptp.c | 29 ++++++++++++--- 13 files changed, 136 insertions(+), 56 deletions(-)