From patchwork Sat Oct 22 07:22:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7617 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106812wrr; Sat, 22 Oct 2022 01:39:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mPsnBRrbBILSyUZV/UunwAv+d41ACsWjyNlLOS3czagEiWL0PlC/D/n9+tvYFRiawUsNh X-Received: by 2002:a05:6402:3887:b0:458:289e:c9cc with SMTP id fd7-20020a056402388700b00458289ec9ccmr21247086edb.101.1666427945773; Sat, 22 Oct 2022 01:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427945; cv=none; d=google.com; s=arc-20160816; b=Orgz1jEagwu83t32Ll4v8MPCHzjBdxKZNdVRHiWBCDdhxE7p4KIUSCEIi79UsRiyOI k/USQA0QsIYM/lkfdCsh4piDk7gnmxhwMcNSJ6DHXB3q6bcIriiBrXy16jgcNBhpL+6A H4eJWUMYJEn9DINmp+Rdn0bobE/wqOl9WkI9Z8WcH55F47uZS0pPx+GrkzBmsu2SH9GB Gr/qy7NPfxOxVcQ+gCyGllfjSUe2QAhrpqYkcJZXmkth34FlkG9/Ge7YXA7C2jWjFGtf K95C+/qjvMw7BuWYzMYIi7LlWV8RWSgO+B08lqcv+RPI6akN+knfJWI/LwWthxU2oz4d OOGQ== 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=4D+wIugDQqH4Y4vcAY9aOYu4eey76nTLOUEdS51Jsr0=; b=OvvptHs+M10xeLfzWaHxTyMzViepIWl/FQ/eC8RPgfX0g86dNyvonMj0eQpwasOtyf u83kJmzjZ8mn8old5XI2EElAIQLU/6KhpGB4Kv/5Ee9As0c0CS1tSo9bQr8FjrDLwiw1 X3Y1xWuFAdEF4UIgM2p/GD+Kw3spVFz8UEoXeyNSD1Y0yBGnl+F3I3jrAga2xWN/9Nxs lYGP7Nixdr4fZDiykToRTePYIZT1TEDlSDzNQi8BfxYIIr1DlliJjVxKK7V27fv5si9U quyYfPzIYhrfIiywiX7fbbH+zB09ll3umQ0Z9sWFpvYJSUDJU3jZqm0+KgkD24/UTTeX Z/hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NYy2RHtP; 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 cs17-20020a170906dc9100b007848e6eaef1si17289158ejc.733.2022.10.22.01.38.40; Sat, 22 Oct 2022 01:39:05 -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=NYy2RHtP; 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 S234311AbiJVIhO (ORCPT + 99 others); Sat, 22 Oct 2022 04:37:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbiJVIb0 (ORCPT ); Sat, 22 Oct 2022 04:31:26 -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 A232F2E5E03; Sat, 22 Oct 2022 01:03:13 -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 EA649B82E1B; Sat, 22 Oct 2022 07:44:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46A45C433D7; Sat, 22 Oct 2022 07:44:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424692; bh=D8oIh+1zXiFFvPpS+HgYcc84mQJZmkJPdY0WfYVOJTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NYy2RHtPQC+xoeIzgSdhrNONTfTAOlrrLige04YJRWst4pOmnZESgmpYc1bfcHzgX Fwpou9YRKsBrTd+w+uwm6gudJhNJYAQCCgkTF5jISw4ki3tzkPwk67v6LCd3KWACfH f1xwRn+xp5ayhMJN3BzO9wPrmuqlY6nQqNJt4s4I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Wang , Felix Fietkau , Sasha Levin Subject: [PATCH 5.19 241/717] wifi: mt76: sdio: poll sta stat when device transmits data Date: Sat, 22 Oct 2022 09:22:00 +0200 Message-Id: <20221022072457.603810048@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?1747376349682943569?= X-GMAIL-MSGID: =?utf-8?q?1747376349682943569?= From: Sean Wang [ Upstream commit a323e5f041dd11af5e3de19ed7ea95a97d588c11 ] It is not meaningful to poll sta stat when there is no data traffic. So polling sta stat when the device has transmitted data instead to save CPU power. That implies that it is unallowed the stat_work to work while MCU is being initialized in the really early stage to fix the possible time to time MCU initialization failure. Fixes: d39b52e31aa6 ("mt76: introduce mt76_sdio module") Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/sdio.c b/drivers/net/wireless/mediatek/mt76/sdio.c index 574687ca93a9..fa54ee112b0b 100644 --- a/drivers/net/wireless/mediatek/mt76/sdio.c +++ b/drivers/net/wireless/mediatek/mt76/sdio.c @@ -480,7 +480,7 @@ static void mt76s_status_worker(struct mt76_worker *w) if (ndata_frames > 0) resched = true; - if (dev->drv->tx_status_data && + if (dev->drv->tx_status_data && ndata_frames > 0 && !test_and_set_bit(MT76_READING_STATS, &dev->phy.state) && !test_bit(MT76_STATE_SUSPEND, &dev->phy.state)) ieee80211_queue_work(dev->hw, &dev->sdio.stat_work);