From patchwork Wed Apr 17 19:15:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10906003 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-2.web.codeaurora.org (Postfix) with ESMTP id DE8DB1515 for ; Wed, 17 Apr 2019 19:15:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8EC528ABE for ; Wed, 17 Apr 2019 19:15:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C754F28B9B; Wed, 17 Apr 2019 19:15:31 +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 6DB8828B9F for ; Wed, 17 Apr 2019 19:15:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733305AbfDQTPa (ORCPT ); Wed, 17 Apr 2019 15:15:30 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:45948 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729291AbfDQTP3 (ORCPT ); Wed, 17 Apr 2019 15:15:29 -0400 Received: by mail-lf1-f67.google.com with SMTP id t11so15226490lfl.12 for ; Wed, 17 Apr 2019 12:15:28 -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=7BeD/gfKhVLmh4MRlzIfvgwYkglG8WzGBT5xlk8Q0iE=; b=MMKpWSzMd/5QaHBHymjxwQRyqZwkWLj2b5L5ebbu5DQAakLuh/X17aZnUYnWNS9Gkm mhBWVCjxaJbLuABVSbgdBH4IP4qv887eln+dfgrYqOspmv723IhGLGkKg2EV2jvSIAk5 3t6umqSBYbvn1GoMLHL5CFVg+VwBmvA7EesuQ2gRIO87VYH6mdJlzhhE830Yjwz0hyrB EWFMCyRHQtwbVQFvsmNePUPyslb4+oXQ+qShmaYMMdJo7hd76dwvzfSO1Ml4cATwtFfu kVtxG9mIymNo0p8m2HXxhLpLSWNSdViYnSpqLEfzlIY4HAmUG7oYxcIhV8eTJq7z2a2H 7wQA== 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=7BeD/gfKhVLmh4MRlzIfvgwYkglG8WzGBT5xlk8Q0iE=; b=lMm6ESI2XYNPsV6JwWhOfR2HfRSUunYnoS2L1+NUlhoqnbNKiQ12pq0cuiqgDzaANW TICVmX6huPzoJT5Y69SbIf8emP5T65aP3I+dk8XXBDZGJJ6AWWgQ5o2cdVMn99A2l4Qs EaAlKX7Jbl0zTkJseegewSHZfKdTZj08rSYkLhLDDoG1OYXMhdGPmw8jk5K8tIxos6hR OGSh19JayXxWLI75pPxiEWeAEwQltFEQF6P8SepjiHSnobRMwkbcanD/Y8fXnIvnXYKy 9aEW8B7fr1OLiyoGRpCJtHQt966CvYGo5w+DQFUFNdbTBFAsVVrmx40ov58E3/gaGwjr Q5pA== X-Gm-Message-State: APjAAAXOp9EE5rnj1dc1pzjF8mq/UZAy3nq/TW0MklBDDrN05iKuaA+n rCMJ7DtXkV2wv7UAUQqqGc4= X-Google-Smtp-Source: APXvYqyRTn83TMjd3XVuq/BUUDjybQ/dya9e/vNRu1Aii7T46weXexVaUjbWunMIiwK0sd2gG9Ce1w== X-Received: by 2002:a19:4b84:: with SMTP id y126mr7512835lfa.15.1555528527757; Wed, 17 Apr 2019 12:15:27 -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 j27sm11387203lfk.97.2019.04.17.12.15.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 12:15:27 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Cc: Alagu Sankar , Erik Stromdahl Subject: [PATCH v2 2/5] ath10k: high latency fixes for beacon buffer Date: Wed, 17 Apr 2019 21:15:00 +0200 Message-Id: <20190417191503.18814-3-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190417191503.18814-1-erik.stromdahl@gmail.com> References: <20190417191503.18814-1-erik.stromdahl@gmail.com> MIME-Version: 1.0 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 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 Signed-off-by: Erik Stromdahl --- 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; }