From patchwork Tue Apr 9 19:08:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10891951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D3C4922 for ; Tue, 9 Apr 2019 19:13:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4460E2880D for ; Tue, 9 Apr 2019 19:13:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 389BA28938; Tue, 9 Apr 2019 19:13:19 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 E67E92880D for ; Tue, 9 Apr 2019 19:13:18 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=z3+Kxr9H35FqeD6AEyw90PE9TR+YpLs4npkyVehduR0=; b=KWfhjSAJDOXX1X zLAeizNZSnyUAUeJdPfJc16GuRroebqm2chwfXxWhgDoPkMAKiOOAok8VG83h27v6Wu3t8FYLllfA EzwITwnFLwbacb7NH+MCYdKCCOstIS/X3xsDb1/lTeETCJOSFHE7jxFLjwIoF2aVNRnalmX7MjZs7 J3FqJQAgV2jGWrjg/cr3xTdiOG8C/yh0j828spyi9Hs9x6LANqAOG1fPzHQsIoWfbC9az4n0LU+85 hntHmvYKjwf/aVyK760BYDYl5NRacSHXeWjONaSE5lt4REEEyhW6h3cINR64dJ8cgpujKkdOVGfzW 9oDN0f1cqAuw5VXKLggg==; 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 1hDwBI-0001r8-Lb; Tue, 09 Apr 2019 19:13:16 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDwBC-0001ks-Vu for ath10k@lists.infradead.org; Tue, 09 Apr 2019 19:13:12 +0000 Received: by mail-lf1-x142.google.com with SMTP id u17so3900665lfi.3 for ; Tue, 09 Apr 2019 12:13:10 -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 :mime-version:content-transfer-encoding; bh=JTmqFgNzwEMzX2/VlhCrZe+jbyHjEvWhfr0MDtw6xTw=; b=pC1ZcmoTKR3Ap0XaWQQc4TYYu/EHakvd5TXVBzTZqL98eum0L5KOGxZFwvkhHQDbkL UQXlme+c9QhKsEbDUoszUwP55TXZ4UK94uc3VnD92hbND6KxU2zkUPtaT/oX40xmHrAM Nkt20Pno7YKQlnKRzd5nxGKyhWOpAOsYNB/FVnD5ZeTJ4XMBm2DZROA69JWRfSJtvukE TRfS7l3m0cI7ARtIwvAoNKbhze7qAkkColOQOr0DgXPXB+tVFWK8etj5gSqYuBjZtHgt upAaZhGflDFiVzoPfq9vZ7KpWVRh6nUnQwV0a23WbgecI8Ik3Cczj3G9FO5teFH6ttww mp3Q== 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:mime-version:content-transfer-encoding; bh=JTmqFgNzwEMzX2/VlhCrZe+jbyHjEvWhfr0MDtw6xTw=; b=K7RlIDEMPBMQ8souGrhjdsvX7/m0xkJQyZUeBUY/+f/4k9tBhGZLDcPfcA35zMGX2r KgqpsvbcgyrsxNkidLLWQgUgmqEjcn0LYampRydWySMdxSr+xkabQW40p7i3GTKcyJPs Q9Sb/Ywno74DDdIQ8tsDTDenVXy8ITRtiH/gg8IsiD6b2IVfaBL4HIlxLJTcnHdTQdHJ p70ejCyF3s3gQ3WCWjaCY8bhdlBjxQUXo7bbJIVxE27ar+vCO2By9zZWPMXr3ze1HPaj aqWU1nJisVeXv/eNgkSUjJxhJnwhhAinvUAmOiJP1X6laumYQL2Zt4WhMjYdcM0feasd wOVQ== X-Gm-Message-State: APjAAAVuhciARHuUisAu1jIdO2+LlElKOF/2BspPl8t25Hbj8rWuRAnf TDPnNS8F4MypIk7Tykgy1vo= X-Google-Smtp-Source: APXvYqwjtw/cM8UKKmcgwTqXVc4IPi2Wtt0XLMfSe6E1k+AFaD6A9De9eWAkEVpY9ZpRqJxJyfmyRQ== X-Received: by 2002:a19:e30a:: with SMTP id a10mr4246969lfh.58.1554837189007; Tue, 09 Apr 2019 12:13:09 -0700 (PDT) Received: from localhost.localdomain (81-233-89-221-no75.tbcn.telia.com. [81.233.89.221]) by smtp.gmail.com with ESMTPSA id q64sm6807848ljq.76.2019.04.09.12.13.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 12:13:08 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [PATCH 2/6] ath10k: high latency fixes for beacon buffer Date: Tue, 9 Apr 2019 21:08:47 +0200 Message-Id: <20190409190851.4557-3-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190409190851.4557-1-erik.stromdahl@gmail.com> References: <20190409190851.4557-1-erik.stromdahl@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190409_121311_051968_4776FADF X-CRM114-Status: GOOD ( 11.84 ) 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: Alagu Sankar Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alagu Sankar Beacon buffer for high latency devices does not use DMA. other similar buffer allocation methods in the driver have already been modified for high latency path. Fix the beacon buffer allocation left out in the earlier high latency changes. Signed-off-by: Alagu Sankar --- drivers/net/wireless/ath/ath10k/mac.c | 31 ++++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index c9e700b844f8..2dd99ce44453 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -953,8 +953,12 @@ static void ath10k_mac_vif_beacon_cleanup(struct ath10k_vif *arvif) ath10k_mac_vif_beacon_free(arvif); if (arvif->beacon_buf) { - dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, - arvif->beacon_buf, arvif->beacon_paddr); + if (ar->dev_type == ATH10K_DEV_TYPE_HL) + kfree(arvif->beacon_buf); + else + dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, + arvif->beacon_buf, + arvif->beacon_paddr); arvif->beacon_buf = NULL; } } @@ -5210,10 +5214,17 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, if (vif->type == NL80211_IFTYPE_ADHOC || vif->type == NL80211_IFTYPE_MESH_POINT || vif->type == NL80211_IFTYPE_AP) { - arvif->beacon_buf = dma_alloc_coherent(ar->dev, - IEEE80211_MAX_FRAME_LEN, - &arvif->beacon_paddr, - GFP_ATOMIC); + if (ar->dev_type == ATH10K_DEV_TYPE_HL) { + arvif->beacon_buf = kmalloc(IEEE80211_MAX_FRAME_LEN, + GFP_KERNEL); + arvif->beacon_paddr = (dma_addr_t)arvif->beacon_buf; + } else { + arvif->beacon_buf = + dma_alloc_coherent(ar->dev, + IEEE80211_MAX_FRAME_LEN, + &arvif->beacon_paddr, + GFP_ATOMIC); + } if (!arvif->beacon_buf) { ret = -ENOMEM; ath10k_warn(ar, "failed to allocate beacon buffer: %d\n", @@ -5424,8 +5435,12 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, err: if (arvif->beacon_buf) { - dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, - arvif->beacon_buf, arvif->beacon_paddr); + if (ar->dev_type == ATH10K_DEV_TYPE_HL) + kfree(arvif->beacon_buf); + else + dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, + arvif->beacon_buf, + arvif->beacon_paddr); arvif->beacon_buf = NULL; }