diff options
author | Thomas Pugliese <thomas.pugliese@gmail.com> | 2014-04-25 11:30:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-27 17:56:54 -0400 |
commit | 90ec00d54e28f4b038e66905ea5b9478bcdc3f37 (patch) | |
tree | 71ed3bc15a264277adcad0b562d8198d8656759f /drivers/uwb/rsv.c | |
parent | bae00c1ac3b3f32a0f7f1964054f6c3f33559607 (diff) |
uwb: fix channel change failure
Make the transition to the UWB_RSV_STATE_NONE state synchronous so that
there is not a race between uwb_rsv_terminate and uwb_rsv_establish.
uwb_rsv_terminate would set the rsv->state to UWB_RSV_STATE_NONE but did
not release the stream resource until a 320ms timeout had expired. If a
user called uwb_rsv_establish during that time, it could fail to
establish the reservation because no stream resources were available.
This patch removes the timer from the uwb_rsv_terminate process since it
is not needed when transitioning to UWB_RSV_STATE_NONE.
Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uwb/rsv.c')
-rw-r--r-- | drivers/uwb/rsv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/uwb/rsv.c b/drivers/uwb/rsv.c index 3fe611941046..4026f1adff01 100644 --- a/drivers/uwb/rsv.c +++ b/drivers/uwb/rsv.c | |||
@@ -249,7 +249,9 @@ static void uwb_rsv_stroke_timer(struct uwb_rsv *rsv) | |||
249 | * super frame and should not be terminated if no response is | 249 | * super frame and should not be terminated if no response is |
250 | * received. | 250 | * received. |
251 | */ | 251 | */ |
252 | if (rsv->is_multicast) { | 252 | if (rsv->state == UWB_RSV_STATE_NONE) { |
253 | sframes = 0; | ||
254 | } else if (rsv->is_multicast) { | ||
253 | if (rsv->state == UWB_RSV_STATE_O_INITIATED | 255 | if (rsv->state == UWB_RSV_STATE_O_INITIATED |
254 | || rsv->state == UWB_RSV_STATE_O_MOVE_EXPANDING | 256 | || rsv->state == UWB_RSV_STATE_O_MOVE_EXPANDING |
255 | || rsv->state == UWB_RSV_STATE_O_MOVE_COMBINING | 257 | || rsv->state == UWB_RSV_STATE_O_MOVE_COMBINING |
@@ -322,6 +324,7 @@ void uwb_rsv_set_state(struct uwb_rsv *rsv, enum uwb_rsv_state new_state) | |||
322 | switch (new_state) { | 324 | switch (new_state) { |
323 | case UWB_RSV_STATE_NONE: | 325 | case UWB_RSV_STATE_NONE: |
324 | uwb_rsv_state_update(rsv, UWB_RSV_STATE_NONE); | 326 | uwb_rsv_state_update(rsv, UWB_RSV_STATE_NONE); |
327 | uwb_rsv_remove(rsv); | ||
325 | uwb_rsv_callback(rsv); | 328 | uwb_rsv_callback(rsv); |
326 | break; | 329 | break; |
327 | case UWB_RSV_STATE_O_INITIATED: | 330 | case UWB_RSV_STATE_O_INITIATED: |
@@ -442,6 +445,8 @@ static void uwb_rsv_handle_timeout_work(struct work_struct *work) | |||
442 | uwb_rsv_set_state(rsv, UWB_RSV_STATE_T_ACCEPTED); | 445 | uwb_rsv_set_state(rsv, UWB_RSV_STATE_T_ACCEPTED); |
443 | uwb_drp_avail_release(rsv->rc, &rsv->mv.companion_mas); | 446 | uwb_drp_avail_release(rsv->rc, &rsv->mv.companion_mas); |
444 | goto unlock; | 447 | goto unlock; |
448 | case UWB_RSV_STATE_NONE: | ||
449 | goto unlock; | ||
445 | default: | 450 | default: |
446 | break; | 451 | break; |
447 | } | 452 | } |