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: 10445553 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 0420560234 for ; Sun, 3 Jun 2018 18:24:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6102286B3 for ; Sun, 3 Jun 2018 18:24:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D92AA2886D; Sun, 3 Jun 2018 18:24:26 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 75619286B3 for ; Sun, 3 Jun 2018 18:24:26 +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=eyejLHg4Tq0F0bxa82nYFhvbutBPQvRtZHGoCMjpNF4=; b=t3ZqFecic8fE+FcX1Cxf++5PTo aG4Ips6WGJ+qqc/4J0TkV9b75YOA7yQWWMQUQ0eSVdHMuEoVHVvR8jAIsJEUj/AoX2d7SoRfd2pBY g9OpkmUiy7HaNS3rnVQwGT/vwk4obVvR5/idd6AAYCoskuqGBpH1O4ZFGermNjgfqtlWh01A0B2db NBIVDQjuKJ2kEvNwvcvEYS63WYCOvip/BQI//W9evmNKHLRhUcuzbCJHtFtwgnmKv+ghwzTgJp/ZR ALBesmZEzabrp0vJEsjKq9IBJenl701kZOqbXimCdHubUxUomE2/1oX3wUj2CRa4qjeC2hP4JQBZ4 I73USekA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fPXft-0007br-MI; Sun, 03 Jun 2018 18:24:17 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fPXe5-0006Vv-0g for ath10k@lists.infradead.org; Sun, 03 Jun 2018 18:22:45 +0000 Received: by mail-lf0-x244.google.com with SMTP id v135-v6so21788271lfa.9 for ; Sun, 03 Jun 2018 11:22:15 -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=L0dMOZnYvTgI95WHeamPPYIO+W76b3AuNTuZm1dUeCXaPrCIj7Ip8bbIoNaJsORg7l YTpays/NzpisQCfUgxJU1RcDVacJdM61bSE7lnN4F7a+9ohQUR5e7ZlpQ0Szcz2qL4OL it/DUIjQxJ/iSpZTVmzz+TPToZ1VUWgF8a4LETNSg681sSmr9jTQSHChNwdcWj2Dm46c 42FohyolX6LFo9PB/YbaquoPPe2vlcBK8j2jmwpRYefjqT1SBzIkFybJMnv3XNuw9luz N9KB48b3wrjPOqRo+STFhJHBl7998wm1D2t5FKcJhkukdsdsRGG7Dda8NpLD+6oD17mr 74OQ== X-Gm-Message-State: APt69E2A7/QhbjZwpi5H6QYXOhyey9dDmHd9Et3WrwnW8qQSkqGDyhhH Jjxl2Fq0hMWza3SNyfdxNcY= 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180603_112225_104093_E4AB9D68 X-CRM114-Status: GOOD ( 12.95 ) 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. 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);