From patchwork Sat Apr 11 00:19:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jules Irenge X-Patchwork-Id: 216030 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C47DC2D0EC for ; Sat, 11 Apr 2020 00:20:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D81D22145D for ; Sat, 11 Apr 2020 00:20:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WkejCNHL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726767AbgDKAUN (ORCPT ); Fri, 10 Apr 2020 20:20:13 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42366 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbgDKAUK (ORCPT ); Fri, 10 Apr 2020 20:20:10 -0400 Received: by mail-wr1-f65.google.com with SMTP id j2so4044047wrs.9; Fri, 10 Apr 2020 17:20:09 -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=agKMMUEnxz6VY0lkHl06TnhHs+ST6griE6g5IoxABZ4=; b=WkejCNHLvfgBnKU7wOp7VoMf0V8w5oKiBuxl4TSpcyytvmQK+bK5BNCA+grUsP0dol ltA8Uy5e7T4Q6u2wyQ198noHzKzIOKFmW9xkHvik3RppQC3+L6aW5h4qhvFtvrs/gWHz rIQHYyNl7aNzZS+KLFQAuLvT+bLmvYrBYa6ha7LPRA6qTpiIF1X/twDJI2qGFbl+U0cR J78dHZfLU6oedEGbJ7MpGZzTGmSpbkSeeyKhwSaQie6xYg47wJw2h0S/uKEDVG3GVFyM AudpQfbmcExiS/TnHDdlfB4CZ3PpvNMVooDDdrbVcJ/OJbCxpFBKLFrduYa9VHXktRL9 iHgg== 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=agKMMUEnxz6VY0lkHl06TnhHs+ST6griE6g5IoxABZ4=; b=URh/fNKK3MZJjcByp8UfuCZEhTiLEinYhV6/MZfu1aKUoswTh5ijqLFxkGIVXuIaFT Sn7RCgsDOHtIkiFIiI4xlP/mvlcb3jfE/gMCgLUReQMxXUkflGGYIGijy6MOneDwRrYr vqGEhOLrRcYwxcEAg0w8jbZgAsfrupcM84eMxfus9G/LsWySmJ4hlSyYGiUOVl4zQG1K g/VlUKfOvVqAndRviohUlTHUdXsZbxX0s3K771ocOcXw4olCwHq7M1NCEBthAIGRQDke msV2pMHof8dBoaROOYbw4+YQcj3ZRB+kgE+ucVWJFOiJOFA31h/4IDX1524HLnmRBLJ6 /Gbw== X-Gm-Message-State: AGi0PuYTYc1GWKzqoBBx+XEVGJTR4aHoqrUkzPXMJU1M9xQ/J4mvmh7A nLwhmSBsGlbGLwS6AEwGCI7/3DsPoMQ/ X-Google-Smtp-Source: APiQypKtUhTN6JrNR0HHq9eQB8JauCAxv3amDtUoNn0cEwEHclvopkR8/cBSPWuPpv4WmZeuWo4IlQ== X-Received: by 2002:a5d:4a11:: with SMTP id m17mr6816815wrq.125.1586564408662; Fri, 10 Apr 2020 17:20:08 -0700 (PDT) Received: from ninjahost.lan (host-2-102-14-153.as13285.net. [2.102.14.153]) by smtp.gmail.com with ESMTPSA id b191sm5091594wmd.39.2020.04.10.17.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 17:20:08 -0700 (PDT) From: Jules Irenge To: linux-kernel@vger.kernel.org Cc: boqun.feng@gmail.com, Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Roy Luo , Kalle Valo , "David S. Miller" , Matthias Brugger , linux-wireless@vger.kernel.org (open list:MEDIATEK MT76 WIRELESS LAN DRIVER), netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support) Subject: [PATCH 2/9] mt76: remove unnecessary annotations Date: Sat, 11 Apr 2020 01:19:26 +0100 Message-Id: <20200411001933.10072-3-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200411001933.10072-1-jbi.octave@gmail.com> References: <0/9> <20200411001933.10072-1-jbi.octave@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Sparse report warnings at mt76_tx_status_unlock() and mt76_tx_status_lock() warning: context imbalance in mt76_tx_status_lock() - wrong count at exit warning: context imbalance in mt76_tx_status_unlock() - unexpected unlock The root cause is the additional __acquire(&dev->status_list.lock) and __release(&dev->status_list.unlock) called from inside mt76_tx_status_lock() and mt76_tx_status_unlock(). Remove __acquire(&dev->status_list.lock) annotation Remove __releases(&dev->status_list.unlock) Correct &dev->status_list.unlock to &dev->status_list.lock -unlock not defined in the sk_buff_head struct Signed-off-by: Jules Irenge --- drivers/net/wireless/mediatek/mt76/tx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c index 7ee91d946882..7581ba9c2e95 100644 --- a/drivers/net/wireless/mediatek/mt76/tx.c +++ b/drivers/net/wireless/mediatek/mt76/tx.c @@ -101,18 +101,16 @@ mt76_tx_status_lock(struct mt76_dev *dev, struct sk_buff_head *list) { __skb_queue_head_init(list); spin_lock_bh(&dev->status_list.lock); - __acquire(&dev->status_list.lock); } EXPORT_SYMBOL_GPL(mt76_tx_status_lock); void mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list) - __releases(&dev->status_list.unlock) + __releases(&dev->status_list.lock) { struct sk_buff *skb; spin_unlock_bh(&dev->status_list.lock); - __release(&dev->status_list.unlock); while ((skb = __skb_dequeue(list)) != NULL) ieee80211_tx_status(dev->hw, skb); From patchwork Sat Apr 11 00:19:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jules Irenge X-Patchwork-Id: 216031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4F54C2BB85 for ; Sat, 11 Apr 2020 00:20:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B2D72145D for ; Sat, 11 Apr 2020 00:20:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ve00Ui45" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726867AbgDKAUV (ORCPT ); Fri, 10 Apr 2020 20:20:21 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35983 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbgDKAUT (ORCPT ); Fri, 10 Apr 2020 20:20:19 -0400 Received: by mail-wm1-f67.google.com with SMTP id a201so4001464wme.1; Fri, 10 Apr 2020 17:20:18 -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=WqLpUe/3+ebAsfSyEr8eWQGQOEEyLPgemLyG5SvrhHI=; b=ve00Ui45sd+mRIObqi4fVxpgDL1FPby9VCzCj4up6kJluTET85j6C/jkaFTqIiYuT2 1GhQGH7Sx8HCdF86m+cAKpqG94WATIWwwv3oP5hGRWQBpkyyCQxLel51jzVSK6Nd2Zai lxaMJxKAfk7aEH+J5TOxzxVln/e4UL90yec+A7WY7I/6rEvheZU6yvou3zB6uqQmyrZe Zlj5M8US/WwEC2BcQddcpVluxzqwGbCNosji3FGUDXv48GI6Tr/w1FUlo+a/AZOT6kQl EO2vgzMWWDQKe+G9BK1TqgJccORmQo6iJZpkHulI2Mkf2LTPpZQPheRN4exbUQCIM5lc pUmQ== 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=WqLpUe/3+ebAsfSyEr8eWQGQOEEyLPgemLyG5SvrhHI=; b=R8MACe4Zcce+OB2s1WOhn68taUezANBy0QkD5yknRpYWVjr2/VOGnGMtrX7QNnBKim txBHmDMvbB7FfY4u5TiH8dT9ZQpOntVyF+ytFYZHe4/PZFODI0WhCjyaGC2G4hDkrZ5n 286n3mkdGVlYNEb4aPtZlZ9rzcuqoQX6iBhvzfY66+mNC1ogu8/e2mJVAs/Bx7eThAYV D+dubES/InM9SRLgdWS1lEe18GB4RXWEs6Bo/2E+GZ0wFEhaL2g/I9Y1AuYbImoxjFKX c0229AeDSmcvyNgOV2c1J6/3LNnzJrW70sNgZLNvjSi4uE8iAoE4bYeKsvqgx93Gss4X /+UQ== X-Gm-Message-State: AGi0Pubw80t9+Pgzcck6RWFekHOVvfPazUBBV4ZIoUSGTzjWNwUw3YMw ww41YqhkJBjD8qjoN+e5/zzlADmCXJMo X-Google-Smtp-Source: APiQypJTY6BBVpJIbEZoG4XC26odBRDzb6vOdpzxy/8sR/Td9iLmxzbhYDkcX8M+D2UiwGrPh8Pt7A== X-Received: by 2002:a1c:7ed7:: with SMTP id z206mr6958804wmc.64.1586564417420; Fri, 10 Apr 2020 17:20:17 -0700 (PDT) Received: from ninjahost.lan (host-2-102-14-153.as13285.net. [2.102.14.153]) by smtp.gmail.com with ESMTPSA id b191sm5091594wmd.39.2020.04.10.17.20.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 17:20:16 -0700 (PDT) From: Jules Irenge To: linux-kernel@vger.kernel.org Cc: boqun.feng@gmail.com, Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Kalle Valo , "David S. Miller" , Johannes Berg , linux-wireless@vger.kernel.org (open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER), brcm80211-dev-list.pdl@broadcom.com (open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER), brcm80211-dev-list@cypress.com (open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER), netdev@vger.kernel.org (open list:NETWORKING DRIVERS) Subject: [PATCH 5/9] mac80211: Add missing annotation for brcms_down() Date: Sat, 11 Apr 2020 01:19:29 +0100 Message-Id: <20200411001933.10072-6-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200411001933.10072-1-jbi.octave@gmail.com> References: <0/9> <20200411001933.10072-1-jbi.octave@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Sparse reports a warning at brcms_down() warning: context imbalance in brcms_down() - unexpected unlock The root cause is the missing annotation at brcms_down() Add the missing __must_hold(&wl->lock) annotation Signed-off-by: Jules Irenge --- drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c index c3dbeacea6ca..648efcbc819f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c @@ -1431,6 +1431,7 @@ int brcms_up(struct brcms_info *wl) * precondition: perimeter lock has been acquired */ void brcms_down(struct brcms_info *wl) + __must_hold(&wl->lock) { uint callbacks, ret_val = 0;