Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp77496pxb; Wed, 18 Aug 2021 16:27:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5f/d05A7BG6MlaRCbw1Z32DsUuIliig5fACUEqTq5qZti0DoHimyrbL6mbjXmhzyLJJp7 X-Received: by 2002:a5d:9bcf:: with SMTP id d15mr8939332ion.88.1629329253824; Wed, 18 Aug 2021 16:27:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629329253; cv=none; d=google.com; s=arc-20160816; b=VvJwLLLFf9J59c8NSGmkeIzvXWtdqjbjn1Rcc5a9mzbwI4/V8aFDREN1b7/r6St3k7 mPzlWCpm6rRkPRUKgJB7F+bANtIWBxaIIbyT6pvzGs8Vr9JJIVQedyZcxe3+aQeDOAvu sY+36srsi3fdQgjMjF5jEZRq/m3UdY3KBc9g9cHdU4eP6kvh96h4SzwowOYXaNpFS2oC az1P5473F5lY6/dmZ1vMETB1BDDkbaxVd7XHXuXMdmyNh8JvW0myBWMzdZ+2/NWtvX9P PZbawsNX1Vi9RE1TToQ2lkNk3QmpM2ks+9NLxtILuJ2G+Nx/3wIAeUtu8OGy+epPxIpd gM8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=s6e4Ese2VIMrxJ7iyVt3pQ+bRy1WssQdFGiizMnyVWk=; b=aM5s24XHabnMPdppnhbAHRy51Yl4NI2G87zffLpbtwtpL6S+Tu/fHtHmxN6Wd8THf/ B03zbqBXh1s5Udeq3PLiFW9vr1paphOHo6rk3prwF0EieVTLK+wXNNftXB2emxpBjttL WGJMQNAiZiuKmbh8F5HKfqtbsfXXghl2fyz1eCiPWSbveSEUbGfGZOjUfhXAzZOJBRnm kh35g3UsFeW3a73kE/lLXa//DRVDgDj2kR0s3zhngD8S2ix7weVjacBFg3PRlujnlsnJ MGnu6zLQiycTImav6K0Hc8O1wGWULLmLytmXj1Lw65MSbSd6v9Tw119O44S7TFlny6q4 acNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=mwvQKN49; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k39si1337422jav.114.2021.08.18.16.27.14; Wed, 18 Aug 2021 16:27:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=mwvQKN49; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234642AbhHRX1i (ORCPT + 99 others); Wed, 18 Aug 2021 19:27:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232862AbhHRX1h (ORCPT ); Wed, 18 Aug 2021 19:27:37 -0400 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25909C061764 for ; Wed, 18 Aug 2021 16:27:02 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2804:14c:485:504a:609d:5443:34fc:77bc]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: festevam@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 0CFCF80F30; Thu, 19 Aug 2021 01:26:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1629329218; bh=s6e4Ese2VIMrxJ7iyVt3pQ+bRy1WssQdFGiizMnyVWk=; h=From:To:Cc:Subject:Date:From; b=mwvQKN49+SlILw9eldAn08MYYfTq53nQl3gjlkAAMYN9FUKZjnC9argrZkh8PWVTx YNPO5HXYi/UW1CbDRRe8SgiRRxjacfypwvR4RthdJ97IBIP3KQNF/906udRu46nD2q //fzsgtjaC1LGvBWilFGCDfASX7rDVYXb2ix0uV/VcidOWnIYlxhKt/rlaKjmOljNU N/FXU0qPT5hS56SzL63iVdwffzd2seq155kdm+cTK1OKgW67lpPh950+iHtZwJ8Nij s9cJkxNfwqblyEPEuPTRDxgiOAYJvNR2q8YjMcn3inUj7J+E0w1+nRy0FLXpRtHI38 LkcRHYLoLqFbQ== From: Fabio Estevam To: kvalo@codeaurora.org Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, hch@lst.de, erik.stromdahl@gmail.com, peter.oh@eero.com, aspriel@gmail.com, marex@denx.de, alagusankar@silex-india.com, Fabio Estevam Subject: [PATCH v3] ath10k: high latency fixes for beacon buffer Date: Wed, 18 Aug 2021 20:26:27 -0300 Message-Id: <20210818232627.2040121-1-festevam@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 [fabio: adapt it to use ar->bus_param.dev_type ] Signed-off-by: Fabio Estevam --- Changes since v2: - Pick Alagu's patch: https://patchwork.kernel.org/project/ath10k/patch/20190417191503.18814-3-erik.stromdahl@gmail.com/ 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 c272b290fa73..7ca68c81d9b6 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -993,8 +993,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->bus_param.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; } } @@ -5576,10 +5580,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->bus_param.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", @@ -5794,8 +5805,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->bus_param.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; } -- 2.25.1