From af1b76efa5bf2843540793d462dca1694faf099a Mon Sep 17 00:00:00 2001 From: jiad Date: Wed, 14 Feb 2018 19:14:40 +0800 Subject: [PATCH] qcacld-3.0: skip dma unmap for IPA owned skb In MCC tx path, skb is owned by IPA driver, where IPA driver provides wlan driver directly DMA mapped address. Doing dma unmap of the skb will lead to skb dma map check failure. Fix is to skip dma unmap for IPA owned skb and let IPA driver handle dma unmap. Change-Id: Ib38ca949ba915785e460c05172b70088a3564b1c CRs-Fixed: 2189889 --- core/dp/txrx/ol_tx_desc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/dp/txrx/ol_tx_desc.c b/core/dp/txrx/ol_tx_desc.c index dbd0e74737ec..c8c9d31a7051 100644 --- a/core/dp/txrx/ol_tx_desc.c +++ b/core/dp/txrx/ol_tx_desc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -746,7 +746,14 @@ void ol_tx_desc_frame_list_free(struct ol_txrx_pdev_t *pdev, /* restore original hdr offset */ OL_TX_RESTORE_HDR(tx_desc, msdu); #endif - if (qdf_nbuf_get_users(msdu) <= 1) + + /* + * In MCC IPA tx context, IPA driver provides skb with directly + * DMA mapped address. In such case, there's no need for WLAN + * driver to DMA unmap the skb. + */ + if ((qdf_nbuf_get_users(msdu) <= 1) && + !qdf_nbuf_ipa_owned_get(msdu)) qdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_TO_DEVICE); /* free the tx desc */