From patchwork Thu Jul 30 09:21:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 11692581 X-Patchwork-Delegate: nbd@nbd.name Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08FAB913 for ; Thu, 30 Jul 2020 09:22:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E41C02082E for ; Thu, 30 Jul 2020 09:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596100924; bh=55XcxLcaDho/KKLvUQoIoA7Rg6QuMGBPIaPyfLVN4/8=; h=From:To:Cc:Subject:Date:List-ID:From; b=wMJ1gJa+ee4ndvA7zihU9fLPLWaM4abjqxHkcAo1Wdge02EGaI6zJDmZbTysSQQpo 6nFcVRvTrHRTNZekZXAMraNlETMUx2LTEOM5QWGiV2IzDpTKAWptMaNM29gVFlMW15 VINMPEJPgy6ezuO9FChS+bCLLbYDoSH7rG2mcMFA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729363AbgG3JWE (ORCPT ); Thu, 30 Jul 2020 05:22:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:45194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726819AbgG3JWC (ORCPT ); Thu, 30 Jul 2020 05:22:02 -0400 Received: from lore-desk.redhat.com (unknown [151.48.137.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3DB0720809; Thu, 30 Jul 2020 09:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596100922; bh=55XcxLcaDho/KKLvUQoIoA7Rg6QuMGBPIaPyfLVN4/8=; h=From:To:Cc:Subject:Date:From; b=FR1QcrC8nsMYaN0rQFnkGqkpN4CZEbkry3h2D5mYSY3hk8C3DlvZKF/oPM/619pBs PjdSkfavAQnBnb/PkhhS4Uoraxw5y6lNVwW0lRsWrM2hp3576FJzGqVNMOEIvzi1i1 pgYcQKeL4sqlrH757FfWmnvkydxTcZ6lr0NCkNBA= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, linux-wireless@vger.kernel.org Subject: [PATCH] mt76: mt7615: hold mt76 lock queueing wd in mt7615_queue_key_update Date: Thu, 30 Jul 2020 11:21:31 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org wq queue is always updated holding mt76 spinlock. Grab mt76 lock in mt7615_queue_key_update() before putting a new element at the end of the queue. Fixes: eb99cc95c3b65 ("mt76: mt7615: introduce mt7663u support") Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 2d0b1f49fdbc..bafe2bdeb5eb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -361,7 +361,10 @@ mt7615_queue_key_update(struct mt7615_dev *dev, enum set_key_cmd cmd, wd->key.keylen = key->keylen; wd->key.cmd = cmd; + spin_lock_bh(&dev->mt76.lock); list_add_tail(&wd->node, &dev->wd_head); + spin_unlock_bh(&dev->mt76.lock); + queue_work(dev->mt76.wq, &dev->wtbl_work); return 0;