aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/pensando/ionic/ionic_phc.c
diff options
context:
space:
mode:
authorShannon Nelson <snelson@pensando.io>2021-08-27 11:55:11 -0700
committerDavid S. Miller <davem@davemloft.net>2021-08-28 11:23:09 +0100
commit7ee99fc5ed2e5e299ef46a9ca9d24d93be08c461 (patch)
tree1dbaaae576df699c39e546fa344a937ef955ba04 /drivers/net/ethernet/pensando/ionic/ionic_phc.c
parentionic: add queue lock around open and stop (diff)
downloadlinux-dev-7ee99fc5ed2e5e299ef46a9ca9d24d93be08c461.tar.xz
linux-dev-7ee99fc5ed2e5e299ef46a9ca9d24d93be08c461.zip
ionic: pull hwstamp queue_lock up a level
Move the hwstamp configuration use of queue_lock up a level to simplify use and error handling. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_phc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c
index afc45da399d4..c39790a6c436 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c
@@ -194,7 +194,9 @@ int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr)
if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
return -EFAULT;
+ mutex_lock(&lif->queue_lock);
err = ionic_lif_hwstamp_set_ts_config(lif, &config);
+ mutex_unlock(&lif->queue_lock);
if (err) {
netdev_info(lif->netdev, "hwstamp set failed: %d\n", err);
return err;
@@ -213,7 +215,9 @@ void ionic_lif_hwstamp_replay(struct ionic_lif *lif)
if (!lif->phc || !lif->phc->ptp)
return;
+ mutex_lock(&lif->queue_lock);
err = ionic_lif_hwstamp_set_ts_config(lif, NULL);
+ mutex_unlock(&lif->queue_lock);
if (err)
netdev_info(lif->netdev, "hwstamp replay failed: %d\n", err);
}