--- zzzz-none-000/linux-3.10.107/drivers/uwb/beacon.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/uwb/beacon.c 2021-02-04 17:41:59.000000000 +0000 @@ -117,6 +117,7 @@ int result; struct device *dev = &rc->uwb_dev.dev; + dev_dbg(dev, "%s: channel = %d\n", __func__, channel); if (channel < 0) channel = -1; if (channel == -1) @@ -124,8 +125,10 @@ else { /* channel >= 0...dah */ result = uwb_rc_start_beacon(rc, bpst_offset, channel); - if (result < 0) + if (result < 0) { + dev_err(dev, "Cannot start beaconing: %d\n", result); return result; + } if (le16_to_cpu(rc->ies->wIELength) > 0) { result = uwb_rc_set_ie(rc, rc->ies); if (result < 0) { @@ -184,7 +187,7 @@ /* Find a beacon by dev addr in the cache */ static -struct uwb_beca_e *__uwb_beca_find_bymac(struct uwb_rc *rc, +struct uwb_beca_e *__uwb_beca_find_bymac(struct uwb_rc *rc, const struct uwb_mac_addr *mac_addr) { struct uwb_beca_e *bce, *next; @@ -394,7 +397,6 @@ struct uwb_rc_evt_beacon *be; struct uwb_beacon_frame *bf; struct uwb_beca_e *bce; - unsigned long last_ts; rc = evt->rc; be = container_of(evt->notif.rceb, struct uwb_rc_evt_beacon, rceb); @@ -438,8 +440,6 @@ /* purge old beacon data */ kfree(bce->be); - last_ts = bce->ts_jiffies; - /* Update commonly used fields */ bce->ts_jiffies = evt->ts_jiffies; bce->be = be; @@ -515,13 +515,13 @@ } bpsc = container_of(evt->notif.rceb, struct uwb_rc_evt_bp_slot_change, rceb); - mutex_lock(&rc->uwb_dev.mutex); if (uwb_rc_evt_bp_slot_change_no_slot(bpsc)) { - dev_info(dev, "stopped beaconing: No free slots in BP\n"); + dev_err(dev, "stopped beaconing: No free slots in BP\n"); + mutex_lock(&rc->uwb_dev.mutex); rc->beaconing = -1; + mutex_unlock(&rc->uwb_dev.mutex); } else rc->uwb_dev.beacon_slot = uwb_rc_evt_bp_slot_change_slot_num(bpsc); - mutex_unlock(&rc->uwb_dev.mutex); return 0; }