From patchwork Sun Jun 3 18:20:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10445509 X-Patchwork-Delegate: kvalo@adurom.com 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 62CE1603D7 for ; Sun, 3 Jun 2018 18:22:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52E4228A4D for ; Sun, 3 Jun 2018 18:22:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47C7428B1C; Sun, 3 Jun 2018 18:22:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D72E628B18 for ; Sun, 3 Jun 2018 18:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751301AbeFCSWR (ORCPT ); Sun, 3 Jun 2018 14:22:17 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:37985 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbeFCSWP (ORCPT ); Sun, 3 Jun 2018 14:22:15 -0400 Received: by mail-lf0-f68.google.com with SMTP id i83-v6so9617548lfh.5 for ; Sun, 03 Jun 2018 11:22:14 -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=HU16cVfpOWz92WIzSG5Q4hHDUrfdjEyzYqANN7ifOwg=; b=Ts4h3gU/XeBVOON55ZwQmxtDsYNDENluFx3kLjc22XZYJgGZ40KZUvWvWUet50fsnO EkPo4eBxI9/BRKihYUDWyEC+u3WXM3rIrNYnwtSc0LCdX8NoQH06M5fU8ivg3glEK8Pt NzULbf7kcDyVGVx/5wr5bdsfVACBp/PnYTU/dcuxpHYXOHc3zKETZLGK8KK0kwffGabb PFdZyR1Xh4ykkagIU9rPe78Mv8TRwu4IbT0rU7tr7VV/urgaskzuclOoy0z/f67AH5f6 /1RT0Yyf6F7spMHc9kDgOX8kvFIY8t58E7PsgWOaT7cchjg0SUIhWbq4GDmhPsApt7TZ LEjw== 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=HU16cVfpOWz92WIzSG5Q4hHDUrfdjEyzYqANN7ifOwg=; b=eWjkFSVNcn8/vT7NnDxDEmC3yfcY+IrsOInrTZXYxCxQeO5MqBLwURl//lyrVeY4K2 x9u0k24MVgJZO3dllGJQq8uKWE25mRjPU6dpZElN+Cotofo4p3rmVe42f2Uxa34FEEGp pp3eiI/lHHy2aF7IX7DokljAlftfCHQ2MXKYm3vUfQfqRpAQuRcCFArvoC9zU3PxyEV2 eB27c3hr+DCKEP/bkr32Su9KonrnLbCqFYjtycnmX00HHOxi2nLdzLFdAirRm/0tFrmc Ad89L9F7q5eZmJbO8Igvp7nIN7QX9jsrO/SC82kV/f2niDjbpDH7vJplVXnupgCttjGF GvAQ== X-Gm-Message-State: APt69E3nA077lwMC3dteaPuww7VkFzN8ZT+spqhr5JJ8bkJUzY2S9kJ+ otrAPBGuFxjttTci1kcVo/M= X-Google-Smtp-Source: ADUXVKK8wy2W0F6h8F2H4HerY3kL0+QzUSWCya+8fbbFUElz2qX/ovEePRK/rBYTmA7lHZoWbfZNhw== X-Received: by 2002:a2e:8455:: with SMTP id u21-v6mr1547290ljh.66.1528050134004; Sun, 03 Jun 2018 11:22:14 -0700 (PDT) Received: from localhost.localdomain (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id l200-v6sm4980562lfe.77.2018.06.03.11.22.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Jun 2018 11:22:13 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Cc: Erik Stromdahl Subject: [RFC v5 06/12] ath10k: DMA related fixes for high latency devices Date: Sun, 3 Jun 2018 20:20:23 +0200 Message-Id: <20180603182029.8914-7-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180603182029.8914-1-erik.stromdahl@gmail.com> References: <20180603182029.8914-1-erik.stromdahl@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/htc.c | 19 ++++++++++++------- drivers/net/wireless/ath/ath10k/htt_tx.c | 3 ++- drivers/net/wireless/ath/ath10k/txrx.c | 3 ++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index 8902720b4e49..b47e0547f767 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->dev_type != ATH10K_DEV_TYPE_HL) + 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->dev_type != ATH10K_DEV_TYPE_HL) { + 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->dev_type != ATH10K_DEV_TYPE_HL) + 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_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 5d8b97a0ccaa..79a8eca46e88 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -1125,7 +1125,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->dev_type != ATH10K_DEV_TYPE_HL) + 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 cda164f6e9f6..23606b6972d0 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -95,7 +95,8 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, 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->dev_type != ATH10K_DEV_TYPE_HL) + dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); ath10k_report_offchan_tx(htt->ar, msdu);