diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-13 17:51:39 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-01-13 17:51:39 -0500 |
commit | 95ed644fd12f53c6fc778f3f246974e5fe3a9468 (patch) | |
tree | edf9f57192ad95f9165b3be5dbf1e8e745249ed1 /drivers/infiniband/ulp/ipoib/ipoib_ib.c | |
parent | 9eacee2ac624bfa9740d49355dbe6ee88d0cba0a (diff) |
IB: convert from semaphores to mutexes
semaphore to mutex conversion by Ingo and Arjan's script.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
[ Sanity-checked on real IB hardware ]
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_ib.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index f7e848970794..86bcdd72a107 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -52,7 +52,7 @@ MODULE_PARM_DESC(data_debug_level, | |||
52 | 52 | ||
53 | #define IPOIB_OP_RECV (1ul << 31) | 53 | #define IPOIB_OP_RECV (1ul << 31) |
54 | 54 | ||
55 | static DECLARE_MUTEX(pkey_sem); | 55 | static DEFINE_MUTEX(pkey_mutex); |
56 | 56 | ||
57 | struct ipoib_ah *ipoib_create_ah(struct net_device *dev, | 57 | struct ipoib_ah *ipoib_create_ah(struct net_device *dev, |
58 | struct ib_pd *pd, struct ib_ah_attr *attr) | 58 | struct ib_pd *pd, struct ib_ah_attr *attr) |
@@ -445,10 +445,10 @@ int ipoib_ib_dev_down(struct net_device *dev) | |||
445 | 445 | ||
446 | /* Shutdown the P_Key thread if still active */ | 446 | /* Shutdown the P_Key thread if still active */ |
447 | if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) { | 447 | if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) { |
448 | down(&pkey_sem); | 448 | mutex_lock(&pkey_mutex); |
449 | set_bit(IPOIB_PKEY_STOP, &priv->flags); | 449 | set_bit(IPOIB_PKEY_STOP, &priv->flags); |
450 | cancel_delayed_work(&priv->pkey_task); | 450 | cancel_delayed_work(&priv->pkey_task); |
451 | up(&pkey_sem); | 451 | mutex_unlock(&pkey_mutex); |
452 | flush_workqueue(ipoib_workqueue); | 452 | flush_workqueue(ipoib_workqueue); |
453 | } | 453 | } |
454 | 454 | ||
@@ -599,13 +599,13 @@ void ipoib_ib_dev_flush(void *_dev) | |||
599 | if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) | 599 | if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) |
600 | ipoib_ib_dev_up(dev); | 600 | ipoib_ib_dev_up(dev); |
601 | 601 | ||
602 | down(&priv->vlan_mutex); | 602 | mutex_lock(&priv->vlan_mutex); |
603 | 603 | ||
604 | /* Flush any child interfaces too */ | 604 | /* Flush any child interfaces too */ |
605 | list_for_each_entry(cpriv, &priv->child_intfs, list) | 605 | list_for_each_entry(cpriv, &priv->child_intfs, list) |
606 | ipoib_ib_dev_flush(&cpriv->dev); | 606 | ipoib_ib_dev_flush(&cpriv->dev); |
607 | 607 | ||
608 | up(&priv->vlan_mutex); | 608 | mutex_unlock(&priv->vlan_mutex); |
609 | } | 609 | } |
610 | 610 | ||
611 | void ipoib_ib_dev_cleanup(struct net_device *dev) | 611 | void ipoib_ib_dev_cleanup(struct net_device *dev) |
@@ -651,12 +651,12 @@ void ipoib_pkey_poll(void *dev_ptr) | |||
651 | if (test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) | 651 | if (test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) |
652 | ipoib_open(dev); | 652 | ipoib_open(dev); |
653 | else { | 653 | else { |
654 | down(&pkey_sem); | 654 | mutex_lock(&pkey_mutex); |
655 | if (!test_bit(IPOIB_PKEY_STOP, &priv->flags)) | 655 | if (!test_bit(IPOIB_PKEY_STOP, &priv->flags)) |
656 | queue_delayed_work(ipoib_workqueue, | 656 | queue_delayed_work(ipoib_workqueue, |
657 | &priv->pkey_task, | 657 | &priv->pkey_task, |
658 | HZ); | 658 | HZ); |
659 | up(&pkey_sem); | 659 | mutex_unlock(&pkey_mutex); |
660 | } | 660 | } |
661 | } | 661 | } |
662 | 662 | ||
@@ -670,12 +670,12 @@ int ipoib_pkey_dev_delay_open(struct net_device *dev) | |||
670 | 670 | ||
671 | /* P_Key value not assigned yet - start polling */ | 671 | /* P_Key value not assigned yet - start polling */ |
672 | if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) { | 672 | if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) { |
673 | down(&pkey_sem); | 673 | mutex_lock(&pkey_mutex); |
674 | clear_bit(IPOIB_PKEY_STOP, &priv->flags); | 674 | clear_bit(IPOIB_PKEY_STOP, &priv->flags); |
675 | queue_delayed_work(ipoib_workqueue, | 675 | queue_delayed_work(ipoib_workqueue, |
676 | &priv->pkey_task, | 676 | &priv->pkey_task, |
677 | HZ); | 677 | HZ); |
678 | up(&pkey_sem); | 678 | mutex_unlock(&pkey_mutex); |
679 | return 1; | 679 | return 1; |
680 | } | 680 | } |
681 | 681 | ||