[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sezieab7.fsf@nvidia.com>
Date: Thu, 18 Apr 2024 12:28:06 -0700
From: Rahul Rameshbabu <rrameshbabu@...dia.com>
To: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
horms@...nel.org, anthony.l.nguyen@...el.com, Jacob Keller
<jacob.e.keller@...el.com>, Sai Krishna <saikrishnag@...vell.com>,
Wojciech Drewek <wojciech.drewek@...el.com>, Ahmed Zaki
<ahmed.zaki@...el.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v5 06/12] iavf: add initial
framework for registering PTP clock
On Thu, 18 Apr, 2024 01:24:54 -0400 Mateusz Polchlopek <mateusz.polchlopek@...el.com> wrote:
> From: Jacob Keller <jacob.e.keller@...el.com>
>
> Add the iavf_ptp.c file and fill it in with a skeleton framework to
> allow registering the PTP clock device.
> Add implementation of helper functions to check if a PTP capability
> is supported and handle change in PTP capabilities.
> Enabling virtual clock would be possible, though it would probably
> perform poorly due to the lack of direct time access.
>
> Reviewed-by: Sai Krishna <saikrishnag@...vell.com>
> Reviewed-by: Wojciech Drewek <wojciech.drewek@...el.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@...el.com>
> Co-developed-by: Ahmed Zaki <ahmed.zaki@...el.com>
> Signed-off-by: Ahmed Zaki <ahmed.zaki@...el.com>
> Co-developed-by: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
> Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
> ---
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_ptp.c b/drivers/net/ethernet/intel/iavf/iavf_ptp.c
<snip>
> +/**
> + * iavf_ptp_release - Disable PTP support
> + * @adapter: private adapter structure
> + *
> + * Release all PTP resources that were previously initialized.
> + */
> +void iavf_ptp_release(struct iavf_adapter *adapter)
> +{
> + if (!IS_ERR_OR_NULL(adapter->ptp.clock)) {
> + dev_info(&adapter->pdev->dev, "removing PTP clock %s\n",
> + adapter->ptp.info.name);
> + ptp_clock_unregister(adapter->ptp.clock);
> + adapter->ptp.clock = NULL;
> + }
> +
> + adapter->ptp.initialized = false;
I think teardown should be LIFO order to initialization. I would move
this line to the beginning of the function before any resources are
actually released.
> +}
<snip>
--
Thanks,
Rahul Rameshbabu
Powered by blists - more mailing lists