Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1409833pxy; Fri, 23 Apr 2021 07:28:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/7ZUn2HPYLlI2UYu7D0w3KhNS8sPZsXwrAhXy7doGgoXiu0t5pqpQwTiEyt2lgQ5gkYiY X-Received: by 2002:aa7:d587:: with SMTP id r7mr4820192edq.388.1619188080785; Fri, 23 Apr 2021 07:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619188080; cv=none; d=google.com; s=arc-20160816; b=IRtYlcWzKj6TI7VmB65uygW1QeaexpjP3KvX6fknuag/HFtwZBTBxGrxI1vREIhk5N RHatFVDsZfMFJrorXylqbbxOJ4ZqZsb6EnOz5H6bEGc6xkPXH013G0XohnWGpYCZhsGY 0yg7wGWYHEC+5hCTmltWStI/m2f7lX5TgYQsX2ZYzu8PTGqsD/tKFTaktMpPQIJzXzit tnURaU6VpbKWe+n6chCPQHdlPDlreI3i+LP78dskqqkjQ/fwEcE3C1pndjtWdBLxznTU F+Iav8X12Mkdhx0sqBaoX4MlvKTuHQAe3iR2nV3U1H7qH/C2CsjYNB3kkyXMCeV4IxzF 2KdA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5TJmdflOUciHVM7pnELpZTP+zHr+NHOOiWWxtvKSlqM=; b=UduWRGs0cYU6AS99Pyh+OCfOatr93xIUbmNqCzKTq07y8hw44h8zTmwcEdL3Tp8vx6 qiFA8VZM2jNNG1iEdvq6sICHt0HwK8rNMfSBcufoqIm0DzFIGT/sxyC6TgEGbmtjCBjA XS2jqm1PWDxt3k0bokGDYxShI3a0CSXMMXNqRWPX3uI/yD3yill8lgCaB9aydWLtoYW4 8eAliVWQ/uzMZZs38EpJ0oaRftLvWY2HNdcZqNWhVHtoWE9ORVR2NcbDmex4nl1Nmr/8 HVZ1Jaz0n+ViTYZvH7afwRD/bgy015go8dKce6umm9VKf8S/o1kBeqSCOAdC8s9IJIkn 4mvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JYE4Z7Nk; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp27si5449691ejc.24.2021.04.23.07.27.37; Fri, 23 Apr 2021 07:28:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JYE4Z7Nk; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239066AbhDWO2A (ORCPT + 99 others); Fri, 23 Apr 2021 10:28:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:48798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238918AbhDWO2A (ORCPT ); Fri, 23 Apr 2021 10:28:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 14C096141C; Fri, 23 Apr 2021 14:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619188044; bh=835O6aF5aOFD0RLTg7zJDzDxfjv8h4WJpuNJyNW5v8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JYE4Z7Nkyjky8w9jAVu6iu+xA7qQZwGfI61Xmax1skkkxfvNcb/9+YGCoGYIroI+x gOaXQycGIQqX8D8kqVdnsqfTOOB3SQbT+UniemnsBlWopKhkW7MFDpYUQPsDJqU926 SIEbJgE25/OgjOVprC/ajwhMRVN3PSl+NT96hfusuBSx2wjYndQDDwG/SKR1qBbDVU MHsHMGqGQcL5u8Y7Ui34QtxXmuVCVDjilaDQFyDTUKjBo4iwMvdzZjl6nXOFr0zU2c L5kkodB8SovPh9WghKQSRhZiim/a8Zwb9eOTVoLYoJiUp+7DW3rxA7ZsPD48+Rqk82 6YOyPgCPmlHsQ== From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, kvalo@codeaurora.org Subject: [PATCH 3/3] mt76: connac: do not schedule mac_work if the device is not running Date: Fri, 23 Apr 2021 16:27:11 +0200 Message-Id: <5bfd36a75799c37b12fcb54d17e77fbc2c7a0558.1619187875.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Do not run ieee80211_queue_delayed_work for mac work if the worqueue is not initialized yet Fixes: b1bd7bb8121d ("mt76: connac: unschedule mac_work before going to sleep") Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 5 +++-- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index f81a17d56008..e2dcfee6be81 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -1912,8 +1912,9 @@ void mt7615_pm_wake_work(struct work_struct *work) napi_schedule(&dev->mt76.napi[i]); mt76_connac_pm_dequeue_skbs(mphy, &dev->pm); mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WM], false); - ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work, - MT7615_WATCHDOG_TIME); + if (test_bit(MT76_STATE_RUNNING, &mphy->state)) + ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work, + MT7615_WATCHDOG_TIME); } ieee80211_wake_queues(mphy->hw); diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c index 214bd1859792..decf2d5f0ce3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -1404,8 +1404,9 @@ void mt7921_pm_wake_work(struct work_struct *work) napi_schedule(&dev->mt76.napi[i]); mt76_connac_pm_dequeue_skbs(mphy, &dev->pm); mt7921_tx_cleanup(dev); - ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work, - MT7921_WATCHDOG_TIME); + if (test_bit(MT76_STATE_RUNNING, &mphy->state)) + ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work, + MT7921_WATCHDOG_TIME); } ieee80211_wake_queues(mphy->hw); -- 2.30.2