net/mlx5: Release clock lock before scheduling a PPS work
authorEran Ben Elisha <eranbe@mellanox.com>
Tue, 19 May 2020 09:00:57 +0000 (12:00 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 15 Sep 2020 18:59:50 +0000 (11:59 -0700)
Holding the clock lock is not required when scheduling a PPS work.

Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c

index b62daf7..f8465e4 100644 (file)
@@ -581,8 +581,8 @@ static int mlx5_pps_event(struct notifier_block *nb,
                cycles_delta = div64_u64(nsec_delta << clock->cycles.shift,
                                         clock->cycles.mult);
                clock->pps_info.start[pin] = cycles_now + cycles_delta;
-               schedule_work(&clock->pps_info.out_work);
                write_sequnlock_irqrestore(&clock->lock, flags);
+               schedule_work(&clock->pps_info.out_work);
                break;
        default:
                mlx5_core_err(mdev, " Unhandled clock PPS event, func %d\n",