Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp191317pxm; Wed, 2 Mar 2022 13:12:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6nAhnxZVxvmpXAMwOQIk6xNaJIj1q83Mcc9f4IX/3KhHEfXDxaz1QUtoE2dTlgwWre7vA X-Received: by 2002:a17:902:6841:b0:150:9b8c:3a67 with SMTP id f1-20020a170902684100b001509b8c3a67mr27710296pln.151.1646255521868; Wed, 02 Mar 2022 13:12:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646255521; cv=none; d=google.com; s=arc-20160816; b=DnldhHi3QDdNq2373OfmuClo6F1CjvUu+gVk/jlxuOGimCCclrQ3DeA5mpvsP5BrU7 Ib9BCabfgpXaww1FSraxvnlNHir+ps7S131WjFbTqvSo4ubA0YFn2UD1XshpVTHhCHTa bdz9F+xkbXM+zctAQUUlDoLY0/DJVdRmEGmpTXUznIjc/MsOS/LfKsqu7KH8skaIYudx +sRMB0AdWqejstkYLhLj9krjvgYyCFe8IUvVESuV07q6u/XRS7SIY/ssgnSpGPZAqOYk uQNZVDLT7KUzUvqxBXe78QXz2RRIHxJ7luOj+QdUSJz4tH/K0ri/oK7y8GnAHnP0inRo xZ9A== 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=yP5BM26UYEaNjREDeH0ewCk9RbQg1AWAJMaBqZkMHYo=; b=SdQMwl7WlUTUHJk7chuyTzI6nsYnNHCg6Ore+lPnIpk6Bc+l7kGKGHiHhBe5P7WugB wlxnxliLNDIXCrJGwCOHgc9vZvLwT6vyaS4LAsdQN+LTs3LAmXE68SnJmM4lTglQVSGl H7DA9E4pIisPvpMi92xMnrKxUTleI0dIyqbR+L0bgMt8oVviGY3DvWN3lwOiUjndyofd cdqDTNBAAklREFJ5As7wwiCHM+YNtUds0+0AN5xZj8NbFmdJ6L+6mgtD9yc445puvWn6 mRNKgXbR0Hz+770m7FjyTGQrxWeuWBaaW62kD0kksMHTbxf9LbQShVk4tz1glh6/BDzK orlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aV4J/Q2f"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i63-20020a639d42000000b003756595d21esi177031pgd.94.2022.03.02.13.11.47; Wed, 02 Mar 2022 13:12:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@kernel.org header.s=k20201202 header.b="aV4J/Q2f"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S241352AbiCBPtv (ORCPT + 72 others); 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 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,T_SCC_BODY_TEXT_LINE 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-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; -- 2.35.1