FAILED: patch "[PATCH] iwlwifi: mvm: limit maximum queue appropriately" failed to apply to 4.9-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e5b72e3bc4763152e24bf4b8333bae21cc526c56 Mon Sep 17 00:00:00 2001
From: Johannes Berg <[email protected]>
Date: Fri, 17 Apr 2020 10:08:12 +0300
Subject: [PATCH] iwlwifi: mvm: limit maximum queue appropriately
Due to some hardware issues, queue 31 isn't usable on devices that have 32 queues (7000, 8000, 9000 families), which is correctly reflected in the configuration and TX queue initialization.
However, the firmware API and queue allocation code assumes that there are 32 queues, and if something actually attempts to use #31 this leads to a NULL-pointer dereference since it's not allocated.
Fix this by limiting to 31 in the IWL_MVM_DQA_MAX_DATA_QUEUE, and also add some code to catch this earlier in the future, if the configuration changes perhaps.
drivers/net/wireless/intel/iwlwifi/fw/api/txq.h +3 -3
@@ -8,7 +8,7 @@* Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH -* Copyright(c) 2019 Intel Corporation +* Copyright(c) 2019 - 2020 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH -* Copyright(c) 2019 Intel Corporation +* Copyright(c) 2019 - 2020 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -99,7 +99,7 @@ enum iwl_mvm_dqa_txq {IWL_MVM_DQA_MAX_MGMT_QUEUE =8 ,IWL_MVM_DQA_AP_PROBE_RESP_QUEUE =9 ,IWL_MVM_DQA_MIN_DATA_QUEUE =10 , - IWL_MVM_DQA_MAX_DATA_QUEUE = 31, + IWL_MVM_DQA_MAX_DATA_QUEUE = 30, }; enum iwl_mvm_tx_fifo {
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +5 -0
@@ -722,6 +722,11 @@ static int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 sta_id,lockdep_assert_held (&mvm->mutex); +if (WARN (maxq >= mvm->trans->trans_cfg->base_params->num_of_queues, +"max queue %d >= num_of_queues (%d)" , maxq, + mvm->trans->trans_cfg->base_params->num_of_queues)) + maxq = mvm->trans->trans_cfg->base_params->num_of_queues -1 ; +/* This should not be hit with new TX path */ if (WARN_ON (iwl_mvm_has_new_tx_api (mvm)))return -ENOSPC ;