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: 132905 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp580945ljb; Fri, 6 Apr 2018 03:11:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx49493Et4+BibLbIrGlLdbc1KyW8jCTI3MxXgF5ozGO205YRDSYTpgqfhbd0JJJmnkauqXPZ X-Received: by 2002:a17:902:8c8c:: with SMTP id t12-v6mr26685966plo.100.1523009494836; Fri, 06 Apr 2018 03:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523009494; cv=none; d=google.com; s=arc-20160816; b=bhjv3jXeUhAnfsYqBvX4qLKcIOuaJ2MW2u7DazKuUVysBLTh0Nk7HbzhBflCgy2Ed0 0XDyGv5yOAm1uLKRr5jVCQMz7mwTuKo9KAqSgCDnSCfMt69SWA5mavonY7dgwwrOGXg9 wSdkfs4t9zLj/bFmYA9/wJaMQzjXsbvSAI390qsVq3G6IU11HnnamzHKRdy8EbE4SOzG /cyq+2QNPRxENjJAW2qJNPCsdCPiP1bJgn/sncMM2AgPypYEq+FBnR+vWW0WiLAhN9k9 OGlEDZdpFkSR7XyHP40vMhZUmOIJaYEtKtu/LkAHhOlBaeLDwco9Ws7crht+r5xYGy9c Jy/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=/p/IEDI+kfBOD7YFqeSUTIzGUx+kKIvD7hM6lDFC72Y=; b=XKYcmACVRoIexStoAG/mhsw30erQgnzXiRaZmZ9QyLbSasQ3rQgiYyqY7lYRLNV4// O5IzsGMbFQMPxdEF+O5LLGuugi3yiI9bYjx0C2CMlwqu1ECX0wWZDp0En5PLcbzwZDiY VZt832f32bwvunP/nJosOBxQItNjnhTi0sgKNn4WuZvTypVTGVEz+Ok9j6w7PgLkf4u8 43zPaipvYkmiwS5OjG4g/zpmY+Bz49V1qC3V0ALfh+mSxFfWKGxWJCst2y8Im7WxKNw6 ah0HW8D4xj0CqBpaN0Y7MdzybuBGaZg+pfS1mP3mXd4Adkc7dpHnoz0+EsmQs/1CS9Td +OmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NGlcr49H; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l75si7772655pfj.375.2018.04.06.03.11.34; Fri, 06 Apr 2018 03:11:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NGlcr49H; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751461AbeDFKLd (ORCPT + 11 others); Fri, 6 Apr 2018 06:11:33 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:38056 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbeDFKLc (ORCPT ); Fri, 6 Apr 2018 06:11:32 -0400 Received: by mail-wm0-f65.google.com with SMTP id i3so2245901wmf.3 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=JEdouV07iQxsNjvC16mV4lh2lzuVP63qDGalbZfkiyhdEQXbOyqeZwnbRkui6xvGTb CC8ICUKNotmTqoDwJR21uko7AetHpn2Md1+M8VwsVUSNFFpwTob6JXwjxkTmVNYHGqYW RPKulggV30c3gAt0QlwV8pve2YeY7LDCqkVhBsoPvNnphvrjefuOoE6Jh8o7hBR8xS8i tECkFRtwPauNDE+NxHVrATVSnqHavx82UXZsAn12GDKpuonAUrYbX0Tj3AnP4zAPlWp6 QyrE6g+phM+3+tey8vW8FInhx5Ju/VJ8vdZFc+O6iZQXDSzvQ1CfIHGwtPd2SJkgJ7ne tQMA== X-Gm-Message-State: ALQs6tD9pYJDq7zQwnESwpnTj+JrBwUD9g5+ACmOJ6Gf7oRlgS5kHIDC F7YSL5yDD7mNXJ1RVl9uxqwQiQ== 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; };