Skip to content

Commit d8d6639

Browse files
jmberg-intelKalle Valo
authored andcommitted
iwlwifi: pcie: indicate correct RB size to device
In the context info, we need to indicate the correct RB size to the device so that it will not think we have 4k when we only use 2k. This seems to not have caused any issues right now, likely because the hardware no longer supports putting multiple entries into a single RB, and practically all of the entries should be smaller than 2k. Nevertheless, it's a bug, and we must advertise the right size to the device. Note that right now we can only tell it 2k vs. 4k, so for the cases where we have more, still use 4k. This needs to be fixed by the firmware first. Signed-off-by: Johannes Berg <[email protected]> Fixes: cfdc20e ("iwlwifi: pcie: use partial pages if applicable") Cc: [email protected] # v5.6 Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200417100405.ae6cd345764f.I0985c55223decf70182b9ef1d8edf4179f537853@changeid
1 parent 290d5e4 commit d8d6639

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
129129
int cmdq_size = max_t(u32, IWL_CMD_QUEUE_SIZE,
130130
trans->cfg->min_txq_size);
131131

132+
switch (trans_pcie->rx_buf_size) {
133+
case IWL_AMSDU_DEF:
134+
return -EINVAL;
135+
case IWL_AMSDU_2K:
136+
break;
137+
case IWL_AMSDU_4K:
138+
case IWL_AMSDU_8K:
139+
case IWL_AMSDU_12K:
140+
control_flags |= IWL_PRPH_SCRATCH_RB_SIZE_4K;
141+
break;
142+
}
143+
132144
/* Allocate prph scratch */
133145
prph_scratch = dma_alloc_coherent(trans->dev, sizeof(*prph_scratch),
134146
&trans_pcie->prph_scratch_dma_addr,
@@ -143,10 +155,8 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
143155
cpu_to_le16((u16)iwl_read32(trans, CSR_HW_REV));
144156
prph_sc_ctrl->version.size = cpu_to_le16(sizeof(*prph_scratch) / 4);
145157

146-
control_flags = IWL_PRPH_SCRATCH_RB_SIZE_4K |
147-
IWL_PRPH_SCRATCH_MTR_MODE |
148-
(IWL_PRPH_MTR_FORMAT_256B &
149-
IWL_PRPH_SCRATCH_MTR_FORMAT);
158+
control_flags |= IWL_PRPH_SCRATCH_MTR_MODE;
159+
control_flags |= IWL_PRPH_MTR_FORMAT_256B & IWL_PRPH_SCRATCH_MTR_FORMAT;
150160

151161
/* initialize RX default queue */
152162
prph_sc_ctrl->rbd_cfg.free_rbd_addr =

0 commit comments

Comments
 (0)