OSDN Git Service

ath10k: fix dma unmap direction for management frames
authorRakesh Pillai <pillair@codeaurora.org>
Fri, 25 Jan 2019 04:21:06 +0000 (09:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:20 +0000 (14:50 +0100)
[ Upstream commit 6e8a8991e2103dcb6a9cff28f460390e8e360848 ]

The management frames transmitted are dma mapped with
direction TO_DEVICE, but incorrectly mapped with
direction FROM_DEVICE during tx complete and error cases.

Fix the direction of dma during dma unmap of the
transmitted management frames.

Tested HW: WCN3990
Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1

Fixes: 38a1390e02b7 ("ath10k: dma unmap mgmt tx buffer if wmi cmd send fails")
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath10k/wmi.c

index 448e3a8..a09d7a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2005-2011 Atheros Communications Inc.
  * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -3853,7 +3853,7 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work)
                                ath10k_warn(ar, "failed to transmit management frame by ref via WMI: %d\n",
                                            ret);
                                dma_unmap_single(ar->dev, paddr, skb->len,
-                                                DMA_FROM_DEVICE);
+                                                DMA_TO_DEVICE);
                                ieee80211_free_txskb(ar->hw, skb);
                        }
                } else {
index aefc92d..0f6ff7a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2005-2011 Atheros Communications Inc.
  * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -2340,7 +2340,7 @@ static int wmi_process_mgmt_tx_comp(struct ath10k *ar, u32 desc_id,
 
        msdu = pkt_addr->vaddr;
        dma_unmap_single(ar->dev, pkt_addr->paddr,
-                        msdu->len, DMA_FROM_DEVICE);
+                        msdu->len, DMA_TO_DEVICE);
        info = IEEE80211_SKB_CB(msdu);
 
        if (status)