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 415D2C636CC for ; Wed, 15 Feb 2023 07:47:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233205AbjBOHri (ORCPT ); Wed, 15 Feb 2023 02:47:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232212AbjBOHrc (ORCPT ); Wed, 15 Feb 2023 02:47:32 -0500 X-Greylist: delayed 60 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 14 Feb 2023 23:47:30 PST Received: from smtpdh17-2.aruba.it (smtpdh17-2.aruba.it [62.149.155.117]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8222FBB9E for ; Tue, 14 Feb 2023 23:47:30 -0800 (PST) Received: from [172.18.100.99] ([109.238.20.116]) by Aruba Outgoing Smtp with ESMTPSA id SCUjpuOdPD88OSCUjpGWR4; Wed, 15 Feb 2023 08:46:26 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1676447186; bh=Au9I1na0C0jJNQFDem5w6Inesr0ehTSts1PUEYBd1Is=; h=Content-Type:Date:MIME-Version:Subject:To:From; b=bm071jtxn+co9pMOI24RIkGAoF46PvkBiGYTCrDHvLXBoOuWHdDnucPf9jdKHsTxF R9DLf1Y8Q0kEKnu0lBNTx2zNN4/K7eKnRrwmsoGIfJy75tKV0dcze6BZ3x6QUtsvIr M8t4k7zCsWw9+/KPBbL3yYUVUE4l0XG3UfMdauAXQ2fh83wdJe47Xz6ak/it3T11Qi Jwx8zVDuqbsDXbILOZdEKqRIXJtjquELcWjXIKSvkYLpYLO6qJMvck4YAxBYk8YLfC RHjSKGKPmfYU3GOi5EcCoXHj80bTOJ9FIg+qGMIowcqmvMgX5H4h5t0m6QM2xDpU/A hETUBwj3EsfYQ== Content-Type: multipart/mixed; boundary="------------NfS1SN1AwFm9LJ0s9gng5oM3" Message-ID: Date: Wed, 15 Feb 2023 08:46:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: PPS functionality for Intel Timed I/O To: "N, Pandith" Cc: "linux-kernel@vger.kernel.org" , "Sangannavar, Mallikarjunappa" , "D, Lakshmi Sowjanya" , "T R, Thejesh Reddy" , "Hall, Christopher S" , "Gross, Mark" References: <1e02cc71-baee-1e75-9160-062d563af795@enneenne.com> From: Rodolfo Giometti Content-Language: en-US In-Reply-To: X-CMAE-Envelope: MS4xfJIjLjfpJL2emIU+LKnjMrRSSniOVDkHwYIxBgieB67B3raHNDOgTyCtJi9LjoV4ZMmhn+Si86sq3Z7ExkO/wIiqAiW/+bRCUkOz0edr7IG1pZJYxKj/ 2WmwYzxBkcAPLMPYHe85Px5TdrK8m095AGcnj4P1xXHQVs7xSa4V4fw3ZAJUsKMcHUv6BrwZm3/aJf3VpXmWZHU1yy7qMxgHOrIXwJG1be7SlWAOToC0x5TR SgHIrX5Rht7znQRRNGYzEWJ03U/sU+tPkazdvH8FHj3viXf3ye+UDDQMARuuqjm93a9MWFSu8xNwW1iqbiASNHjXykh278dmPKFaql0kmsdUpq6u548jHN+T mfSvilnRJCkVeXHmjIxtJb5jB1wOnLQO/SdTfLAxsHhNT2mDpwFPb+6/F4RJIQHZkhXU6/VIrKgaOHbamDHPr//7iFoktl3QzdEpH4JF8cIrRdTUH7s= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------NfS1SN1AwFm9LJ0s9gng5oM3 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 15/02/23 08:09, N, Pandith wrote: > Hi Rodolfo, Hello. >> -----Original Message----- >> From: Rodolfo Giometti >> Sent: Monday, February 6, 2023 4:17 PM >> To: N, Pandith >> Cc: linux-kernel@vger.kernel.org; Sangannavar, Mallikarjunappa >> ; D, Lakshmi Sowjanya >> ; T R, Thejesh Reddy >> ; Hall, Christopher S >> >> Subject: Re: PPS functionality for Intel Timed I/O [snip] >> Mmm... I'm not sure this is correct since PPS generators should generate >> their pulses according to system clock and not according to their internal >> clocks even if they are synced with the system clock. >> > Timed I/O and system time are both driven by the *same* hardware clock. > Timed I/O is a high precision device (nanoseconds), able to output pulses. > The driver gets the system time and schedules output > at target_time in the future. OK, in this case it would be OK. Please put an appropriate note within the generator's code and a detailed one within Documentation/driver-api/pps.rst. Regarding Documentation/driver-api/pps.rst let me suggest you to prose a separate patch to rewrite the Generators section in such a way you easily can add your solution at the end. A possible example is attached but feel free to rewrite it according to your needs. > struct timespec64 current_time; > current_time = ktime_get_real_ts64(¤t_time); > > target_time = current_time + offset_time; > cycles = translate_system_time_to_clock_cycles(target_time); > /* Translate function is developed as part of this driver development */ > > /* Schedule pulse at target_time */ > write_timedio_reg(TIMEDIO_TRIGGER, cycles); > > The output always triggers with ~20 ns precision. > It's not affected by system load or no need for drivers to disable interrupts for longer durations. > With this driver proposal, Intel Timed I/O as PPS generator will be useful in IoT and server applications. Great! Please also add these notes to the final Documentation. Ciao, Rodolfo -- GNU/Linux Solutions e-mail: giometti@enneenne.com Linux Device Driver giometti@linux.it Embedded Systems phone: +39 349 2432127 UNIX programming skype: rodolfo.giometti --------------NfS1SN1AwFm9LJ0s9gng5oM3 Content-Type: text/x-patch; charset=UTF-8; name="pps_rst_doc_proposal.patch" Content-Disposition: attachment; filename="pps_rst_doc_proposal.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL0RvY3VtZW50YXRpb24vZHJpdmVyLWFwaS9wcHMucnN0IGIvRG9jdW1l bnRhdGlvbi9kcml2ZXItYXBpL3Bwcy5yc3QKaW5kZXggMmQ2Yjk5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