On Mon, Dec 21, 2015 at 11:15 AM, Richard Cochran
<richardcoch...@gmail.com> wrote:
> On Sun, Dec 20, 2015 at 11:46:30PM +0200, Saeed Mahameed wrote:
>> +/* Should run once every mlx5e_tstamp->overflow_period */
>> +static void mlx5e_timestamp_overflow(struct work_struct *work)
>> +{
>> + struct delayed_work *dwork = to_delayed_work(work);
>> + struct mlx5e_tstamp *tstamp = container_of(dwork, struct mlx5e_tstamp,
>> overflow_work);
>> + unsigned long flags;
>> +
>> + write_lock_irqsave(&tstamp->lock, flags);
>> + timecounter_read(&tstamp->clock);
>> + if (tstamp->overflow_period)
>> + schedule_delayed_work(&tstamp->overflow_work,
>> tstamp->overflow_period);
>
> You don't need this test, and the call to schedule_delayed_work can be
> outside of the lock.
>
Ok, but what will happen if somehow tstamp->overflow_period is zero ?
the work will run too rapidly.
don't we need to have protection against such case.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html