From patchwork Sat Sep 30 17:37:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: silexcommon@gmail.com X-Patchwork-Id: 9979571 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 3DA2C6034B for ; Sat, 30 Sep 2017 17:39:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26A1328EF7 for ; Sat, 30 Sep 2017 17:39:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B7A028EFE; Sat, 30 Sep 2017 17:39:28 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 CE80E28EF7 for ; Sat, 30 Sep 2017 17:39:27 +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=qA71MMN5mUMGLCZxRp4SVjuC18ua7bx22RljbAj/wJQ=; b=UOPlT1VENx1wFuPx6FKDUSpDgB jee+larCERh0yzO6Npv+lDfmux2JZa5aUwsL/5jPpRmdXRuUQ0JnfURUpn4Z5zrzEHu6vXy3YULhq z1U5r1wMkmU+T/T/e8pHqI1A+n3zjLh2qkHjlCLI1YtJG7xb/5y/Ke4+9ecAImT/HKtw1z19W8LWm hKZaK3WgeOHUkZTfLGaCkQUpZwqYAGe19pWRCgdlWfd49yLCyCyFj5kvkxOKDu1lR08WfeBKVIHlk rswndMPA9EXUTPBruUJzXFG+Lysa9W/FIi7GigEqEyXOykPrqBk5p/C6XOtJquNNvGLfjghLXrPk7 zyfy+weQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dyLjW-0001tc-9w; Sat, 30 Sep 2017 17:39:22 +0000 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dyLj9-0001Pp-KQ for ath10k@lists.infradead.org; Sat, 30 Sep 2017 17:39:06 +0000 Received: by mail-pg0-x241.google.com with SMTP id u27so1697702pgn.1 for ; Sat, 30 Sep 2017 10:38:39 -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=K44JEEAEPpoSaS/XDbLyMbxJjibqe6wN1yTLhuvDjpI=; b=QUf4KtxkUss6TWQq46Mzu6ANq+sZx7ZjHQVOrUqI9oyhDO0jQVOvG8mNvYVU15mcV1 eFYRztnmXVW/NRa0pYee7ZyHYTmtPP7tRcsIYmjSLDufeZ54Gzy7YQWGLcXMUkr432rM BXKy6nNsS7Ao9nkP7pPkWL+xm7Gf6Fzgopv1xnrG3HM0Lqm6zpLi4DfHa7Znap+Tak1A cAB04u/5PqlNCyrnCPeUP29t/W/oFl/RE0SOxm7J4Y6dV9hEr/uoTkvG+7pYrDoDxp1q ZV23ISdLgdFGG4ApMDSVPjuN4Dg0mMS3SvOuT5XGmBXNKHe5uvgekSXlanyhKpK+WAmB enKg== 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=K44JEEAEPpoSaS/XDbLyMbxJjibqe6wN1yTLhuvDjpI=; b=FuAObs7NN3GOAcTr+olCiKXlNAH1YD8r0j+5UyAI/Tk9ICnO/bBhBwqtsS2yMqu8Bt 8tQ+i36+/AQ87+SURwaO8mlTjdjQA8UMyTwKjDKKvyi/ucGfC+yG3oX+49IZ2+2h2UOg jQrr3zFexpbQ6sfsT2vt3U0x8gWNPTawMGXt7GKhDVqxJ+DXpXvlsiTI5ycaIGIl5Mbk bdnYn6rFziJClI+dtByDUX0ZFIOJmvo3UGGbMFg9aZbdMn//1ohFluMaThJbag8Q4CrQ exML/+cg6Jbc6AVm6E0kjkVrfb1m5UdFSg+skSmjbwE96nXd1AmU6SXKpPf+0iquB2WL lqvA== X-Gm-Message-State: AMCzsaWFOODZOkrCD7cy7qmXKgKPlIrXr6Jf893C0ejzl+g0gN18+yCp d9nKigS+O8sYVVwbNyL2mvqB5DQLFEo= X-Google-Smtp-Source: AOwi7QA0eVNTqwxVS0DKBihdF3d9DO88EA9KEYEoW+wpQMv7LFfUIA3tSTNxoCsnXw5t43Dhg7Ingg== X-Received: by 10.99.127.67 with SMTP id p3mr1723643pgn.321.1506793118712; Sat, 30 Sep 2017 10:38:38 -0700 (PDT) Received: from localhost.localdomain ([171.60.245.167]) by smtp.gmail.com with ESMTPSA id q15sm11197640pgc.64.2017.09.30.10.38.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Sep 2017 10:38:38 -0700 (PDT) From: silexcommon@gmail.com X-Google-Original-From: alagusankar@silex-india.com To: ath10k@lists.infradead.org Subject: [PATCH 06/11] ath10k_sdio: high latency fixes for beacon buffer Date: Sat, 30 Sep 2017 23:07:43 +0530 Message-Id: <1506793068-27445-7-git-send-email-alagusankar@silex-india.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506793068-27445-1-git-send-email-alagusankar@silex-india.com> References: <1506793068-27445-1-git-send-email-alagusankar@silex-india.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170930_103900_401035_34C2D23D X-CRM114-Status: GOOD ( 11.31 ) 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 , linux-wireless@vger.kernel.org MIME-Version: 1.0 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 f374d1b..c48785b 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -944,8 +944,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->is_high_latency) + kfree(arvif->beacon_buf); + else + dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, + arvif->beacon_buf, + arvif->beacon_paddr); arvif->beacon_buf = NULL; } } @@ -5052,10 +5056,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_zalloc_coherent(ar->dev, - IEEE80211_MAX_FRAME_LEN, - &arvif->beacon_paddr, - GFP_ATOMIC); + if (ar->is_high_latency) { + arvif->beacon_buf = kmalloc(IEEE80211_MAX_FRAME_LEN, + GFP_KERNEL); + arvif->beacon_paddr = (dma_addr_t)arvif->beacon_buf; + } else { + arvif->beacon_buf = + dma_zalloc_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", @@ -5244,8 +5255,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->is_high_latency) + kfree(arvif->beacon_buf); + else + dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, + arvif->beacon_buf, + arvif->beacon_paddr); arvif->beacon_buf = NULL; }