mac80211: fix kconf handling of allnoconfig, fixes spurious brcmfmac related build...
[oweals/openwrt.git] / package / kernel / mac80211 / patches / 306-ath10k-use-local-memory-instead-of-shadow-descriptor.patch
1 From: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
2 Date: Fri, 23 Oct 2015 18:01:03 +0530
3 Subject: [PATCH] ath10k: use local memory instead of shadow descriptor
4  in ce_send
5
6 Currently to avoid uncached memory access while filling up copy engine
7 descriptors, shadow descriptors are used. This can be optimized further
8 by removing shadow descriptors. To achieve that first shadow ring
9 dependency in ce_send is removed by creating local copy of the
10 descriptor on stack and make a one-shot copy into the "uncached"
11 descriptor.
12
13 Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
14 Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
15 ---
16
17 --- a/drivers/net/wireless/ath/ath10k/ce.c
18 +++ b/drivers/net/wireless/ath/ath10k/ce.c
19 @@ -274,7 +274,7 @@ int ath10k_ce_send_nolock(struct ath10k_
20  {
21         struct ath10k *ar = ce_state->ar;
22         struct ath10k_ce_ring *src_ring = ce_state->src_ring;
23 -       struct ce_desc *desc, *sdesc;
24 +       struct ce_desc *desc, sdesc;
25         unsigned int nentries_mask = src_ring->nentries_mask;
26         unsigned int sw_index = src_ring->sw_index;
27         unsigned int write_index = src_ring->write_index;
28 @@ -294,7 +294,6 @@ int ath10k_ce_send_nolock(struct ath10k_
29  
30         desc = CE_SRC_RING_TO_DESC(src_ring->base_addr_owner_space,
31                                    write_index);
32 -       sdesc = CE_SRC_RING_TO_DESC(src_ring->shadow_base, write_index);
33  
34         desc_flags |= SM(transfer_id, CE_DESC_FLAGS_META_DATA);
35  
36 @@ -303,11 +302,11 @@ int ath10k_ce_send_nolock(struct ath10k_
37         if (flags & CE_SEND_FLAG_BYTE_SWAP)
38                 desc_flags |= CE_DESC_FLAGS_BYTE_SWAP;
39  
40 -       sdesc->addr   = __cpu_to_le32(buffer);
41 -       sdesc->nbytes = __cpu_to_le16(nbytes);
42 -       sdesc->flags  = __cpu_to_le16(desc_flags);
43 +       sdesc.addr   = __cpu_to_le32(buffer);
44 +       sdesc.nbytes = __cpu_to_le16(nbytes);
45 +       sdesc.flags  = __cpu_to_le16(desc_flags);
46  
47 -       *desc = *sdesc;
48 +       *desc = sdesc;
49  
50         src_ring->per_transfer_context[write_index] = per_transfer_context;
51  
52 @@ -614,7 +613,7 @@ int ath10k_ce_completed_send_next_nolock
53         if (read_index == sw_index)
54                 return -EIO;
55  
56 -       sbase = src_ring->shadow_base;
57 +       sbase = src_ring->base_addr_owner_space;
58         sdesc = CE_SRC_RING_TO_DESC(sbase, sw_index);
59  
60         /* Return data from completed source descriptor */