linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
From: "Saheed O. Bolarinwa" <refactormyself@gmail.com>
To: helgaas@kernel.org
Cc: "Saheed O. Bolarinwa" <refactormyself@gmail.com>,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: [Linux-kernel-mentees] [RFC PATCH v5 12/23] PCI: Add ASPM and CLOCK PM states to struct pci_dev
Date: Sat, 22 Aug 2020 22:03:47 +0200	[thread overview]
Message-ID: <20200822200358.252967-13-refactormyself@gmail.com> (raw)
In-Reply-To: <20200822200358.252967-1-refactormyself@gmail.com>

Move all struct pcie_link_state information to struct pci_dev

Signed-off-by: Saheed O. Bolarinwa <refactormyself@gmail.com>
---
 drivers/pci/pcie/aspm.c |  5 -----
 include/linux/pci.h     | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 4cff11dc8d83..d9c17093b250 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -41,11 +41,6 @@
 #define ASPM_STATE_ALL		(ASPM_STATE_L0S | ASPM_STATE_L1 |	\
 				 ASPM_STATE_L1SS)
 
-struct aspm_latency {
-	u32 l0s;			/* L0s latency (nsec) */
-	u32 l1;				/* L1 latency (nsec) */
-};
-
 struct pcie_link_state {
 	struct pci_dev *pdev;		/* Upstream component of the Link */
 	struct pci_dev *downstream;	/* Downstream component, function 0 */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index fa114c5d01e7..1daf5fe0b913 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -305,6 +305,11 @@ struct pci_vpd;
 struct pci_sriov;
 struct pci_p2pdma;
 
+struct aspm_latency {
+	u32 l0s;			/* L0s latency (nsec) */
+	u32 l1;				/* L1 latency (nsec) */
+};
+
 /* The pci_dev structure describes PCI devices */
 struct pci_dev {
 	struct list_head bus_list;	/* Node in per-bus list */
@@ -383,6 +388,33 @@ struct pci_dev {
 					   supported from root to here */
 	int		l1ss_cap_ptr;	/* L1SS cap ptr, 0 if not supported */
 	u32		l1ss_cap;	/* L1 PM substate Capabilities */
+
+	struct pci_dev	*parent;	/* pointer to the parent */
+	struct pci_dev	*root;		/* pointer to the root port */
+	struct pci_dev	*downstream;	/* Downstream component, function 0 */
+	struct list_head sibling;	/* node in link_list */
+
+	/* ASPM state */
+	u32 aspm_support:7;             /* Supported ASPM state */
+	u32 aspm_enabled:7;             /* Enabled ASPM state */
+	u32 aspm_capable:7;             /* Capable ASPM state with latency */
+	u32 aspm_default:7;             /* Default ASPM state by BIOS */
+	u32 aspm_disable:7;             /* Disabled ASPM state */
+
+	/* Clock PM state */
+	u32 clkpm_capable:1;            /* Clock PM capable? */
+	u32 clkpm_enabled:1;            /* Current Clock PM state */
+	u32 clkpm_default:1;            /* Default Clock PM state by BIOS */
+	u32 clkpm_disable:1;            /* Clock PM disabled */
+
+	/* Exit latencies */
+	struct aspm_latency latency_up;	/* Upstream direction exit latency */
+	struct aspm_latency latency_dw;	/* Downstream direction exit latency */
+	/*
+	 * Endpoint acceptable latencies. A pcie downstream port only
+	 * has one slot under it, so at most there are 8 functions.
+	 */
+	struct aspm_latency acceptable[8];
 #endif
 	unsigned int	eetlp_prefix_path:1;	/* End-to-End TLP Prefix */
 
-- 
2.18.4

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  parent reply	other threads:[~2020-08-22 21:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-22 20:03 [Linux-kernel-mentees] [RFC PATCH v5 00/23] Remove struct pcie_link_state and aspm_register_info Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 01/23] PCI: Migrate ASPM info from struct pcie_link_state to struct pci_dev Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 02/23] PCI: Add l1ss_cap and l1ss_cap_ptr " Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 03/23] PCI: Rework calc_l*_latency() to take a pci_dev * Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 04/23] PCI: Compute aspm_register_info.support directly Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 05/23] PCI: Read value of aspm_register_info.l1ss_ctl1 directly Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 06/23] PCI: Replace aspm_register_info.l1ss_cap* with their pci_dev version Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 07/23] PCI: Compute aspm_register_info.enable directly Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 08/23] PCI: Remove unused aspm_calc_l1ss_info() arguments Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 09/23] PCI: Remove pcie_get_aspm_reg() and struct aspm_register_info Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 10/23] PCI: Relocate call to aspm_calc_l1ss_info Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 11/23] PCI: Rework and Rename aspm_calc_l1ss_info() Saheed O. Bolarinwa
2020-08-22 20:03 ` Saheed O. Bolarinwa [this message]
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 13/23] PCI: Initialise and Update values of pci_dev's PCIe link info Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 14/23] PCI: Change Return and Argument values from pcie_link_state to pci_dev Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 15/23] PCI: Replace pcie_link_state based device list with a pci_dev one Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 16/23] PCI: Remove Exit latencies from struct pcie_link_state Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 17/23] PCI: Remove .clkpm_* " Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 18/23] PCI: Remove .aspm_* " Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 19/23] PCI: Remove .parent " Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 20/23] PCI: Remove .root " Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 21/23] PCI: Remove .downstream " Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 22/23] PCI: Remove .pdev " Saheed O. Bolarinwa
2020-08-22 20:03 ` [Linux-kernel-mentees] [RFC PATCH v5 23/23] PCI: Remove " Saheed O. Bolarinwa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200822200358.252967-13-refactormyself@gmail.com \
    --to=refactormyself@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --subject='Re: [Linux-kernel-mentees] [RFC PATCH v5 12/23] PCI: Add ASPM and CLOCK PM states to struct pci_dev' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).