[PATCH 2/2] wcn36xx: don't process 'valid' descriptors
Eugene Krasnikov
k.eugene.e at gmail.com
Wed Mar 19 07:55:56 EDT 2014
Make sense, thanx!
2014-03-18 12:09 GMT+00:00 Bob Copeland <me at bobcopeland.com>:
> The DMA engine will reset the valid bit after a descriptor is
> complete; any with the valid bit still set may still be in
> use by the hardware, so check that before processing the
> descriptor. We were checking this but only after the first
> iteration of the do-while loop.
>
> Signed-off-by: Bob Copeland <bob at cozybit.com>
> ---
> dxe.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/dxe.c b/dxe.c
> index 61f398b..51a0467 100644
> --- a/dxe.c
> +++ b/dxe.c
> @@ -356,6 +356,8 @@ static void reap_tx_dxes(struct wcn36xx *wcn, struct wcn36xx_dxe_ch *ch)
> * and while-do will not make any cycles.
> */
> do {
> + if (ctl->desc->ctrl & WCN36XX_DXE_CTRL_VALID_MASK)
> + break;
> if (ctl->skb) {
> dma_unmap_single(NULL, ctl->desc->src_addr_l,
> ctl->skb->len, DMA_TO_DEVICE);
> @@ -374,8 +376,7 @@ static void reap_tx_dxes(struct wcn36xx *wcn, struct wcn36xx_dxe_ch *ch)
> ctl->skb = NULL;
> }
> ctl = ctl->next;
> - } while (ctl != ch->head_blk_ctl &&
> - !(ctl->desc->ctrl & WCN36XX_DXE_CTRL_VALID_MASK));
> + } while (ctl != ch->head_blk_ctl);
>
> ch->tail_blk_ctl = ctl;
> }
> --
> 1.7.10.4
>
>
> _______________________________________________
> wcn36xx mailing list
> wcn36xx at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/wcn36xx
--
Best regards,
Eugene
More information about the wcn36xx
mailing list