From: Jacob Keller <jacob.e.keller@intel.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Cc: <intel-wired-lan@lists.osuosl.org>, <anthony.l.nguyen@intel.com>,
<netdev@vger.kernel.org>, Simon Horman <horms@kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next] igb: use ktime_get_real helpers in igb_ptp_reset()
Date: Wed, 8 Apr 2026 08:51:54 -0700 [thread overview]
Message-ID: <d969d975-76d9-44a8-813e-01cabd984d04@intel.com> (raw)
In-Reply-To: <5496af54-1bfa-4ecd-9565-b87a9df81277@molgen.mpg.de>
On 4/8/2026 4:57 AM, Paul Menzel wrote:
> Dear Aleksandr,
>
>
> Thank you for your patch.
>
> Am 08.04.26 um 10:35 schrieb Aleksandr Loktionov:
>> Replace ktime_to_ns(ktime_get_real()) with the direct equivalent
>> ktime_get_real_ns() and ktime_to_timespec64(ktime_get_real()) with
>> ktime_get_real_ts64() in igb_ptp_reset(). Using the combined helpers
>> avoids the unnecessary intermediate ktime_t variable and makes the
>> intent clearer.
>
> No intermediate variable is removed in the diff below. What am I missing?
>
The commit message is seems clear to me:
ktime_get_real() returns the current time as a ktime_t, and this is then
converted into a timepsec64 with ktime_to_timespec64.
The ktime_get_real_ts64() is implemented to generate the current time as
a timespec64 directly, avoiding the ktime_t passed between
ktime_get_real() and ktime_to_timespec64.
Thanks,
Jake
>> Suggested-by: Jacob Keller <jacob.e.keller@intel.com>
>> Suggested-by: Simon Horman <horms@kernel.org>
>> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
>> ---
>> drivers/net/ethernet/intel/igb/igb_ptp.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/
>> ethernet/intel/igb/igb_ptp.c
>> index bd85d02..638d824 100644
>> --- a/drivers/net/ethernet/intel/igb/igb_ptp.c
>> +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
>> @@ -1500,12 +1500,13 @@ void igb_ptp_reset(struct igb_adapter *adapter)
>> /* Re-initialize the timer. */
>> if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) {
>> - struct timespec64 ts = ktime_to_timespec64(ktime_get_real());
>> + struct timespec64 ts;
>> + ktime_get_real_ts64(&ts);
>> igb_ptp_write_i210(adapter, &ts);
>> } else {
>> timecounter_init(&adapter->tc, &adapter->cc,
>> - ktime_to_ns(ktime_get_real()));
>> + ktime_get_real_ns());
>> }
>> out:
>> spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
>
> With the commit message clarified, feel free to add:
>
> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
>
>
> Kind regards,
>
> Paul
prev parent reply other threads:[~2026-04-08 15:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 8:35 [PATCH iwl-next] igb: use ktime_get_real helpers in igb_ptp_reset() Aleksandr Loktionov
2026-04-08 11:57 ` [Intel-wired-lan] " Paul Menzel
2026-04-08 15:51 ` Jacob Keller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d969d975-76d9-44a8-813e-01cabd984d04@intel.com \
--to=jacob.e.keller@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=netdev@vger.kernel.org \
--cc=pmenzel@molgen.mpg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox