Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp875788rwi; Wed, 19 Oct 2022 04:11:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62/IoC2Ym7DuYibrtHLDJMUqQfi3s/oKfdc/V2m0QyAEBpLrbW8zidwsR5FV52/GEmH/f1 X-Received: by 2002:a63:1301:0:b0:457:f3b7:238b with SMTP id i1-20020a631301000000b00457f3b7238bmr6741465pgl.262.1666177897505; Wed, 19 Oct 2022 04:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666177897; cv=none; d=google.com; s=arc-20160816; b=k3eXYFsi7sj6P6Jrler9qZqPzpAjvPbc6ansdpch8zrDG4jKTzHT22DBBE6/3ZQWbq pO/iPAagGwIw9/BHZjjv5+uX2gVyQDwbRUG67+P4q28vb0yZjVf7mFwlQl8RhSOk2ESj YOQGx+Gxrl0hcRjOY5N2Sb8V0PclEHHKAFrtfqBoWQZXI2ynd5b5jrHbb5NWS8IZGytl 8yH25QleMNQqCbo9xdEv9G/qXr29QU611NaEkWmJp5bo8tiasTTvMDnyf3tLwuPsZ7z4 GPMI3j8K6nQG6LC46N6AsCPd6tuUKlnFR21/ZoABi0U1+1E1LtAht7pHAqZNteiRm0+X tYzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TxSQPc1PiCdqnAqxm87TMyulJScA6bOqZUXMDOhmHeI=; b=TtakjzqL7436Sxfx3nr6KyybztdZZ6N3dNlL66ayD9qNm4F0h709wn1GlI4kNRb1aZ fyk96Egf2dmWKBXSmLSXW/feYF1SuLSZr9bWEnt5kNaQfJ0NXVyNuelk8GFvDepKu9jQ yS1w1zkwzM7I8gVFmCKvgPdcRro8XKWU4wZErua3xgFN3hzx1H8d2u3UidLeS9G9N0O5 7Pc33MDSMAks2tgFjBDzohL2XgvovPsO5Cg73YpsIX96DAoi8Knjt30789IcxJHAUV08 LxC2yHAzelAvEFh/Gp3FZEOCuK0on8fHv6/A01QDle05ZkKYFIDmfJX5JzcneraX8mH4 soqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FwHvII86; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020aa78b03000000b00563798cf40dsi15380162pfd.224.2022.10.19.04.11.22; Wed, 19 Oct 2022 04:11:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FwHvII86; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232035AbiJSKj7 (ORCPT + 99 others); Wed, 19 Oct 2022 06:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232297AbiJSKjH (ORCPT ); Wed, 19 Oct 2022 06:39:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1ECE15626B; Wed, 19 Oct 2022 03:18:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4A4DFB822D8; Wed, 19 Oct 2022 08:51:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6E80C433C1; Wed, 19 Oct 2022 08:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169467; bh=mq8aG3PtaIpytEmkRarYYnE2UdSfF3zSy5rZl30dsz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FwHvII86Pg6LdAFn/a6yjs+dgURQ5+7duyhvgHtzqtKxDnhMcTjPYBrPmWpDWsouG hb9sH+sXSKeHwe4G5vX2+a8Ex102p6eR7voyjYi6SPBA0SplU1m6oTa+Cvt3VjvoYA s9jHc0dCGNjf8nW8RJvAD25tDovrhmY7gdU/LmUQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, AngeloGioacchino Del Regno , Lorenzo Bianconi , Sean Wang , Felix Fietkau , Sasha Levin Subject: [PATCH 6.0 287/862] wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_sta_set_decap_offload Date: Wed, 19 Oct 2022 10:26:14 +0200 Message-Id: <20221019083302.689314366@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang [ Upstream commit 59c20b91786d5f140ee7be2f24c242b5f8986046 ] Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race with the context holding dev->muxtex and the driver might access the device in low power state. Fixes: 24299fc869f7 ("mt76: mt7921: enable rx header traslation offload") Tested-by: AngeloGioacchino Del Regno Acked-by: Lorenzo Bianconi Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index 63fd33dcd3af..7214735011d0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -1404,6 +1404,8 @@ static void mt7921_sta_set_decap_offload(struct ieee80211_hw *hw, struct mt7921_sta *msta = (struct mt7921_sta *)sta->drv_priv; struct mt7921_dev *dev = mt7921_hw_dev(hw); + mt7921_mutex_acquire(dev); + if (enabled) set_bit(MT_WCID_FLAG_HDR_TRANS, &msta->wcid.flags); else @@ -1411,6 +1413,8 @@ static void mt7921_sta_set_decap_offload(struct ieee80211_hw *hw, mt76_connac_mcu_sta_update_hdr_trans(&dev->mt76, vif, &msta->wcid, MCU_UNI_CMD(STA_REC_UPDATE)); + + mt7921_mutex_release(dev); } #if IS_ENABLED(CONFIG_IPV6) -- 2.35.1