From patchwork Wed Oct 19 08:26:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp350393wrs; Wed, 19 Oct 2022 07:13:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mAMZ8uP0fWdspTijlcxozAC/xvLe6MAKtYDMPKPY2YVI0QqpkBv3gjE15o4PSea3wLkBu X-Received: by 2002:a17:907:168c:b0:78d:8b6c:a209 with SMTP id hc12-20020a170907168c00b0078d8b6ca209mr7350971ejc.185.1666188814613; Wed, 19 Oct 2022 07:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188814; cv=none; d=google.com; s=arc-20160816; b=PGt2a9IgVh0Gy4qFoUGBZ6Hken9KutyAMlgg4EBqKI+XOfVzDrthn2+OEm0ltIzA/9 JsvzeVLQIjON4mBmNzPS/9liCz0tK1qDG4CEB3YE9JTxEFroSaqd7cFEKtQV3n0gjUkl rYjH+gqTJkSbkZ7inqHMslRlKrhdpohhTgysDTmZPakgLtHnT2uo274ZaX955ao2eeD4 alpKKCkpjEKRAOEGvUHZW67ttPwKRuKJUSg/WVCyuzKcfykiYbXMzxehvI4kfy0t9cd7 PuDl9a2it8AAjeZgcVjRi/W1kG6EaJOcwlwQUFxntA8OD6dSFBQedhxXASzuceidmrVx TYcg== 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=BMK3QLdSE7MdI3peCjttmS41IZPZEYS2eybE2hH8QsE=; b=LGn+9G4TwULwtOmpYezUC/aZvke29xNuyvp1Y/2oXi0ttOXmUWY4lhyNqabF3bAo5J z+hyM6tvQB5QHbYutQlnMO+pnhVabEfHbYHj3V/aPxiudQRB5zYMagrStyhFmG6F4rvS skzlZfAPCOyhUpw0jHKNe6zimvnWne7l+bjLrZmlBoba8h8xoZ3l020e0YiF6kUoTN/V BV6qbQFxhtw6FL2wSXpvprokJEb+bR97IEIzVBlZSIMq6DLKPQDksdx/xRFM/tF0/435 i0vTXg+2nJW8wH3OcWpZ9r3e67AZreKmOOkxDLoRadrsSdqTVthLwou92sEhbcWXw3yo US8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n3pVIZnX; 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 sh40-20020a1709076ea800b0078d1e610b3esi14186436ejc.26.2022.10.19.07.12.56; Wed, 19 Oct 2022 07:13:34 -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=n3pVIZnX; 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 S231237AbiJSN6t (ORCPT + 99 others); Wed, 19 Oct 2022 09:58:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234079AbiJSNyr (ORCPT ); Wed, 19 Oct 2022 09:54:47 -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 7D7DE1DDC21; Wed, 19 Oct 2022 06:37:15 -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 068E7B82386; Wed, 19 Oct 2022 08:50:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A77BC433D7; Wed, 19 Oct 2022 08:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169442; bh=NFjboH5Ssva6H4YiEcOPIbsLI+ky7p8zequ7ek/+zBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3pVIZnX0Di40y1c+KHerC/uNdQViD3pLrP+ccidM+IlLY3CLpMK147FHP0N95OYd iXw0OE4F5uFqkaSbKRm1ylYIg+XZp9fpKlFAHs2OUcvfgIePCJxrtvEqQfhzCFGy2V SRiTqkOaA2wZaY0ou9Ocb7CPK+yIY76HNui1jqBA= 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 6.0 279/862] wifi: mt76: sdio: poll sta stat when device transmits data Date: Wed, 19 Oct 2022 10:26:06 +0200 Message-Id: <20221019083302.353274253@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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747125602713852020?= X-GMAIL-MSGID: =?utf-8?q?1747125602713852020?= 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 fb2caeae6dba..ece4e4bb94a1 100644 --- a/drivers/net/wireless/mediatek/mt76/sdio.c +++ b/drivers/net/wireless/mediatek/mt76/sdio.c @@ -478,7 +478,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);