Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2787429pxj; Sun, 20 Jun 2021 00:52:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeGolrz0S9FH1cPWgBB/hLrMZYoff0U81HpNXBFKbMBhCVpqbVLxOSuCownTlmB5Zba28y X-Received: by 2002:a17:906:34cf:: with SMTP id h15mr15217403ejb.526.1624175549018; Sun, 20 Jun 2021 00:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624175549; cv=none; d=google.com; s=arc-20160816; b=kbp5wPGwkNJrJITN1AgEANTOrvMATuMMfDREZcaL0G0tVIf0Xk96qfKmTBli77CJOy GvAnCj342BgJpO6OvnqIbwazpkSee8t2gEnqt3/XUNhdHLHX2j4qEloSBtS2McrBni9v UrLdbgGmFQAcNm3ydAh4JY7tgRS8GMzGQsvQjOhrHhMd4h5+Cf5VGYc5N+a9wX8844cA m1/mjeenwSuM359y1Gf7ohuVFLgqhbMKCD7XVAg6S8+704mccnZu1qJMK0dhYy3SmUYr rnr1GbGVpnIWt1/3owPdsVkbO8P7AB5+oz1KpAWY7hpR2P48voCG/LbkiTGFAZaERoqP +97g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=G4fFGk6hxsKEaOATmbmsDLIKMep57uSIsaNnmSYpzJI=; b=wzRCLBrD5C/zN4KLFREbBG5G2IfDGUyoaxXPKVkHbauv/TKAqLikFlHDKIwEmJTrct Rernq9rzUTiB4lUzNU51pgrDXcYej4wAv7PHQXoLranGyt5jkpnXDQT8K+hMWK0P6ZJW WpKjD8sDLkrLMxarhCGehv/RgJ3DE9R2euYb2rE31aUKDh06Dy9XQ3ZanQLd/ev4pqRk X8K/kgVqQQPpGvnXeuxVyL6PsZ6NFuvAheT0kUMuuvHLF+5Ou7kKdFGLZm/1RJtmux3X uHNLKAa2dSEFt4RSEqu9bMbS28Zy2DFqaBYlJByoc5KsSVZFSpn1k+1To7fpkA43ygn/ RMsw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si3518462edd.172.2021.06.20.00.51.49; Sun, 20 Jun 2021 00:52:29 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229552AbhFTHu1 (ORCPT + 99 others); Sun, 20 Jun 2021 03:50:27 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:39947 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229489AbhFTHuZ (ORCPT ); Sun, 20 Jun 2021 03:50:25 -0400 X-UUID: 7bb713169bff4190a977994d229f672f-20210620 X-UUID: 7bb713169bff4190a977994d229f672f-20210620 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 788337663; Sun, 20 Jun 2021 15:48:10 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 20 Jun 2021 15:48:09 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 20 Jun 2021 15:48:09 +0800 From: To: , CC: , , , , , , , , , , , , , , , Subject: [PATCH 1/2] mt76: mt7921: enable aspm by default Date: Sun, 20 Jun 2021 15:48:06 +0800 Message-ID: <9b704807383f3048898944d2b9cb74e6b4e8d83d.1624174954.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sean Wang mt7921 is mainly used in NB, CE and IoT application where battery life is much concerned so the patch enabled PCIe ASPM by default to shut off the clocks related PCIe as much as possible when MT7921 is either in suspend state or in runtime pm to lower power consumption. We still leave disable aspm as an option with module_param for users to disable ASPM if necessary. Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c index c3905bcab360..33782e1ee312 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c @@ -17,6 +17,10 @@ static const struct pci_device_id mt7921_pci_device_table[] = { { }, }; +static bool mt7921_disable_aspm; +module_param_named(disable_aspm, mt7921_disable_aspm, bool, 0644); +MODULE_PARM_DESC(disable_aspm, "disable PCI ASPM support"); + static void mt7921_rx_poll_complete(struct mt76_dev *mdev, enum mt76_rxq_id q) { @@ -132,7 +136,8 @@ static int mt7921_pci_probe(struct pci_dev *pdev, if (ret) goto err_free_pci_vec; - mt76_pci_disable_aspm(pdev); + if (mt7921_disable_aspm) + mt76_pci_disable_aspm(pdev); mdev = mt76_alloc_device(&pdev->dev, sizeof(*dev), &mt7921_ops, &drv_ops); -- 2.25.1