mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 08:04:06 +07:00
iwlwifi: pcie: unify iwl_rx_replenish and iwl_rx_replenish_now
Besides the different allocation flags, they are really the same. Pass the gfp_t flags as a parameter, and unify them. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This commit is contained in:
parent
ea68f46070
commit
e69140e59a
@ -373,16 +373,9 @@ static void iwl_pcie_rxq_free_rbs(struct iwl_trans *trans)
|
|||||||
* Also restock the Rx queue via iwl_pcie_rxq_restock.
|
* Also restock the Rx queue via iwl_pcie_rxq_restock.
|
||||||
* This is called as a scheduled work item (except for during initialization)
|
* This is called as a scheduled work item (except for during initialization)
|
||||||
*/
|
*/
|
||||||
static void iwl_pcie_rx_replenish(struct iwl_trans *trans)
|
static void iwl_pcie_rx_replenish(struct iwl_trans *trans, gfp_t gfp)
|
||||||
{
|
{
|
||||||
iwl_pcie_rxq_alloc_rbs(trans, GFP_KERNEL);
|
iwl_pcie_rxq_alloc_rbs(trans, gfp);
|
||||||
|
|
||||||
iwl_pcie_rxq_restock(trans);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void iwl_pcie_rx_replenish_now(struct iwl_trans *trans)
|
|
||||||
{
|
|
||||||
iwl_pcie_rxq_alloc_rbs(trans, GFP_ATOMIC);
|
|
||||||
|
|
||||||
iwl_pcie_rxq_restock(trans);
|
iwl_pcie_rxq_restock(trans);
|
||||||
}
|
}
|
||||||
@ -392,7 +385,7 @@ static void iwl_pcie_rx_replenish_work(struct work_struct *data)
|
|||||||
struct iwl_trans_pcie *trans_pcie =
|
struct iwl_trans_pcie *trans_pcie =
|
||||||
container_of(data, struct iwl_trans_pcie, rx_replenish);
|
container_of(data, struct iwl_trans_pcie, rx_replenish);
|
||||||
|
|
||||||
iwl_pcie_rx_replenish(trans_pcie->trans);
|
iwl_pcie_rx_replenish(trans_pcie->trans, GFP_KERNEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iwl_pcie_rx_alloc(struct iwl_trans *trans)
|
static int iwl_pcie_rx_alloc(struct iwl_trans *trans)
|
||||||
@ -528,7 +521,7 @@ int iwl_pcie_rx_init(struct iwl_trans *trans)
|
|||||||
memset(rxq->rb_stts, 0, sizeof(*rxq->rb_stts));
|
memset(rxq->rb_stts, 0, sizeof(*rxq->rb_stts));
|
||||||
spin_unlock(&rxq->lock);
|
spin_unlock(&rxq->lock);
|
||||||
|
|
||||||
iwl_pcie_rx_replenish(trans);
|
iwl_pcie_rx_replenish(trans, GFP_KERNEL);
|
||||||
|
|
||||||
iwl_pcie_rx_hw_init(trans, rxq);
|
iwl_pcie_rx_hw_init(trans, rxq);
|
||||||
|
|
||||||
@ -750,7 +743,7 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans)
|
|||||||
if (count >= 8) {
|
if (count >= 8) {
|
||||||
rxq->read = i;
|
rxq->read = i;
|
||||||
spin_unlock(&rxq->lock);
|
spin_unlock(&rxq->lock);
|
||||||
iwl_pcie_rx_replenish_now(trans);
|
iwl_pcie_rx_replenish(trans, GFP_ATOMIC);
|
||||||
count = 0;
|
count = 0;
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
@ -762,7 +755,7 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans)
|
|||||||
spin_unlock(&rxq->lock);
|
spin_unlock(&rxq->lock);
|
||||||
|
|
||||||
if (fill_rx)
|
if (fill_rx)
|
||||||
iwl_pcie_rx_replenish_now(trans);
|
iwl_pcie_rx_replenish(trans, GFP_ATOMIC);
|
||||||
else
|
else
|
||||||
iwl_pcie_rxq_restock(trans);
|
iwl_pcie_rxq_restock(trans);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user