[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <73b634db-13fe-dd02-614a-7d1453c3834d@intel.com>
Date: Wed, 7 Dec 2022 16:29:54 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: Saeed Mahameed <saeed@...nel.org>,
Tony Nguyen <anthony.l.nguyen@...el.com>
CC: <davem@...emloft.net>, <kuba@...nel.org>, <pabeni@...hat.com>,
<edumazet@...gle.com>, <netdev@...r.kernel.org>,
<richardcochran@...il.com>, <leon@...nel.org>,
Gurucharan G <gurucharanx.g@...el.com>
Subject: Re: [PATCH net-next v2 09/15] ice: protect init and calibrating check
in ice_ptp_request_ts
On 12/7/2022 3:36 PM, Saeed Mahameed wrote:
> On 07 Dec 13:09, Tony Nguyen wrote:
>> From: Jacob Keller <jacob.e.keller@...el.com>
>>
>> When requesting a new timestamp, the ice_ptp_request_ts function does not
>> hold the Tx tracker lock while checking init and calibrating. This means
>> that we might issue a new timestamp request just after the Tx timestamp
>> tracker starts being deinitialized. This could lead to incorrect
>> access of
>> the timestamp structures. Correct this by moving the init and calibrating
>> checks under the lock, and updating the flows which modify these
>> fields to
>> use the lock.
>>
>> Note that we do not need to hold the lock while checking for tx->init in
>> ice_ptp_tstamp_tx. This is because the teardown function will use
>> synchronize_irq after clearing the flag to ensure that the threaded
>
> FYI: couldn't find any ice_ptp_tstamp_tx(), and if it's running in xmit
> path sofritrq then sync_irq won't help you.
>
I think that's a typo in the commit message, woops. It should be the
following flow:
ice_misc_intr_thread_fn() -> ice_ptp_process_ts() -> ice_ptp_tx_tstamp()
the ice_misc_intr_thread_fn is a threaded IRQ function for
ice_misc_intr. I believe from reading the kernel doc that
synchronize_irq will work for threaded IRQ function.
Thanks,
Jake
Powered by blists - more mailing lists