From patchwork Sun Sep 17 19:40:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9955047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 03E9C6028A for ; Sun, 17 Sep 2017 19:42:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAFF528A6E for ; Sun, 17 Sep 2017 19:42:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDE9428A8D; Sun, 17 Sep 2017 19:42:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F235D28A6E for ; Sun, 17 Sep 2017 19:41:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VHM00HglCzPqVtNkaxCvGBVXr+/Ppe9WOlwkVDyhM0w=; b=MXy8TMxy0q0yXPCHZmJP5kX1RE U8NNisft35GgwT12N3CJemW3zP1GR9od1TgAP5t1yvlIiSdnfd7loOmkbgngfg6asaF81RHoEIvRA ZhQiUAZL0nREn2K0AI3D635h8YV9HeLIQUQY2co9/vs0ydPNrj6HqG76D+jXuuMDxNubs9/WsHf9K Sb6Fn1tf9U87YpNZyMk1PojYnGkoNE3QLEP57COo/6RlzKbOEqzC6wueSguGkOfVQHyiBzVanBNk+ HE3yiMqgdtwnAkCGzbEYpNkud+6ogde0ord7i7vl0h+gnMH9Vc16I0CIgP2wS4arD1KA6SEeRHvKj kAT7pOxQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dtfRw-0000n5-KW; Sun, 17 Sep 2017 19:41:52 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dtfQx-0008Ix-6D for ath10k@lists.infradead.org; Sun, 17 Sep 2017 19:41:03 +0000 Received: by mail-lf0-x244.google.com with SMTP id m199so3534625lfe.5 for ; Sun, 17 Sep 2017 12:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i0IDnGvnc7ueEW/nmM9IVwxUFMf6sueUbVs37dyvIRg=; b=JRIHqjSG1iMws/ekQjIth9qTJF/LToMzG5xakZHzazueix1RwEQ0rmhT38FOleJGQ+ DydycdjvA/Czh3v4qsEY62fbZRzvB1nrJ3ljNhFkwKTTAi4rgwckJTnrBQ19FUGlRH5b Bp6rSut1kL9uER3X7D6Y86TFsudMW+rvevIR8ULLnfeRZqjEpMXHfXPfF8If/rcCPhdD wqgsEJq+krURcJTSq2Km1dWnC01IilUWSndPmPtuIW0D8LrJMILqW9FSsGt25yxBMsZG 6NkziMRHWRo6s/2Csx4/pykwUiUPS22Cw84LRwTBU5LxjrQuRw1gFzheBxD4Rrl0pbgB S7JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i0IDnGvnc7ueEW/nmM9IVwxUFMf6sueUbVs37dyvIRg=; b=earCJRPsprD/EyoEQZHyqaX6dCdstW79HWuoMMfgTlcl4LQ0oGplVxWDDV+G3Lvhn9 Dc7BcFQPwkfWrT5DRwBhhWGZzEVppcMBY2JN3FOYY2rS/70w2CqiHVocgqryZsKvfJdJ l2KZ1yLK6qWUluOawuyytsHWxwDehe6/tkoNpFtcYHjvIGXRhwtN6ifIkTcBlYT1zkAv k+Gi0rUh25OU0Dc7Wa/QhF/BrntUJg9TVXUsMa4VvFotWMkaD8O2GDKaNK9y6wWjUjOV Av7CVIatf9rxEjERBMo+6uq1fSlwWLQmMA+AcudjBT5Gp4zw9deO9JhD/vUDgzWp6Bw2 Rb1Q== X-Gm-Message-State: AHPjjUg2hjbEwnXQq2j7iYDfpllaPhtEPHIa05X7O4mNoqkroixdpZ7S 8raMLKEY2ncEnA== X-Google-Smtp-Source: AOwi7QBVWRUXxFq0a3h6DKzIVUpMJp/v6TIQGNgClLiiTvove8Z3OcX0dvz2+wu8A+fGoxU6i1DA/g== X-Received: by 10.46.5.88 with SMTP id 85mr5468844ljf.63.1505677229680; Sun, 17 Sep 2017 12:40:29 -0700 (PDT) Received: from erik-arch-i5-6600.lan (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id 1sm1452879ljo.13.2017.09.17.12.40.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Sep 2017 12:40:29 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v3 07/11] ath10k: various fixes for high latency devices Date: Sun, 17 Sep 2017 21:40:09 +0200 Message-Id: <20170917194013.8658-8-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170917194013.8658-1-erik.stromdahl@gmail.com> References: <20170917194013.8658-1-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170917_124051_532696_77FBEB40 X-CRM114-Status: GOOD ( 11.75 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Stromdahl MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Several DMA related functions (such as the dma_map_xxx functions) are not used with high latency devices and don't need to be invoked in this case. A few other execution paths are not applicable for high latency devices and can be skipped. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/htc.c | 19 ++++++++++++------- drivers/net/wireless/ath/ath10k/htt_rx.c | 3 ++- drivers/net/wireless/ath/ath10k/htt_tx.c | 9 +++++++-- drivers/net/wireless/ath/ath10k/txrx.c | 5 +++-- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index e5c80f582ff5..75c2a3ea7ec9 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -53,7 +53,8 @@ static inline void ath10k_htc_restore_tx_skb(struct ath10k_htc *htc, { struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); - dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); + if (!htc->ar->is_high_latency) + dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); skb_pull(skb, sizeof(struct ath10k_htc_hdr)); } @@ -137,11 +138,14 @@ int ath10k_htc_send(struct ath10k_htc *htc, ath10k_htc_prepare_tx_skb(ep, skb); skb_cb->eid = eid; - skb_cb->paddr = dma_map_single(dev, skb->data, skb->len, DMA_TO_DEVICE); - ret = dma_mapping_error(dev, skb_cb->paddr); - if (ret) { - ret = -EIO; - goto err_credits; + if (!ar->is_high_latency) { + skb_cb->paddr = dma_map_single(dev, skb->data, skb->len, + DMA_TO_DEVICE); + ret = dma_mapping_error(dev, skb_cb->paddr); + if (ret) { + ret = -EIO; + goto err_credits; + } } sg_item.transfer_id = ep->eid; @@ -157,7 +161,8 @@ int ath10k_htc_send(struct ath10k_htc *htc, return 0; err_unmap: - dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); + if (!ar->is_high_latency) + dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); err_credits: if (ep->tx_credit_flow_enabled) { spin_lock_bh(&htc->tx_lock); diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 7461555ccad5..569edd0720c6 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2541,7 +2541,8 @@ bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) break; } case HTT_T2H_MSG_TYPE_TX_COMPL_IND: - ath10k_htt_rx_tx_compl_ind(htt->ar, skb); + if (!ar->is_high_latency) + ath10k_htt_rx_tx_compl_ind(htt->ar, skb); break; case HTT_T2H_MSG_TYPE_SEC_IND: { struct ath10k *ar = htt->ar; diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index a3d69f852e38..82d01139ff92 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -409,6 +409,9 @@ int ath10k_htt_tx_start(struct ath10k_htt *htt) if (htt->tx_mem_allocated) return 0; + if (ar->is_high_latency) + return 0; + ret = ath10k_htt_tx_alloc_buf(htt); if (ret) goto free_idr_pending_tx; @@ -445,7 +448,8 @@ void ath10k_htt_tx_destroy(struct ath10k_htt *htt) return; ath10k_htt_tx_free_cont_txbuf(htt); - ath10k_htt_tx_free_txq(htt); + if (!htt->ar->is_high_latency) + ath10k_htt_tx_free_txq(htt); ath10k_htt_tx_free_cont_frag_desc(htt); ath10k_htt_tx_free_txdone_fifo(htt); htt->tx_mem_allocated = false; @@ -935,7 +939,8 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) return 0; err_unmap_msdu: - dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); + if (!ar->is_high_latency) + dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); err_free_txdesc: dev_kfree_skb_any(txdesc); err_free_msdu_id: diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index d4986f626c35..fae143e4dcfa 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -90,11 +90,12 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id); ath10k_htt_tx_dec_pending(htt); - if (htt->num_pending_tx == 0) + if (!ar->is_high_latency && (htt->num_pending_tx == 0)) wake_up(&htt->empty_tx_wq); spin_unlock_bh(&htt->tx_lock); - dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); + if (!ar->is_high_latency) + dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); ath10k_report_offchan_tx(htt->ar, msdu);