Message ID | 20230918131103.24119-1-ilpo.jarvinen@linux.intel.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2874146vqi; Mon, 18 Sep 2023 11:42:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrZWGg5O7VDsClWircQu4Jpnjffoiyx8N7Yd1KpzR0TE1Oqp7xap9N7okliz4W9UnRnAqK X-Received: by 2002:a05:6a20:104c:b0:154:3f13:1bb7 with SMTP id gt12-20020a056a20104c00b001543f131bb7mr10708104pzc.49.1695062541927; Mon, 18 Sep 2023 11:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695062541; cv=none; d=google.com; s=arc-20160816; b=MDRgQccBLJRdpZTMfqHTuARFxSlTFZ2F9tgP1Rkwv0etTLzELvmySgzGGVfdx9s9q7 JfmBucEkMwu7PLUjbTpdbgIIl/xZ5XDjCGnyllla+8fTNSzFIaL4uRe/55DcknPUuLyg FWBOCvAj1lgkZ+Co4bevLaPk+rrUxa5KLK//wfpNwxz/skNiYimYBFlrj4Hh8F0Qq1fc XMs+u7BxYT8g55tIyyXMvAVN7Db5fqTvYO4XA6Y4LQc1PD0HYH8shbb4h4/bWNuhq7cw sHTLBuAMbx4EY4BI5yczk0elWPz/yoGSgB2TF7H91NX7dJOSqIMxip8xTRjgvgu95pOL /3eg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=BYHy1LUFdYeTis7ShrLXYt9O3TdX1pbCaBbPDy/udHE=; fh=NOdSWnjv6oV6f/dOA+M3V+40/fywCq2faIeDzUdNvw8=; b=BRsC359bUFivHflTk2G1TzydnEmjl/+e3bJM/hpMgPfjDO0Rgf2gsZXeIxgs/vYpGp r6PnEXBXSYFd9ZQl0/RgDIRey+m3pkrI83zVx/1cA7yp0+3XuMugYfPjhZkaGwW3tuRo Tq6WQmZYDkK0mBSWc12SICPXbucUFvew08SuWz9yxS/fRdbKO74laW89jwBmj/bLeu/0 qFMk6fAxGlt27g1DSAoUsV5bz3qWSmmP12FpBEQPI5OizKZUfDsGIfgiKT9J4IU5KC7s ATop44PU7mlJycGkMD1/h3zie+7Cy2fYw7ry+idEi/KRZGeRjYftSTmTyAzdEfpu2iTV m3/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GJ8nrjEm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y7-20020a636407000000b005740e906e55si8150635pgb.37.2023.09.18.11.42.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 11:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GJ8nrjEm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3C643804C60F; Mon, 18 Sep 2023 08:47:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbjIRPqy (ORCPT <rfc822;kernel.ruili@gmail.com> + 25 others); Mon, 18 Sep 2023 11:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjIRPqv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 11:46:51 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB7291BF4; Mon, 18 Sep 2023 08:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695051881; x=1726587881; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Um9SQvE/5HeieZqdelS3qtLTo5NsX9iapqTm1J+iScg=; b=GJ8nrjEmnxdovECeHs3LHsHcSAU2aiX4tkUMkhSkj7EZQqp0sTA+HHtK NB1YgSLPI5+bp6BuTn5+OIwNLjSfh981g7Y6nD7EOdNROChOUJBpRfdAG gZQQuXTzO+seA1GCfLzG4nu0QTaq52pTaP81QIfZ40iv6tGIAyk/MNP7m xTgFAUgj/QEpgehwjM1nHBAqHmIZdunoeW/R9I6isu0r2jTmabkPy7xPH SAsh+/AdsCeyF5PLzz2D1TWVIei/i40s8jZ3C8zh+F7aQvs8rwh237wMV Wlcspx6St0NT4wTTX30lU3uWnQNw8NaNRTsi66Z35MUwTPIr7CVLYAaMW g==; X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="446112585" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="446112585" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 06:11:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="811341354" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="811341354" Received: from nprotaso-mobl1.ccr.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.252.49.156]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 06:11:23 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Rob Herring <robh@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= <kw@linux.com>, Lukas Wunner <lukas@wunner.de>, "Rafael J . Wysocki" <rafael@kernel.org>, Heiner Kallweit <hkallweit1@gmail.com>, Emmanuel Grumbach <emmanuel.grumbach@intel.com>, linux-kernel@vger.kernel.org Cc: ath10k@lists.infradead.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org, intel-wired-lan@lists.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rdma@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH v2 00/13] PCI/ASPM: Make ASPM in core robust and remove driver workarounds Date: Mon, 18 Sep 2023 16:10:50 +0300 Message-Id: <20230918131103.24119-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 18 Sep 2023 08:47:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777401900290514313 X-GMAIL-MSGID: 1777401900290514313 |
Series |
PCI/ASPM: Make ASPM in core robust and remove driver workarounds
|
|
Message
Ilpo Järvinen
Sept. 18, 2023, 1:10 p.m. UTC
Previously, ASPM service driver has ignored link state management requests when OS is not authorized to touch LNKCTL (or ASPM is not configured at all). Because the core interface has not been reliable, drivers have create workarounds to force ASPM state by directly writing into LNKCTL themselves. A second problem is lack of symmetric pair for pci_disable_link_state(). Any link state disable is permanent (NOTE: pci_enable_link_state() despite its name is not a symmetric pair for pci_disable_link_state()). The lack of way to re-enable ASPM prevents drivers from using pci_disable_link_state() to disabling ASPM for certain phases of driver operation and re-enabling it later. Both cases are problematic because when ASPM is working normally through the service driver, it is not aware of the extra link state changes drivers perform directly causing the service driver to have incorrect view about the ASPM state. Address these problems by making pci_disable_link_state() reliable and by providing proper pci_enable_link_state() pair for it (the function currently on the way is renamed first to a more descriptive name). After core improvements, convert drivers to use the new interface and drop the workarounds. v2: - Rebased the series - Reorder patches (rename patch first) Ilpo Järvinen (13): PCI/ASPM: Rename pci_enable_link_state() to pci_set_default_link_state() PCI/ASPM: Improve pci_set_default_link_state() kerneldoc PCI/ASPM: Disable ASPM when driver requests it PCI/ASPM: Move L0S/L1/sub states mask calculation into a helper PCI/ASPM: Add pci_enable_link_state() Bluetooth: hci_bcm4377: Convert aspm disable to quirk mt76: Remove unreliable pci_disable_link_state() workaround e1000e: Remove unreliable pci_disable_link_state{,_locked}() workaround wifi: ath10k: Use pci_disable/enable_link_state() wifi: ath11k: Use pci_disable/enable_link_state() wifi: ath12k: Use pci_disable/enable_link_state() RDMA/hfi1: Use pci_disable/enable_link_state() misc: rtsx: Use pci_disable/enable_link_state() drivers/bluetooth/hci_bcm4377.c | 20 --- drivers/infiniband/hw/hfi1/aspm.c | 38 +----- drivers/infiniband/hw/hfi1/pcie.c | 2 +- drivers/misc/cardreader/rts5228.c | 6 +- drivers/misc/cardreader/rts5261.c | 6 +- drivers/misc/cardreader/rtsx_pcr.c | 8 +- drivers/net/ethernet/intel/e1000e/netdev.c | 77 +---------- drivers/net/wireless/ath/ath10k/pci.c | 8 +- drivers/net/wireless/ath/ath11k/pci.c | 10 +- drivers/net/wireless/ath/ath12k/pci.c | 10 +- drivers/net/wireless/mediatek/mt76/Makefile | 1 - drivers/net/wireless/mediatek/mt76/mt76.h | 1 - .../net/wireless/mediatek/mt76/mt7615/pci.c | 2 +- .../net/wireless/mediatek/mt76/mt76x0/pci.c | 2 +- .../net/wireless/mediatek/mt76/mt76x2/pci.c | 2 +- .../net/wireless/mediatek/mt76/mt7915/pci.c | 2 +- .../net/wireless/mediatek/mt76/mt7921/pci.c | 2 +- .../net/wireless/mediatek/mt76/mt7996/pci.c | 2 +- drivers/net/wireless/mediatek/mt76/pci.c | 47 ------- drivers/pci/controller/vmd.c | 2 +- drivers/pci/pcie/Makefile | 1 + drivers/pci/pcie/aspm.c | 126 +++++++++++++----- drivers/pci/pcie/aspm_minimal.c | 66 +++++++++ drivers/pci/quirks.c | 3 + include/linux/pci.h | 10 +- 25 files changed, 199 insertions(+), 255 deletions(-) delete mode 100644 drivers/net/wireless/mediatek/mt76/pci.c create mode 100644 drivers/pci/pcie/aspm_minimal.c