[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ada0b6ed-a833-4faf-9dd2-eaca6a65c389@intel.com>
Date: Mon, 22 Apr 2024 11:29:08 +0200
From: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
To: Rahul Rameshbabu <rrameshbabu@...dia.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 4/18/2024 9:28 PM, Rahul Rameshbabu wrote:
>
> 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.
>
Not really sure if this is applicable here. I understand Your point with
LIFO but in my opinion at the beginning we should unregister PTP clock
and when done - set the flag to false;
>> +}
>
> <snip>
>
> --
> Thanks,
>
> Rahul Rameshbabu
>
Powered by blists - more mailing lists