Skip to content

Commit

Permalink
Merge tag 'wireless-drivers-next-2020-12-03' of git://git.kernel.org/…
Browse files Browse the repository at this point in the history
…pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for v5.11

First set of patches for v5.11. rtw88 getting improvements to work
better with Bluetooth and other driver also getting some new features.
mhi-ath11k-immutable branch was pulled from mhi tree to avoid
conflicts with mhi tree.

Major changes:

rtw88
 * major bluetooth co-existance improvements
wilc1000
 * Wi-Fi Multimedia (WMM) support
ath11k
 * Fast Initial Link Setup (FILS) discovery and unsolicited broadcast
   probe response support
 * qcom,ath11k-calibration-variant Device Tree setting
 * cold boot calibration support
 * new DFS region: JP
wnc36xx
 * enable connection monitoring and keepalive in firmware
ath10k
 * firmware IRAM recovery feature
mhi
 * merge mhi-ath11k-immutable branch to make MHI API change go smoothly

* tag 'wireless-drivers-next-2020-12-03' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next: (180 commits)
  wl1251: remove trailing semicolon in macro definition
  airo: remove trailing semicolon in macro definition
  wilc1000: added queue support for WMM
  wilc1000: call complete() for failure in wilc_wlan_txq_add_cfg_pkt()
  wilc1000: free resource in wilc_wlan_txq_add_mgmt_pkt() for failure path
  wilc1000: free resource in wilc_wlan_txq_add_net_pkt() for failure path
  wilc1000: added 'ndo_set_mac_address' callback support
  brcmfmac: expose firmware config files through modinfo
  wlcore: Switch to using the new API kobj_to_dev()
  rtw88: coex: add feature to enhance HID coexistence performance
  rtw88: coex: upgrade coexistence A2DP mechanism
  rtw88: coex: add action for coexistence in hardware initial
  rtw88: coex: add function to avoid cck lock
  rtw88: coex: change the coexistence mechanism for WLAN connected
  rtw88: coex: change the coexistence mechanism for HID
  rtw88: coex: update AFH information while in free-run mode
  rtw88: coex: update the mechanism for A2DP + PAN
  rtw88: coex: add debug message
  rtw88: coex: run coexistence when WLAN entering/leaving LPS
  Revert "rtl8xxxu: Add Buffalo WI-U3-866D to list of supported devices"
  ...
====================

Link: https://lore.kernel.org/r/20201203185732.9CFA5C433ED@smtp.codeaurora.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Dec 4, 2020
2 parents fdd8b82 + 9eb597c commit 846c3c9
Show file tree
Hide file tree
Showing 150 changed files with 3,496 additions and 1,488 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ properties:
* reg
* reg-names

qcom,ath11k-calibration-variant:
$ref: /schemas/types.yaml#/definitions/string
description:
string to uniquely identify variant of the calibration data in the
board-2.bin for designs with colliding bus and device specific ids

required:
- compatible
- reg
Expand Down
9 changes: 0 additions & 9 deletions drivers/bus/mhi/core/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,6 @@ static int parse_ch_cfg(struct mhi_controller *mhi_cntrl,
mhi_chan->offload_ch = ch_cfg->offload_channel;
mhi_chan->db_cfg.reset_req = ch_cfg->doorbell_mode_switch;
mhi_chan->pre_alloc = ch_cfg->auto_queue;
mhi_chan->auto_start = ch_cfg->auto_start;

/*
* If MHI host allocates buffers, then the channel direction
Expand Down Expand Up @@ -1160,11 +1159,6 @@ static int mhi_driver_probe(struct device *dev)
goto exit_probe;

ul_chan->xfer_cb = mhi_drv->ul_xfer_cb;
if (ul_chan->auto_start) {
ret = mhi_prepare_channel(mhi_cntrl, ul_chan);
if (ret)
goto exit_probe;
}
}

ret = -EINVAL;
Expand Down Expand Up @@ -1198,9 +1192,6 @@ static int mhi_driver_probe(struct device *dev)
if (ret)
goto exit_probe;

if (dl_chan && dl_chan->auto_start)
mhi_prepare_channel(mhi_cntrl, dl_chan);

mhi_device_put(mhi_dev);

return ret;
Expand Down
1 change: 0 additions & 1 deletion drivers/bus/mhi/core/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ struct mhi_chan {
bool configured;
bool offload_ch;
bool pre_alloc;
bool auto_start;
bool wake_capable;
};

Expand Down
85 changes: 84 additions & 1 deletion drivers/net/wireless/ath/ath10k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ static const char *const ath10k_core_fw_feature_str[] = {
[ATH10K_FW_FEATURE_NON_BMI] = "non-bmi",
[ATH10K_FW_FEATURE_SINGLE_CHAN_INFO_PER_CHANNEL] = "single-chan-info-per-channel",
[ATH10K_FW_FEATURE_PEER_FIXED_RATE] = "peer-fixed-rate",
[ATH10K_FW_FEATURE_IRAM_RECOVERY] = "iram-recovery",
};

static unsigned int ath10k_core_get_fw_feature_str(char *buf,
Expand Down Expand Up @@ -2604,6 +2605,78 @@ static int ath10k_core_compat_services(struct ath10k *ar)
return 0;
}

#define TGT_IRAM_READ_PER_ITR (8 * 1024)

static int ath10k_core_copy_target_iram(struct ath10k *ar)
{
const struct ath10k_hw_mem_layout *hw_mem;
const struct ath10k_mem_region *tmp, *mem_region = NULL;
dma_addr_t paddr;
void *vaddr = NULL;
u8 num_read_itr;
int i, ret;
u32 len, remaining_len;

hw_mem = ath10k_coredump_get_mem_layout(ar);
if (!hw_mem)
return -ENOMEM;

for (i = 0; i < hw_mem->region_table.size; i++) {
tmp = &hw_mem->region_table.regions[i];
if (tmp->type == ATH10K_MEM_REGION_TYPE_REG) {
mem_region = tmp;
break;
}
}

if (!mem_region)
return -ENOMEM;

for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
if (ar->wmi.mem_chunks[i].req_id ==
WMI_IRAM_RECOVERY_HOST_MEM_REQ_ID) {
vaddr = ar->wmi.mem_chunks[i].vaddr;
len = ar->wmi.mem_chunks[i].len;
break;
}
}

if (!vaddr || !len) {
ath10k_warn(ar, "No allocated memory for IRAM back up");
return -ENOMEM;
}

len = (len < mem_region->len) ? len : mem_region->len;
paddr = mem_region->start;
num_read_itr = len / TGT_IRAM_READ_PER_ITR;
remaining_len = len % TGT_IRAM_READ_PER_ITR;
for (i = 0; i < num_read_itr; i++) {
ret = ath10k_hif_diag_read(ar, paddr, vaddr,
TGT_IRAM_READ_PER_ITR);
if (ret) {
ath10k_warn(ar, "failed to copy firmware IRAM contents: %d",
ret);
return ret;
}

paddr += TGT_IRAM_READ_PER_ITR;
vaddr += TGT_IRAM_READ_PER_ITR;
}

if (remaining_len) {
ret = ath10k_hif_diag_read(ar, paddr, vaddr, remaining_len);
if (ret) {
ath10k_warn(ar, "failed to copy firmware IRAM contents: %d",
ret);
return ret;
}
}

ath10k_dbg(ar, ATH10K_DBG_BOOT, "target IRAM back up completed\n");

return 0;
}

int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
const struct ath10k_fw_components *fw)
{
Expand Down Expand Up @@ -2636,7 +2709,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
if (status)
goto err;

/* Some of of qca988x solutions are having global reset issue
/* Some of qca988x solutions are having global reset issue
* during target initialization. Bypassing PLL setting before
* downloading firmware and letting the SoC run on REF_CLK is
* fixing the problem. Corresponding firmware change is also
Expand Down Expand Up @@ -2765,6 +2838,16 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
ath10k_dbg(ar, ATH10K_DBG_BOOT, "firmware %s booted\n",
ar->hw->wiphy->fw_version);

if (test_bit(ATH10K_FW_FEATURE_IRAM_RECOVERY,
ar->running_fw->fw_file.fw_features)) {
status = ath10k_core_copy_target_iram(ar);
if (status) {
ath10k_warn(ar, "failed to copy target iram contents: %d",
status);
goto err_hif_stop;
}
}

if (test_bit(WMI_SERVICE_EXT_RES_CFG_SUPPORT, ar->wmi.svc_map) &&
mode == ATH10K_FIRMWARE_MODE_NORMAL) {
val = 0;
Expand Down
8 changes: 8 additions & 0 deletions drivers/net/wireless/ath/ath10k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@

#define ATH10K_MAX_RETRY_COUNT 30

#define ATH10K_ITER_NORMAL_FLAGS (IEEE80211_IFACE_ITER_NORMAL | \
IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER)
#define ATH10K_ITER_RESUME_FLAGS (IEEE80211_IFACE_ITER_RESUME_ALL |\
IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER)

struct ath10k;

static inline const char *ath10k_bus_str(enum ath10k_bus bus)
Expand Down Expand Up @@ -829,6 +834,9 @@ enum ath10k_fw_features {
/* Firmware allows setting peer fixed rate */
ATH10K_FW_FEATURE_PEER_FIXED_RATE = 21,

/* Firmware support IRAM recovery */
ATH10K_FW_FEATURE_IRAM_RECOVERY = 22,

/* keep last */
ATH10K_FW_FEATURE_COUNT,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ static ssize_t ath10k_write_simulate_radar(struct file *file,
struct ath10k *ar = file->private_data;
struct ath10k_vif *arvif;

/* Just check for for the first vif alone, as all the vifs will be
/* Just check for the first vif alone, as all the vifs will be
* sharing the same channel and if the channel is disabled, all the
* vifs will share the same 'is_started' state.
*/
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/ath/ath10k/htt_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3878,7 +3878,6 @@ bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
return ath10k_htt_rx_proc_rx_frag_ind(htt,
&resp->rx_frag_ind,
skb);
break;
}
case HTT_T2H_MSG_TYPE_TEST:
break;
Expand Down
21 changes: 10 additions & 11 deletions drivers/net/wireless/ath/ath10k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@ static void ath10k_mac_handle_beacon_iter(void *data, u8 *mac,
void ath10k_mac_handle_beacon(struct ath10k *ar, struct sk_buff *skb)
{
ieee80211_iterate_active_interfaces_atomic(ar->hw,
IEEE80211_IFACE_ITER_NORMAL,
ATH10K_ITER_NORMAL_FLAGS,
ath10k_mac_handle_beacon_iter,
skb);
}
Expand Down Expand Up @@ -2099,7 +2099,7 @@ static void ath10k_mac_handle_beacon_miss_iter(void *data, u8 *mac,
void ath10k_mac_handle_beacon_miss(struct ath10k *ar, u32 vdev_id)
{
ieee80211_iterate_active_interfaces_atomic(ar->hw,
IEEE80211_IFACE_ITER_NORMAL,
ATH10K_ITER_NORMAL_FLAGS,
ath10k_mac_handle_beacon_miss_iter,
&vdev_id);
}
Expand Down Expand Up @@ -3433,7 +3433,7 @@ void ath10k_mac_tx_unlock(struct ath10k *ar, int reason)
return;

ieee80211_iterate_active_interfaces_atomic(ar->hw,
IEEE80211_IFACE_ITER_RESUME_ALL,
ATH10K_ITER_RESUME_FLAGS,
ath10k_mac_tx_unlock_iter,
ar);

Expand Down Expand Up @@ -3522,7 +3522,7 @@ void ath10k_mac_handle_tx_pause_vdev(struct ath10k *ar, u32 vdev_id,

spin_lock_bh(&ar->htt.tx_lock);
ieee80211_iterate_active_interfaces_atomic(ar->hw,
IEEE80211_IFACE_ITER_RESUME_ALL,
ATH10K_ITER_RESUME_FLAGS,
ath10k_mac_handle_tx_pause_iter,
&arg);
spin_unlock_bh(&ar->htt.tx_lock);
Expand Down Expand Up @@ -5457,7 +5457,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
/* Some firmware revisions don't wait for beacon tx completion before
* sending another SWBA event. This could lead to hardware using old
* (freed) beacon data in some cases, e.g. tx credit starvation
* combined with missed TBTT. This is very very rare.
* combined with missed TBTT. This is very rare.
*
* On non-IOMMU-enabled hosts this could be a possible security issue
* because hw could beacon some random data on the air. On
Expand Down Expand Up @@ -8696,7 +8696,7 @@ ath10k_mac_op_change_chanctx(struct ieee80211_hw *hw,
if (changed & IEEE80211_CHANCTX_CHANGE_WIDTH) {
ieee80211_iterate_active_interfaces_atomic(
hw,
IEEE80211_IFACE_ITER_NORMAL,
ATH10K_ITER_NORMAL_FLAGS,
ath10k_mac_change_chanctx_cnt_iter,
&arg);
if (arg.n_vifs == 0)
Expand All @@ -8709,7 +8709,7 @@ ath10k_mac_op_change_chanctx(struct ieee80211_hw *hw,

ieee80211_iterate_active_interfaces_atomic(
hw,
IEEE80211_IFACE_ITER_NORMAL,
ATH10K_ITER_NORMAL_FLAGS,
ath10k_mac_change_chanctx_fill_iter,
&arg);
ath10k_mac_update_vif_chan(ar, arg.vifs, arg.n_vifs);
Expand Down Expand Up @@ -9169,10 +9169,11 @@ static int ath10k_mac_op_set_tid_config(struct ieee80211_hw *hw,
goto exit;
}

ret = 0;

if (sta)
goto exit;

ret = 0;
arvif->tids_rst = 0;
data.curr_vif = vif;
data.ar = ar;
Expand Down Expand Up @@ -9593,14 +9594,12 @@ static void ath10k_get_arvif_iter(void *data, u8 *mac,
struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id)
{
struct ath10k_vif_iter arvif_iter;
u32 flags;

memset(&arvif_iter, 0, sizeof(struct ath10k_vif_iter));
arvif_iter.vdev_id = vdev_id;

flags = IEEE80211_IFACE_ITER_RESUME_ALL;
ieee80211_iterate_active_interfaces_atomic(ar->hw,
flags,
ATH10K_ITER_RESUME_FLAGS,
ath10k_get_arvif_iter,
&arvif_iter);
if (!arvif_iter.arvif) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void ath10k_p2p_noa_update_by_vdev_id(struct ath10k *ar, u32 vdev_id,
};

ieee80211_iterate_active_interfaces_atomic(ar->hw,
IEEE80211_IFACE_ITER_NORMAL,
ATH10K_ITER_NORMAL_FLAGS,
ath10k_p2p_noa_update_vdev_iter,
&arg);
}
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3236,7 +3236,7 @@ static int ath10k_pci_init_irq(struct ath10k *ar)
if (ret == 0)
return 0;

/* fall-through */
/* MHI failed, try legacy irq next */
}

/* Try legacy irq
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath10k/qmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ static void ath10k_qmi_msa_ready_ind(struct qmi_handle *qmi_hdl,
ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_MSA_READY_IND, NULL);
}

static struct qmi_msg_handler qmi_msg_handler[] = {
static const struct qmi_msg_handler qmi_msg_handler[] = {
{
.type = QMI_INDICATION,
.msg_id = QMI_WLFW_FW_READY_IND_V01,
Expand Down Expand Up @@ -981,7 +981,7 @@ static void ath10k_qmi_del_server(struct qmi_handle *qmi_hdl,
NULL);
}

static struct qmi_ops ath10k_qmi_ops = {
static const struct qmi_ops ath10k_qmi_ops = {
.new_server = ath10k_qmi_new_server,
.del_server = ath10k_qmi_del_server,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/rx_desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct rx_attention {
* first_msdu is set.
*
* peer_idx_invalid
* Indicates no matching entries within the the max search
* Indicates no matching entries within the max search
* count. Only set when first_msdu is set.
*
* peer_idx_timeout
Expand Down
20 changes: 10 additions & 10 deletions drivers/net/wireless/ath/ath10k/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ static int ath10k_sdio_bmi_exchange_msg(struct ath10k *ar,
* Wait for first 4 bytes to be in FIFO
* If CONSERVATIVE_BMI_READ is enabled, also wait for
* a BMI command credit, which indicates that the ENTIRE
* response is available in the the FIFO
* response is available in the FIFO
*
* CASE 3: length > 128
* Wait for the first 4 bytes to be in FIFO
Expand Down Expand Up @@ -1962,9 +1962,15 @@ static void ath10k_sdio_hif_stop(struct ath10k *ar)
{
struct ath10k_sdio_bus_request *req, *tmp_req;
struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar);
struct sk_buff *skb;

ath10k_sdio_irq_disable(ar);

cancel_work_sync(&ar_sdio->async_work_rx);

while ((skb = skb_dequeue(&ar_sdio->rx_head)))
dev_kfree_skb_any(skb);

cancel_work_sync(&ar_sdio->wr_async_work);

spin_lock_bh(&ar_sdio->wr_async_lock);
Expand Down Expand Up @@ -2307,8 +2313,8 @@ static int ath10k_sdio_dump_memory_section(struct ath10k *ar,
}

count = 0;

for (i = 0; cur_section; i++) {
i = 0;
for (; cur_section; cur_section = next_section) {
section_size = cur_section->end - cur_section->start;

if (section_size <= 0) {
Expand All @@ -2318,7 +2324,7 @@ static int ath10k_sdio_dump_memory_section(struct ath10k *ar,
break;
}

if ((i + 1) == mem_region->section_table.size) {
if (++i == mem_region->section_table.size) {
/* last section */
next_section = NULL;
skip_size = 0;
Expand Down Expand Up @@ -2361,12 +2367,6 @@ static int ath10k_sdio_dump_memory_section(struct ath10k *ar,
}

count += skip_size;

if (!next_section)
/* this was the last section */
break;

cur_section = next_section;
}

return count;
Expand Down
Loading

0 comments on commit 846c3c9

Please sign in to comment.