From patchwork Sun Mar 13 16:22:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 12779371 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E204C433EF for ; Sun, 13 Mar 2022 16:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s/bwzSpq62BUVrisDCysK9rZn+KNbUZxzExMCHM3fYI=; b=vDk2FhhZR8U39l Bxl5vCyXxuh9RKgSUvZa9zvR+6cODNv5b5a2NWjZCsq2iLx0wbydAfWfVTWtAGPHi3W5lLFydd5Nd WgiZavBtU0h5h5mrOY4poU8NKGEkmNZ6jJkrP9ZRzWnY4NgNLt4LshtQ+nX09CJEZzQZr/KkZY84v IdtZqJfgMpiGLvYSMomgLGNO9R6sI4V8L3LmjQqD0G4S2yxK532CkIvXr/kR3kOhvmWJ0UBJaLU+s qnZyAZ1VoIxMiExcNO1LH8yUJ/zhrWFUlQFtg9XO4kWZ4DD0csOX7lFKzyZ0xonB5v4M9KF6LNPh+ d23Z1uuGz6dSsKWzoJMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTR05-0038lh-T5; Sun, 13 Mar 2022 16:23:21 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTR02-0038ip-6Q for linux-mediatek@lists.infradead.org; Sun, 13 Mar 2022 16:23:19 +0000 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 C1E9BB80B9F; Sun, 13 Mar 2022 16:23:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B5EDC340EE; Sun, 13 Mar 2022 16:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647188595; bh=7adOgiLt2r66OQbWnreCRQ/NSVnIjZDWQcWzyT/CjsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JsH0iHHjsUSaEmr3RRxpeSnFxQKK4qNz4O/l/ExY5UzpOE4FMqCVwofW7umgWTkBR AORi+wYpuvXdzLCobC7pUfL3MMRfiYVBEPeh17KfBUI635WpUic9PLiHhAzXhcyCSy LKpTVxQn+j+cffQOpBbQ4csoaPlS/o2lkKedpu+T4vpybZXejToa9pNN54bkGa6CQN ZiCiN715OVeUWMBHkPDRa0/4QaNHM9l7a1BLQidR82O2Bw/a1MROfsJR/1vhF9VPji SYeWs70tICunFK3qYPTYocTUN86+3WZFwAXT+Zp9ZceFkNKjhN1rBgfvrWLa2l3EDy RWkvDVwycxBVQ== 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 v4 4/9] mt76: mt7921: disable runtime pm for usb Date: Sun, 13 Mar 2022 17:22:36 +0100 Message-Id: <779e54963d964faad416065a715c52e4d5d0f396.1647188302.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220313_092318_433161_6BC65E05 X-CRM114-Status: GOOD ( 10.06 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Runtime-pm is not currently supported by usb driver Tested-by: Sean Wang 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 32004b55a360..bce76417f95d 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c @@ -267,6 +267,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) @@ -311,6 +314,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;