diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-07-07 10:17:56 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-07-07 10:17:56 +0200 |
commit | f1615bbe9be4def59c3b3eaddb60722efeed16c2 (patch) | |
tree | ca3020e65447576fc1826e819651e6ba072030b5 /drivers/uwb/rsv.c | |
parent | cfb3c0ab0903abb6ea5215b37eebd9c2a1f057eb (diff) | |
parent | cd3de83f147601356395b57a8673e9c5ff1e59d1 (diff) |
Merge tag 'v3.16-rc4' into drm-intel-next-queued
Due to Dave's vacation drm-next hasn't opened yet for 3.17 so I
couldn't move my drm-intel-next queue forward yet like I usually do.
Just pull in the latest upstream -rc to unblock patch merging - I
don't want to needlessly rebase my current patch pile really and void
all the testing we've done already.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/uwb/rsv.c')
-rw-r--r-- | drivers/uwb/rsv.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/uwb/rsv.c b/drivers/uwb/rsv.c index 3fe61194104..0887ae98278 100644 --- a/drivers/uwb/rsv.c +++ b/drivers/uwb/rsv.c @@ -163,8 +163,10 @@ static int uwb_rsv_get_stream(struct uwb_rsv *rsv) } stream = find_first_zero_bit(streams_bm, UWB_NUM_STREAMS); - if (stream >= UWB_NUM_STREAMS) + if (stream >= UWB_NUM_STREAMS) { + dev_err(dev, "%s: no available stream found\n", __func__); return -EBUSY; + } rsv->stream = stream; set_bit(stream, streams_bm); @@ -249,7 +251,9 @@ static void uwb_rsv_stroke_timer(struct uwb_rsv *rsv) * super frame and should not be terminated if no response is * received. */ - if (rsv->is_multicast) { + if (rsv->state == UWB_RSV_STATE_NONE) { + sframes = 0; + } else if (rsv->is_multicast) { if (rsv->state == UWB_RSV_STATE_O_INITIATED || rsv->state == UWB_RSV_STATE_O_MOVE_EXPANDING || rsv->state == UWB_RSV_STATE_O_MOVE_COMBINING @@ -322,6 +326,7 @@ void uwb_rsv_set_state(struct uwb_rsv *rsv, enum uwb_rsv_state new_state) switch (new_state) { case UWB_RSV_STATE_NONE: uwb_rsv_state_update(rsv, UWB_RSV_STATE_NONE); + uwb_rsv_remove(rsv); uwb_rsv_callback(rsv); break; case UWB_RSV_STATE_O_INITIATED: @@ -442,6 +447,8 @@ static void uwb_rsv_handle_timeout_work(struct work_struct *work) uwb_rsv_set_state(rsv, UWB_RSV_STATE_T_ACCEPTED); uwb_drp_avail_release(rsv->rc, &rsv->mv.companion_mas); goto unlock; + case UWB_RSV_STATE_NONE: + goto unlock; default: break; } @@ -550,12 +557,16 @@ int uwb_rsv_establish(struct uwb_rsv *rsv) { struct uwb_rc *rc = rsv->rc; struct uwb_mas_bm available; + struct device *dev = &rc->uwb_dev.dev; int ret; mutex_lock(&rc->rsvs_mutex); ret = uwb_rsv_get_stream(rsv); - if (ret) + if (ret) { + dev_err(dev, "%s: uwb_rsv_get_stream failed: %d\n", + __func__, ret); goto out; + } rsv->tiebreaker = prandom_u32() & 1; /* get available mas bitmap */ @@ -565,12 +576,16 @@ int uwb_rsv_establish(struct uwb_rsv *rsv) if (ret == UWB_RSV_ALLOC_NOT_FOUND) { ret = -EBUSY; uwb_rsv_put_stream(rsv); + dev_err(dev, "%s: uwb_rsv_find_best_allocation failed: %d\n", + __func__, ret); goto out; } ret = uwb_drp_avail_reserve_pending(rc, &rsv->mas); if (ret != 0) { uwb_rsv_put_stream(rsv); + dev_err(dev, "%s: uwb_drp_avail_reserve_pending failed: %d\n", + __func__, ret); goto out; } |