From patchwork Wed Mar 2 15:48:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 12766247 X-Patchwork-Delegate: nbd@nbd.name Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 239BEC433FE for ; Wed, 2 Mar 2022 15:49:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241352AbiCBPtv (ORCPT ); Wed, 2 Mar 2022 10:49:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241131AbiCBPta (ORCPT ); Wed, 2 Mar 2022 10:49:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3897731932 for ; Wed, 2 Mar 2022 07:48:44 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id C096961736 for ; Wed, 2 Mar 2022 15:48:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C315FC004E1; Wed, 2 Mar 2022 15:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646236123; bh=Vt8sOlXeJ4siYNw7JMSY7D3oocpTzpDOGIHB6LX0i3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aV4J/Q2fO7bWBUCeMFpytDDQFf/o13zSQu7vYDuQiF6a/CNkTeZyJGIMhUm1vswk9 EcrIlUrRfg5obS9jmzyTefFHB/ACRG5rpDLIxuC57KVMeJ7rsjVGCLjPuAYzMEcRaw 9swjXpPlanE7YohDLJr+0OnRLQIaGuHoXs96B2haTVzDY2AhG066VYSGy0NU0b54Cn G0XgezCWIIMiXT/XeKQ2G9u0vewbCxeLkx6zPuwiG/QzEZJO9Upiz7yx/QfylESGbn voKhH3+JS3+cnmF0umtxxEuRSb9M4zIyhzj8i3G5qGlPBbnNWE8Y1V2tkk8EWdAVhT AccauBltG6BzA== From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, deren.wu@mediatek.com, linux-mediatek@lists.infradead.org Subject: [PATCH 4/9] mt76: mt7921: disable runtime pm for usb Date: Wed, 2 Mar 2022 16:48:08 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Runtime-pm is not currently supported by usb driver Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c | 6 ++++++ drivers/net/wireless/mediatek/mt76/mt7921/init.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c index 1bb388ecc334..0ec6f75e7194 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c @@ -268,6 +268,9 @@ mt7921_pm_set(void *data, u64 val) struct mt7921_dev *dev = data; struct mt76_connac_pm *pm = &dev->pm; + if (mt76_is_usb(&dev->mt76)) + return -EOPNOTSUPP; + mutex_lock(&dev->mt76.mutex); if (val == pm->enable_user) @@ -312,6 +315,9 @@ mt7921_deep_sleep_set(void *data, u64 val) bool monitor = !!(dev->mphy.hw->conf.flags & IEEE80211_CONF_MONITOR); bool enable = !!val; + if (mt76_is_usb(&dev->mt76)) + return -EOPNOTSUPP; + mt7921_mutex_acquire(dev); if (pm->ds_enable_user == enable) goto out; diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c index fa6af85bba7b..54f51e7b48a0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c @@ -226,10 +226,12 @@ int mt7921_register_device(struct mt7921_dev *dev) dev->pm.idle_timeout = MT7921_PM_TIMEOUT; dev->pm.stats.last_wake_event = jiffies; dev->pm.stats.last_doze_event = jiffies; - dev->pm.enable_user = true; - dev->pm.enable = true; - dev->pm.ds_enable_user = true; - dev->pm.ds_enable = true; + if (!mt76_is_usb(&dev->mt76)) { + dev->pm.enable_user = true; + dev->pm.enable = true; + dev->pm.ds_enable_user = true; + dev->pm.ds_enable = true; + } if (mt76_is_sdio(&dev->mt76)) hw->extra_tx_headroom += MT_SDIO_TXD_SIZE + MT_SDIO_HDR_SIZE;