aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uwb/rsv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/uwb/rsv.c')
-rw-r--r--drivers/uwb/rsv.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/uwb/rsv.c b/drivers/uwb/rsv.c
index ec6eecb32f30..6b76f4bb4cc7 100644
--- a/drivers/uwb/rsv.c
+++ b/drivers/uwb/rsv.c
@@ -114,7 +114,8 @@ void uwb_rsv_dump(char *text, struct uwb_rsv *rsv)
114 devaddr = rsv->target.devaddr; 114 devaddr = rsv->target.devaddr;
115 uwb_dev_addr_print(target, sizeof(target), &devaddr); 115 uwb_dev_addr_print(target, sizeof(target), &devaddr);
116 116
117 dev_dbg(dev, "rsv %s -> %s: %s\n", owner, target, uwb_rsv_state_str(rsv->state)); 117 dev_dbg(dev, "rsv %s %s -> %s: %s\n",
118 text, owner, target, uwb_rsv_state_str(rsv->state));
118} 119}
119 120
120static void uwb_rsv_release(struct kref *kref) 121static void uwb_rsv_release(struct kref *kref)
@@ -511,8 +512,7 @@ void uwb_rsv_remove(struct uwb_rsv *rsv)
511 512
512 if (uwb_rsv_is_owner(rsv)) 513 if (uwb_rsv_is_owner(rsv))
513 uwb_rsv_put_stream(rsv); 514 uwb_rsv_put_stream(rsv);
514 515
515 del_timer_sync(&rsv->timer);
516 uwb_dev_put(rsv->owner); 516 uwb_dev_put(rsv->owner);
517 if (rsv->target.type == UWB_RSV_TARGET_DEV) 517 if (rsv->target.type == UWB_RSV_TARGET_DEV)
518 uwb_dev_put(rsv->target.dev); 518 uwb_dev_put(rsv->target.dev);
@@ -870,7 +870,7 @@ void uwb_rsv_queue_update(struct uwb_rc *rc)
870 */ 870 */
871void uwb_rsv_sched_update(struct uwb_rc *rc) 871void uwb_rsv_sched_update(struct uwb_rc *rc)
872{ 872{
873 spin_lock(&rc->rsvs_lock); 873 spin_lock_bh(&rc->rsvs_lock);
874 if (!delayed_work_pending(&rc->rsv_update_work)) { 874 if (!delayed_work_pending(&rc->rsv_update_work)) {
875 if (rc->set_drp_ie_pending > 0) { 875 if (rc->set_drp_ie_pending > 0) {
876 rc->set_drp_ie_pending++; 876 rc->set_drp_ie_pending++;
@@ -879,7 +879,7 @@ void uwb_rsv_sched_update(struct uwb_rc *rc)
879 uwb_rsv_queue_update(rc); 879 uwb_rsv_queue_update(rc);
880 } 880 }
881unlock: 881unlock:
882 spin_unlock(&rc->rsvs_lock); 882 spin_unlock_bh(&rc->rsvs_lock);
883} 883}
884 884
885/* 885/*
@@ -943,13 +943,22 @@ void uwb_rsv_remove_all(struct uwb_rc *rc)
943 943
944 mutex_lock(&rc->rsvs_mutex); 944 mutex_lock(&rc->rsvs_mutex);
945 list_for_each_entry_safe(rsv, t, &rc->reservations, rc_node) { 945 list_for_each_entry_safe(rsv, t, &rc->reservations, rc_node) {
946 uwb_rsv_remove(rsv); 946 if (rsv->state != UWB_RSV_STATE_NONE)
947 uwb_rsv_set_state(rsv, UWB_RSV_STATE_NONE);
948 del_timer_sync(&rsv->timer);
947 } 949 }
948 /* Cancel any postponed update. */ 950 /* Cancel any postponed update. */
949 rc->set_drp_ie_pending = 0; 951 rc->set_drp_ie_pending = 0;
950 mutex_unlock(&rc->rsvs_mutex); 952 mutex_unlock(&rc->rsvs_mutex);
951 953
952 cancel_delayed_work_sync(&rc->rsv_update_work); 954 cancel_delayed_work_sync(&rc->rsv_update_work);
955 flush_workqueue(rc->rsv_workq);
956
957 mutex_lock(&rc->rsvs_mutex);
958 list_for_each_entry_safe(rsv, t, &rc->reservations, rc_node) {
959 uwb_rsv_remove(rsv);
960 }
961 mutex_unlock(&rc->rsvs_mutex);
953} 962}
954 963
955void uwb_rsv_init(struct uwb_rc *rc) 964void uwb_rsv_init(struct uwb_rc *rc)