308-ath10k-cleanup-copy-engine-send-completion.patch 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. From: Rajkumar Manoharan <[email protected]>
  2. Date: Fri, 23 Oct 2015 18:01:05 +0530
  3. Subject: [PATCH] ath10k: cleanup copy engine send completion
  4. The physical address necessary to unmap DMA ('bufferp') is stored
  5. in ath10k_skb_cb as 'paddr'. ath10k doesn't rely on the meta/transfer_id
  6. when handling send completion (htc ep id is stored in sk_buff control
  7. buffer). So the unused output arguments {bufferp, nbytesp and transfer_idp}
  8. are removed from CE send completion. This change is needed before removing
  9. the shadow copy of copy engine (CE) descriptors in follow up patch.
  10. Signed-off-by: Rajkumar Manoharan <[email protected]>
  11. Signed-off-by: Kalle Valo <[email protected]>
  12. ---
  13. --- a/drivers/net/wireless/ath/ath10k/ce.c
  14. +++ b/drivers/net/wireless/ath/ath10k/ce.c
  15. @@ -578,17 +578,13 @@ int ath10k_ce_revoke_recv_next(struct at
  16. * The caller takes responsibility for any necessary locking.
  17. */
  18. int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
  19. - void **per_transfer_contextp,
  20. - u32 *bufferp,
  21. - unsigned int *nbytesp,
  22. - unsigned int *transfer_idp)
  23. + void **per_transfer_contextp)
  24. {
  25. struct ath10k_ce_ring *src_ring = ce_state->src_ring;
  26. u32 ctrl_addr = ce_state->ctrl_addr;
  27. struct ath10k *ar = ce_state->ar;
  28. unsigned int nentries_mask = src_ring->nentries_mask;
  29. unsigned int sw_index = src_ring->sw_index;
  30. - struct ce_desc *sdesc, *sbase;
  31. unsigned int read_index;
  32. if (src_ring->hw_index == sw_index) {
  33. @@ -613,15 +609,6 @@ int ath10k_ce_completed_send_next_nolock
  34. if (read_index == sw_index)
  35. return -EIO;
  36. - sbase = src_ring->base_addr_owner_space;
  37. - sdesc = CE_SRC_RING_TO_DESC(sbase, sw_index);
  38. -
  39. - /* Return data from completed source descriptor */
  40. - *bufferp = __le32_to_cpu(sdesc->addr);
  41. - *nbytesp = __le16_to_cpu(sdesc->nbytes);
  42. - *transfer_idp = MS(__le16_to_cpu(sdesc->flags),
  43. - CE_DESC_FLAGS_META_DATA);
  44. -
  45. if (per_transfer_contextp)
  46. *per_transfer_contextp =
  47. src_ring->per_transfer_context[sw_index];
  48. @@ -696,10 +683,7 @@ int ath10k_ce_cancel_send_next(struct at
  49. }
  50. int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
  51. - void **per_transfer_contextp,
  52. - u32 *bufferp,
  53. - unsigned int *nbytesp,
  54. - unsigned int *transfer_idp)
  55. + void **per_transfer_contextp)
  56. {
  57. struct ath10k *ar = ce_state->ar;
  58. struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
  59. @@ -707,9 +691,7 @@ int ath10k_ce_completed_send_next(struct
  60. spin_lock_bh(&ar_pci->ce_lock);
  61. ret = ath10k_ce_completed_send_next_nolock(ce_state,
  62. - per_transfer_contextp,
  63. - bufferp, nbytesp,
  64. - transfer_idp);
  65. + per_transfer_contextp);
  66. spin_unlock_bh(&ar_pci->ce_lock);
  67. return ret;
  68. --- a/drivers/net/wireless/ath/ath10k/ce.h
  69. +++ b/drivers/net/wireless/ath/ath10k/ce.h
  70. @@ -192,16 +192,10 @@ int ath10k_ce_completed_recv_next(struct
  71. * Pops 1 completed send buffer from Source ring.
  72. */
  73. int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
  74. - void **per_transfer_contextp,
  75. - u32 *bufferp,
  76. - unsigned int *nbytesp,
  77. - unsigned int *transfer_idp);
  78. + void **per_transfer_contextp);
  79. int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
  80. - void **per_transfer_contextp,
  81. - u32 *bufferp,
  82. - unsigned int *nbytesp,
  83. - unsigned int *transfer_idp);
  84. + void **per_transfer_contextp);
  85. /*==================CE Engine Initialization=======================*/
  86. --- a/drivers/net/wireless/ath/ath10k/pci.c
  87. +++ b/drivers/net/wireless/ath/ath10k/pci.c
  88. @@ -910,9 +910,8 @@ static int ath10k_pci_diag_read_mem(stru
  89. goto done;
  90. i = 0;
  91. - while (ath10k_ce_completed_send_next_nolock(ce_diag, NULL, &buf,
  92. - &completed_nbytes,
  93. - &id) != 0) {
  94. + while (ath10k_ce_completed_send_next_nolock(ce_diag,
  95. + NULL) != 0) {
  96. mdelay(1);
  97. if (i++ > DIAG_ACCESS_CE_TIMEOUT_MS) {
  98. ret = -EBUSY;
  99. @@ -1073,9 +1072,8 @@ static int ath10k_pci_diag_write_mem(str
  100. goto done;
  101. i = 0;
  102. - while (ath10k_ce_completed_send_next_nolock(ce_diag, NULL, &buf,
  103. - &completed_nbytes,
  104. - &id) != 0) {
  105. + while (ath10k_ce_completed_send_next_nolock(ce_diag,
  106. + NULL) != 0) {
  107. mdelay(1);
  108. if (i++ > DIAG_ACCESS_CE_TIMEOUT_MS) {
  109. @@ -1139,13 +1137,9 @@ static void ath10k_pci_htc_tx_cb(struct
  110. struct ath10k *ar = ce_state->ar;
  111. struct sk_buff_head list;
  112. struct sk_buff *skb;
  113. - u32 ce_data;
  114. - unsigned int nbytes;
  115. - unsigned int transfer_id;
  116. __skb_queue_head_init(&list);
  117. - while (ath10k_ce_completed_send_next(ce_state, (void **)&skb, &ce_data,
  118. - &nbytes, &transfer_id) == 0) {
  119. + while (ath10k_ce_completed_send_next(ce_state, (void **)&skb) == 0) {
  120. /* no need to call tx completion for NULL pointers */
  121. if (skb == NULL)
  122. continue;
  123. @@ -1215,12 +1209,8 @@ static void ath10k_pci_htt_tx_cb(struct
  124. {
  125. struct ath10k *ar = ce_state->ar;
  126. struct sk_buff *skb;
  127. - u32 ce_data;
  128. - unsigned int nbytes;
  129. - unsigned int transfer_id;
  130. - while (ath10k_ce_completed_send_next(ce_state, (void **)&skb, &ce_data,
  131. - &nbytes, &transfer_id) == 0) {
  132. + while (ath10k_ce_completed_send_next(ce_state, (void **)&skb) == 0) {
  133. /* no need to call tx completion for NULL pointers */
  134. if (!skb)
  135. continue;
  136. @@ -1796,12 +1786,8 @@ err_dma:
  137. static void ath10k_pci_bmi_send_done(struct ath10k_ce_pipe *ce_state)
  138. {
  139. struct bmi_xfer *xfer;
  140. - u32 ce_data;
  141. - unsigned int nbytes;
  142. - unsigned int transfer_id;
  143. - if (ath10k_ce_completed_send_next(ce_state, (void **)&xfer, &ce_data,
  144. - &nbytes, &transfer_id))
  145. + if (ath10k_ce_completed_send_next(ce_state, (void **)&xfer))
  146. return;
  147. xfer->tx_done = true;