genode/repos/dde_linux/patches/wifi_mem.patch

125 lines
4.0 KiB
Diff
Raw Normal View History

--- a/drivers/net/wireless/iwlwifi/dvm/calib.c
+++ b/drivers/net/wireless/iwlwifi/dvm/calib.c
@@ -121,7 +121,7 @@ int iwl_calib_set(struct iwl_priv *priv,
struct iwl_calib_result *res, *tmp;
res = kmalloc(sizeof(*res) + len - sizeof(struct iwl_calib_hdr),
- GFP_ATOMIC);
+ GFP_ATOMIC | GFP_LX_DMA);
if (!res)
return -ENOMEM;
memcpy(&res->hdr, cmd, len);
--- a/drivers/net/wireless/iwlwifi/dvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/dvm/scan.c
@@ -672,7 +672,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
ctx = iwl_rxon_ctx_from_vif(vif);
if (!priv->scan_cmd) {
- priv->scan_cmd = kmalloc(scan_cmd_size, GFP_KERNEL);
+ priv->scan_cmd = kmalloc(scan_cmd_size, GFP_KERNEL | GFP_LX_DMA);
if (!priv->scan_cmd) {
IWL_DEBUG_SCAN(priv,
"fail to allocate memory for scan\n");
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -1593,7 +1593,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
sizeof(struct iwl_device_cmd)
+ trans->dev_cmd_headroom,
sizeof(void *),
- SLAB_HWCACHE_ALIGN,
+ SLAB_HWCACHE_ALIGN | SLAB_LX_DMA,
NULL);
if (!trans->dev_cmd_pool) {
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -492,7 +492,7 @@ static int iwl_pcie_txq_alloc(struct iwl_trans *trans,
txq->entries = kcalloc(slots_num,
sizeof(struct iwl_pcie_txq_entry),
- GFP_KERNEL);
+ GFP_KERNEL | GFP_LX_DMA);
if (!txq->entries)
goto error;
@@ -501,7 +501,7 @@ static int iwl_pcie_txq_alloc(struct iwl_trans *trans,
for (i = 0; i < slots_num; i++) {
txq->entries[i].cmd =
kmalloc(sizeof(struct iwl_device_cmd),
- GFP_KERNEL);
+ GFP_KERNEL | GFP_LX_DMA);
if (!txq->entries[i].cmd)
goto error;
}
@@ -840,7 +840,7 @@ static int iwl_pcie_tx_alloc(struct iwl_trans *trans)
}
trans_pcie->txq = kcalloc(trans->cfg->base_params->num_of_queues,
- sizeof(struct iwl_txq), GFP_KERNEL);
+ sizeof(struct iwl_txq), GFP_KERNEL | GFP_LX_DMA);
if (!trans_pcie->txq) {
IWL_ERR(trans, "Not enough memory for txq\n");
ret = -ENOMEM;
@@ -1255,7 +1255,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
}
dup_buf = kmemdup(cmddata[i], cmdlen[i],
- GFP_ATOMIC);
+ GFP_ATOMIC | GFP_LX_DMA);
if (!dup_buf)
return -ENOMEM;
} else {
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -125,6 +125,8 @@ static void *__kmalloc_reserve(size_t size, gfp_t flags, int node,
void *obj;
bool ret_pfmemalloc = false;
+ flags |= GFP_LX_DMA;
+
/*
* Try a regular allocation, when that fails and we're not entitled
* to the reserves, fail.
--- a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
+++ b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
@@ -365,7 +365,7 @@
if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWBT_COEX))
return 0;
- bt_cmd = kzalloc(sizeof(*bt_cmd), GFP_KERNEL);
+ bt_cmd = kzalloc(sizeof(*bt_cmd), GFP_KERNEL | GFP_LX_DMA);
if (!bt_cmd)
return -ENOMEM;
cmd.data[0] = bt_cmd;
@@ -467,7 +467,7 @@
mvm->bt_kill_msk = bt_kill_msk;
- bt_cmd = kzalloc(sizeof(*bt_cmd), GFP_KERNEL);
+ bt_cmd = kzalloc(sizeof(*bt_cmd), GFP_KERNEL | GFP_LX_DMA);
if (!bt_cmd)
return -ENOMEM;
cmd.data[0] = bt_cmd;
--- a/drivers/net/wireless/iwlwifi/iwl-phy-db.c
+++ a/drivers/net/wireless/iwlwifi/iwl-phy-db.c
@@ -233,7 +233,7 @@
return -EINVAL;
kfree(entry->data);
- entry->data = kmemdup(phy_db_notif->data, size, alloc_ctx);
+ entry->data = kmemdup(phy_db_notif->data, size, alloc_ctx | GFP_LX_DMA);
if (!entry->data) {
entry->size = 0;
return -ENOMEM;
--- a/drivers/net/wireless/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
@@ -450,7 +450,7 @@
scan_size = sizeof(struct iwl_scan_cmd) +
mvm->fw->ucode_capa.max_probe_length +
(MAX_NUM_SCAN_CHANNELS * sizeof(struct iwl_scan_channel));
- mvm->scan_cmd = kmalloc(scan_size, GFP_KERNEL);
+ mvm->scan_cmd = kmalloc(scan_size, GFP_KERNEL | GFP_LX_DMA);
if (!mvm->scan_cmd)
goto out_free;