From patchwork Sat Oct 22 07:22:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7272 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1091965wrr; Sat, 22 Oct 2022 00:52:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6w5Rv93blwTH3qNz+2Oc0GU7dBf916x4UnJM7yqqD4K09vzvMaLUHWnj6byktsxnhFn3xP X-Received: by 2002:a17:90b:1bc3:b0:20d:75b8:ee74 with SMTP id oa3-20020a17090b1bc300b0020d75b8ee74mr64107409pjb.1.1666425148930; Sat, 22 Oct 2022 00:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425148; cv=none; d=google.com; s=arc-20160816; b=Ke/BCQKe/9ldJg2uu5LB/7D1Gq4+2cDTZGJ6awhOrnT4uY6OwMxePyeOkaYFjq+4rE UJaRfCtRr0AmLJyz42fX44m6Gs7QDp8lySJQxuNnR0S7kyRItNkQAs/OO6fJWEL4nPvJ Dry5fpsn46IV0oy/I4Mx81P8ZPJoYiXIII8iTupELj/npkhkr49oB6gV/ER92ontyVcp lx2awQ5Uzl5Ec+C7X8xNx4T/LXqyyZLAHCDzvZpFQ8kt6Piql6bJnfmtp3BmX1xCQlB2 JgsketaZN4SKjOGqik8nbHT731muocpLXIy3z54Am8699mn+PTciQs2PKAi8wcgGQBcy UYdw== 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=GocChEVnz4V5UncG5GRHBvGX0cot1JnGv6Ti6OwBkhk=; b=lyRrg9Of9QEKc4v7cLYJq0qSkYL2RDGyHigeIwjAPHoT0nZEMl1MWF0k0hfUScI8tZ YWydn3c5c3ZS8WjP838AVVCQ92ex/fzgvbXch88r4t0K38ZzQqnakwAzorNyACPUidig KT7raUYviSntVaHrwD7WVRzmt+7Kf/4Am1BQ+SstjTvhVXQPQy3TOigYqncw1Z1DiSZQ wTUlas6sRZhsZqXMzcX8uL8OEvgcWuX15NrPrmYViinyoVlTeZpGvcAzqI/KM1mSMk95 KK7jw5ofX8k4598WbDwEt6V85JiXXCMnyIgxCjPJ1ZTyhSfjMpC6ruNcXHmlapJjt92C XLhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0XKvmnBn; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a170903230900b0018532e03614si31595689plh.470.2022.10.22.00.52.16; Sat, 22 Oct 2022 00:52:28 -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=0XKvmnBn; 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 S231341AbiJVHvy (ORCPT + 99 others); Sat, 22 Oct 2022 03:51:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231883AbiJVHte (ORCPT ); Sat, 22 Oct 2022 03:49:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0967F2AA152; Sat, 22 Oct 2022 00:46:02 -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 31373B82E1A; Sat, 22 Oct 2022 07:44:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82001C433C1; Sat, 22 Oct 2022 07:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424697; bh=ox7vi4Bv2Sh7+GvuZXncrkO2Hs5AcUsm0cIlGIXr+08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0XKvmnBnsK62BAdZDyogDNXH7NkYbWSaZd8vdGMoI2sgjXZOHV43trz4sAbWQqczK v3Y/TsZgSY8DUMo/GZtnJYmybIBBNwntxanjXnOIB3CP+nkD4DzuJFFFu+1myvFqBx ED+W7PtYRQayLWkqjnei+O4Om2rc0WDHy5D9F/xE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Felix Fietkau , Sasha Levin Subject: [PATCH 5.19 243/717] wifi: mt76: mt7615: add mt7615_mutex_acquire/release in mt7615_sta_set_decap_offload Date: Sat, 22 Oct 2022 09:22:02 +0200 Message-Id: <20221022072457.940959451@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747373416563429590?= X-GMAIL-MSGID: =?utf-8?q?1747373416563429590?= From: Lorenzo Bianconi [ Upstream commit 765c69d477a44c088e5d19e7758dfa4db418e3ba ] Similar to mt7921 driver, introduce mt7615_mutex_acquire/release in mt7615_sta_set_decap_offload in order to avoid sending mcu commands while the device is in low-power state. Fixes: d4b98c63d7a77 ("mt76: mt7615: add support for rx decapsulation offload") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index d722c3c177be..4a1e6b92ff73 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -1194,12 +1194,16 @@ static void mt7615_sta_set_decap_offload(struct ieee80211_hw *hw, struct mt7615_dev *dev = mt7615_hw_dev(hw); struct mt7615_sta *msta = (struct mt7615_sta *)sta->drv_priv; + mt7615_mutex_acquire(dev); + if (enabled) set_bit(MT_WCID_FLAG_HDR_TRANS, &msta->wcid.flags); else clear_bit(MT_WCID_FLAG_HDR_TRANS, &msta->wcid.flags); mt7615_mcu_set_sta_decap_offload(dev, vif, sta); + + mt7615_mutex_release(dev); } #ifdef CONFIG_PM