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: 10906015 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 0019414DB for ; Wed, 17 Apr 2019 19:15:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D746F28A93 for ; Wed, 17 Apr 2019 19:15:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAE3E28A96; Wed, 17 Apr 2019 19:15:45 +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 7987928AF8 for ; Wed, 17 Apr 2019 19:15:45 +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=wU1tyTVFd5iEbLeTOtkX4+hVU9HTGJWuxWRHI6SODMw=; b=UgV6H69wmTWvuU /54ZpNoN0lQ4nYh+A57D06wiBm0+otcoX31k+ucq8aWin2FVOnY/RmufhgIDyrQLZ9b5BqFuDxWXe 2n5etQJnxRHUk53AY/G0kG63LSKSxZE5YCCjgXfdXVzV1zSH2drkJ9k+ZypgRAA3PmIYF+2M2VVmf ZqDJ3GkVHtrAda5+sH4UFfzUvtHnXhmWqKCzX3T0ZJjJmBAK2r9i4AL54klRUYA4CoTEiHFR9rZzl Cp4t61UrmQa/h+W8oONrs1/MxApHDedHVnN5OaQqdEfItECKyPgKKLue+Nv5D/PiNPr6SZnETvbPR KhvtX+M6sAaLRm9IK+sA==; 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 1hGq1u-0007KW-VZ; Wed, 17 Apr 2019 19:15:34 +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 1hGq1p-0007F9-JU for ath10k@lists.infradead.org; Wed, 17 Apr 2019 19:15:30 +0000 Received: by mail-lf1-x142.google.com with SMTP id w23so19690925lfc.9 for ; Wed, 17 Apr 2019 12:15:29 -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=MJfoNMVR6USryZsq2ok7oe5mNkTdr5dhLLSMfA31YYIeRLMpwH7F6/xDc9Yt0TLQhT 6jt54X1t2YLDYexQR4JavdXUJz2MgOWxBi8B9vAnwhRKeqEz8KfboUZDlo9JRpj61PYW oXZ46MXMfcwJ5ZGTn1qTECcLi3GQ5uVjEQtxXWbOaVEhxYR6e6e8hEJeKkwGRNGNLfsQ a1Fa7wEzjd9nGY/3ZyHubl8FvTjdx0YEnBwMhRrAZqulHA5BscEm5P8MC7FdEK6hD8HW caCBTjcFOI9EVFkmgvK68eM4/ZQcQTS58ZTkGGSrgD2d2W0RUaFEFmPG6sGNy8HfRomy MPUQ== X-Gm-Message-State: APjAAAW0vXKa9k1uPCWlKByKLnGVITWPBVCiLBuslvkM5P6j58JHD5RK H6N5ndZsHosH4Lf1v86Q6II= 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190417_121529_658051_7EA4C679 X-CRM114-Status: GOOD ( 11.83 ) 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 , 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 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; }