From patchwork Fri Apr 6 10:11:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10325829 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.web.codeaurora.org (Postfix) with ESMTP id 7EA8860541 for ; Fri, 6 Apr 2018 10:11:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FE94294CA for ; Fri, 6 Apr 2018 10:11:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6426B294C7; Fri, 6 Apr 2018 10:11:35 +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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 ED6CA2949F for ; Fri, 6 Apr 2018 10:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751570AbeDFKLe (ORCPT ); Fri, 6 Apr 2018 06:11:34 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:39822 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbeDFKLc (ORCPT ); Fri, 6 Apr 2018 06:11:32 -0400 Received: by mail-wm0-f67.google.com with SMTP id f125so2240284wme.4 for ; Fri, 06 Apr 2018 03:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=sTWSnvN5DzBCfnJ/zWbC7/74SCvAEG401ySTvXGmnfw=; b=NGlcr49HD1NoVdtsJCI8oE7l7rB+HYJyWRbWAbOeEpnyGPg5duZEBQG2HBEm/ztUYo c1s4qIUMLmYGtcXPaizOZ342Mr6rgT8PAyTm2Z8xjPJISif4NzLoASfxX7eskAgxUba4 PYI0JeGfz0QCUBDXrAS9IDEtWac1+oGorwXR0= 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; bh=sTWSnvN5DzBCfnJ/zWbC7/74SCvAEG401ySTvXGmnfw=; b=pkJireNnjzWnF0vDQ+5dOROgp3qfoEnHqDtaF6oQuhiFLMaxQ6RALE7dqJllj0u4FR FuvaZkFF0gxucMWqUyUEFz/tm9af4yUHxPM49cjQE15mAE9mBYu1tmp9hlrPU3p85VAf cMZzAx9BaDiQqUG05M/bHm9gYSTajHkcaoxYPEwXR6faJxowGdsoF/kBIVVWb28AAykt w9f2gqDfokp9IbwGn0bGqPxdgkzf//E0+p8pQ88eRzYvFnSHufHKWPoK1qHv0i0HvzC/ E1QVVvbHN7fJCMIyIbEpIcPP9Id14bWKEK9dVtqpPcZilsBbdTIeQhQ7MZl+1gcGExCq WQgA== X-Gm-Message-State: ALQs6tDaLm4LA+xZnGOEJArjNYgU7jZbNTRKCistBp0AWw93eV5M0r2S OV9Udi0jjGOonseQIgtQVtetUQ== X-Google-Smtp-Source: AIpwx4+RgcEdbRGwMAkMhkaYHdnJB9xhldlvcWbibC4AC1znLAQ3X5hxzuTfLywvsUBvz2nJKnwtmw== X-Received: by 10.28.26.73 with SMTP id a70mr12079865wma.30.1523009491378; Fri, 06 Apr 2018 03:11:31 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home ([2a01:cb19:8349:a800:9c6b:8bb7:fe7e:2911]) by smtp.gmail.com with ESMTPSA id r196sm6782649wmf.9.2018.04.06.03.11.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Apr 2018 03:11:30 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH] wcn36xx: Remove useless skb spinlock Date: Fri, 6 Apr 2018 12:11:28 +0200 Message-Id: <1523009488-15772-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 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 Each DXE control block is associated to a specific channel. The channel lock is always taken before accessing a control block. There is no need to have an extra (useless) spinlock for the control block skb. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/dxe.c | 8 +------- drivers/net/wireless/ath/wcn36xx/dxe.h | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index 2c3b899..4bb9630 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -78,7 +78,6 @@ static int wcn36xx_dxe_allocate_ctl_block(struct wcn36xx_dxe_ch *ch) if (!cur_ctl) goto out_fail; - spin_lock_init(&cur_ctl->skb_lock); cur_ctl->ctl_blk_order = i; if (i == 0) { ch->head_blk_ctl = cur_ctl; @@ -377,12 +376,11 @@ static void reap_tx_dxes(struct wcn36xx *wcn, struct wcn36xx_dxe_ch *ch) /* Keep frame until TX status comes */ ieee80211_free_txskb(wcn->hw, ctl->skb); } - spin_lock(&ctl->skb_lock); + if (wcn->queues_stopped) { wcn->queues_stopped = false; ieee80211_wake_queues(wcn->hw); } - spin_unlock(&ctl->skb_lock); ctl->skb = NULL; } @@ -654,8 +652,6 @@ int wcn36xx_dxe_tx_frame(struct wcn36xx *wcn, spin_lock_irqsave(&ch->lock, flags); ctl = ch->head_blk_ctl; - spin_lock(&ctl->next->skb_lock); - /* * If skb is not null that means that we reached the tail of the ring * hence ring is full. Stop queues to let mac80211 back off until ring @@ -664,11 +660,9 @@ int wcn36xx_dxe_tx_frame(struct wcn36xx *wcn, if (NULL != ctl->next->skb) { ieee80211_stop_queues(wcn->hw); wcn->queues_stopped = true; - spin_unlock(&ctl->next->skb_lock); spin_unlock_irqrestore(&ch->lock, flags); return -EBUSY; } - spin_unlock(&ctl->next->skb_lock); ctl->skb = NULL; desc = ctl->desc; diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.h b/drivers/net/wireless/ath/wcn36xx/dxe.h index ce58096..31b81b7 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.h +++ b/drivers/net/wireless/ath/wcn36xx/dxe.h @@ -422,7 +422,6 @@ struct wcn36xx_dxe_ctl { unsigned int desc_phy_addr; int ctl_blk_order; struct sk_buff *skb; - spinlock_t skb_lock; void *bd_cpu_addr; dma_addr_t bd_phy_addr; };