Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp135966rdb; Sun, 28 Jan 2024 18:00:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFF9lKBNBTz2pdPrSUfXPOtp1gLDc4geVVf4YpbsARqX+LzvismBspepzNLD3QfczywfKxX X-Received: by 2002:a05:6214:529e:b0:68c:46ab:619 with SMTP id kj30-20020a056214529e00b0068c46ab0619mr2584457qvb.33.1706493642897; Sun, 28 Jan 2024 18:00:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706493642; cv=pass; d=google.com; s=arc-20160816; b=Nm6nYhXFnB1g4pLy2GaVQr6xxM3D48D7Tdso9ZIJgecPxCvVKqrqzxS7HwmW3IW+iI Nxo+n/NNq1GxE3xUo/oWmKAnFZQWc5a2LjKcSboJPIBUcv/4m6nEwapgRDymfJRacjv1 HDPuOQi/tou5C5OcD5ttN4MBcJjpr4CDgFv2JJuZ1oN+4L0U2J0qIt6WO7Vk9ogXWu0g eWNH1BQnXy+999fiEVsrcSbFm7dydI4d8YUtnX4hOOaQdvWWqMZw+P1rChdjDWvcwSlA pZOZdMO0TSbve4OLPT9k/j0WTAP0TorDJzwVv6oiIB4DlDdrRfXP2ds8POAzcTpEvGxR wRDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=MO8x0/YHNbJnEqY8Xc49gnLLxR9mHAVUEw6swXOOg/k=; fh=4cLLCZOZ1uAixzSG12P6cLh/7sn/90zAnCRwDJZB7tA=; b=URL0rCsLRU4MOXRp7N48s0dFQTQ0mxSn/WV2EGYZV1rZ9dKTAtycKXkGNathVwrqw8 S7t5BPnYyOBLgCWVBPF2vnkdmHNkL/y+69atBP3vMa7DCiqOrbbAsGjqLWCUampo0NST gex0++aYyzzuwlV753TbjgO6gL2xX2k467wy/vDF6AOBd3Zp3nKA5um/Tr8pnkOBza5i 3Sn9jW6K8azCCsQTiz2Dc1JAuFK9oITZFv3Au0EaW5fEpK/TU/HtbF1pBt4RLKlHdv8O 2/1lmucBVvuLEGzbdd+dIZvBvGDx/3dOQJO1eJbSCuCgsBWzgmqcEBxnw5hz9B8CrJLq yQlA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Tydek15V; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42010-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f11-20020a056214076b00b0068181e87595si6712541qvz.362.2024.01.28.18.00.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 18:00:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42010-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Tydek15V; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42010-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B8D461C21EC6 for ; Sun, 28 Jan 2024 23:32:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 557204596E; Sun, 28 Jan 2024 23:32:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Tydek15V" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EC7C446CA; Sun, 28 Jan 2024 23:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=134.134.136.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706484736; cv=none; b=re+yVJ+rZWA1znFpRVnoPEtFC2Z7eSN4kq2zpToQJeWt9zLU3i0gdt+gYpoPI7qQlV3st7di9EgBuo08WzxbGy8puN+tBKeu7DiERFReciGH1tphLSYAr/fpmCj26XBOFZlr7lfg2ZnSwH+blR7OVQ3OxWj9/PpL80I6MqvmPug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706484736; c=relaxed/simple; bh=O2DJ6Mu5KMdLzbxSBZdon80LtAPdKg3vJDjBKzmyAyc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=LEBx3eMWI8Ty0o8B1BIZAepnkdT9oP/gx8SIYyu/CS8VGwWsXEcxVQSEOce21ogF6VOWoUTE6ZEGY+aBQswX5lKWQHAqL1BhR5Po38gczGyiygtpVibNYkkvBpW9nbi1cKyOrImlj0lX+I3DtE2qOE3VcnWJ98DdCQAcK1zeBVE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Tydek15V; arc=none smtp.client-ip=134.134.136.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706484734; x=1738020734; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=O2DJ6Mu5KMdLzbxSBZdon80LtAPdKg3vJDjBKzmyAyc=; b=Tydek15VmtoZGZ1Up8DsMfwV4JI1u5TO0m2NcFfmPqFnBkKj6oOp9Pt4 pB6sEDVNcSAhPfB5WAeQRMvPndDp3QqynQG+P7VHNP2v1qM/gALvBKq/q dkNJLWoBe0h9D05hr5PVAYvS7Pcd5EhJuHQkZzTY4topUFXzjBJ3PrFI7 DaCBCypa2grnWGXa2KeVXe7X4ud6CRM1mmhi4wHZjCyL6FCFGD99LAAv+ E05E6J9h2wXmArPf+kN6g9E399k2m/8zV5OZxpTMuVlns7sE/71DdexKL hdtJhXTEDLwns1K6/0tQ0yCdZIeo5o5QFLZNsxB4twaY+6q49zqfCcOU8 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="406535984" X-IronPort-AV: E=Sophos;i="6.05,226,1701158400"; d="scan'208";a="406535984" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2024 15:32:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="857921252" X-IronPort-AV: E=Sophos;i="6.05,226,1701158400"; d="scan'208";a="857921252" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2024 15:32:12 -0800 Received: from debox1-desk4.intel.com (sdutta-mobl2.amr.corp.intel.com [10.209.55.52]) by linux.intel.com (Postfix) with ESMTP id 3036D580D78; Sun, 28 Jan 2024 15:32:12 -0800 (PST) From: "David E. Box" To: mika.westerberg@linux.intel.com, david.e.box@linux.intel.com, ilpo.jarvinen@linux.intel.com, bhelgaas@google.com, rjw@rjwysocki.net Cc: tasev.stefanoska@skynet.be, enriquezmark36@gmail.com, kernel@witt.link, wse@tuxedocomputers.com, vidyas@nvidia.com, kai.heng.feng@canonical.com, sathyanarayanan.kuppuswamy@linux.intel.com, ricky_wu@realtek.com, mario.limonciello@amd.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/5] Always build aspm.c Date: Sun, 28 Jan 2024 15:32:07 -0800 Message-Id: <20240128233212.1139663-1-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Here is the series to always build aspm.c, add back L1SS save/restore, and consolidate all ASPM related code in aspm.c. Patch 1 - Moves all PCI core functions running under CONFIG_PCIEASPM into aspm.c and changes they Makefile to always build it. No functional changes. Patch 2 - Creates a separate function to save the L1SS offset and places it outside of CONFIG_PCIEASPM in aspm.c so that the offset is available for later use by the L1SS save/restore code which needs to run when CONFIG_PCIEASPM=n. Patch 3 - Updated L1 Substate save/restore patch from previous V5 [1]. Patch 4 - Moves the LTR save/restore state functions into aspm.c outside of CONFIG_PCIEASPM. Patch 5 - Moves the LTR save/restore state calls into pci_save/restore_pcie_state(). The series does not continue any of the ASPM robustness changes proposed by Ilpo [2]. But if we think it's worth combining with this series I can add it and help continue the work. [1] https://lore.kernel.org/linux-pci/20231221011250.191599-1-david.e.box@linux.intel.com/ [2] https://lore.kernel.org/linux-pci/20230918131103.24119-1-ilpo.jarvinen@linux.intel.com/ David E. Box (5): PCI: Always build aspm.c PCI: Create function to save L1SS offset PCI/ASPM: Add back L1 PM Substate save and restore PCI: Move pci_save/restore_ltr_state() to aspm.c PCI: Call LTR save/restore state from PCIe save/restore drivers/pci/pci.c | 91 ++++---------- drivers/pci/pci.h | 10 +- drivers/pci/pcie/Makefile | 2 +- drivers/pci/pcie/aspm.c | 257 ++++++++++++++++++++++++++++++++++++-- drivers/pci/probe.c | 62 +-------- include/linux/pci.h | 4 +- 6 files changed, 283 insertions(+), 143 deletions(-) base-commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a -- 2.34.1