Lines Matching +full:pcie +full:- +full:root +full:- +full:port +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0
3 * Enable PCIe link L0s/L1 state and Clock Power Management
49 cap = &save_state->cap.data[0]; in pci_save_ltr_state()
65 cap = &save_state->cap.data[0]; in pci_restore_ltr_state()
73 pdev->l1ss = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_L1SS); in pci_configure_aspm_l1ss()
84 struct pci_dev *parent = pdev->bus->self; in pci_save_aspm_l1ss_state()
89 * If this is a Downstream Port, we never restore the L1SS state in pci_save_aspm_l1ss_state()
91 * Upstream Port below it. in pci_save_aspm_l1ss_state()
96 if (!pdev->l1ss || !parent->l1ss) in pci_save_aspm_l1ss_state()
107 cap = &save_state->cap.data[0]; in pci_save_aspm_l1ss_state()
108 pci_read_config_dword(pdev, pdev->l1ss + PCI_L1SS_CTL2, cap++); in pci_save_aspm_l1ss_state()
109 pci_read_config_dword(pdev, pdev->l1ss + PCI_L1SS_CTL1, cap++); in pci_save_aspm_l1ss_state()
119 cap = &save_state->cap.data[0]; in pci_save_aspm_l1ss_state()
120 pci_read_config_dword(parent, parent->l1ss + PCI_L1SS_CTL2, cap++); in pci_save_aspm_l1ss_state()
121 pci_read_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, cap++); in pci_save_aspm_l1ss_state()
127 struct pci_dev *parent = pdev->bus->self; in pci_restore_aspm_l1ss_state()
140 if (!pdev->l1ss || !parent->l1ss) in pci_restore_aspm_l1ss_state()
148 cap = &cl_save_state->cap.data[0]; in pci_restore_aspm_l1ss_state()
151 cap = &pl_save_state->cap.data[0]; in pci_restore_aspm_l1ss_state()
170 pci_clear_and_set_config_dword(pdev, pdev->l1ss + PCI_L1SS_CTL1, in pci_restore_aspm_l1ss_state()
172 pci_clear_and_set_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, in pci_restore_aspm_l1ss_state()
186 pci_write_config_dword(parent, parent->l1ss + PCI_L1SS_CTL2, pl_ctl2); in pci_restore_aspm_l1ss_state()
187 pci_write_config_dword(pdev, pdev->l1ss + PCI_L1SS_CTL2, cl_ctl2); in pci_restore_aspm_l1ss_state()
188 pci_write_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, pl_ctl1); in pci_restore_aspm_l1ss_state()
189 pci_write_config_dword(pdev, pdev->l1ss + PCI_L1SS_CTL1, cl_ctl1); in pci_restore_aspm_l1ss_state()
193 pci_write_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, in pci_restore_aspm_l1ss_state()
195 pci_write_config_dword(pdev, pdev->l1ss + PCI_L1SS_CTL1, in pci_restore_aspm_l1ss_state()
216 #define PCIE_LINK_STATE_L0S_DW BIT(1) /* Downstream direction L0s state */
230 struct pcie_link_state *root; /* pointer to the root port link */ member
242 u32 clkpm_capable:1; /* Clock PM capable? */
243 u32 clkpm_enabled:1; /* Current Clock PM state */
244 u32 clkpm_default:1; /* Default Clock PM state by BIOS */
245 u32 clkpm_disable:1; /* Clock PM disabled */
254 #define POLICY_PERFORMANCE 1 /* high performance */
283 list_for_each_entry(child, &linkbus->devices, bus_list) in pci_function_0()
284 if (PCI_FUNC(child->devfn) == 0) in pci_function_0()
302 return link->aspm_default; in policy_to_aspm_state()
316 return 1; in policy_to_clkpm_state()
318 return link->clkpm_default; in policy_to_clkpm_state()
342 /* Depends on pci_save_pcie_state(): cap[1] is LNKCTL */ in pci_update_aspm_saved_state()
343 cap = (u16 *)&save_state->cap.data[0]; in pci_update_aspm_saved_state()
344 cap[1] = lnkctl | aspm_ctl; in pci_update_aspm_saved_state()
350 struct pci_bus *linkbus = link->pdev->subordinate; in pcie_set_clkpm_nocheck()
353 list_for_each_entry(child, &linkbus->devices, bus_list) { in pcie_set_clkpm_nocheck()
359 link->clkpm_enabled = !!enable; in pcie_set_clkpm_nocheck()
368 if (!link->clkpm_capable || link->clkpm_disable) in pcie_set_clkpm()
371 if (link->clkpm_enabled == enable) in pcie_set_clkpm()
378 int capable = 1, enabled = 1; in pcie_clkpm_cap_init()
382 struct pci_bus *linkbus = link->pdev->subordinate; in pcie_clkpm_cap_init()
385 list_for_each_entry(child, &linkbus->devices, bus_list) { in pcie_clkpm_cap_init()
396 link->clkpm_enabled = enabled; in pcie_clkpm_cap_init()
397 link->clkpm_default = enabled; in pcie_clkpm_cap_init()
398 link->clkpm_capable = capable; in pcie_clkpm_cap_init()
399 link->clkpm_disable = blacklist ? 1 : 0; in pcie_clkpm_cap_init()
409 int same_clock = 1; in pcie_aspm_configure_common_clock()
411 struct pci_dev *child, *parent = link->pdev; in pcie_aspm_configure_common_clock()
412 struct pci_bus *linkbus = parent->subordinate; in pcie_aspm_configure_common_clock()
417 child = list_entry(linkbus->devices.next, struct pci_dev, bus_list); in pcie_aspm_configure_common_clock()
420 /* Check downstream component if bit Slot Clock Configuration is 1 */ in pcie_aspm_configure_common_clock()
425 /* Check upstream component if bit Slot Clock Configuration is 1 */ in pcie_aspm_configure_common_clock()
430 /* Port might be already in common clock mode */ in pcie_aspm_configure_common_clock()
436 list_for_each_entry(child, &linkbus->devices, bus_list) { in pcie_aspm_configure_common_clock()
451 list_for_each_entry(child, &linkbus->devices, bus_list) { in pcie_aspm_configure_common_clock()
453 child_old_ccc[PCI_FUNC(child->devfn)] = reg16 & PCI_EXP_LNKCTL_CCC; in pcie_aspm_configure_common_clock()
462 if (pcie_retrain_link(link->pdev, true)) { in pcie_aspm_configure_common_clock()
466 list_for_each_entry(child, &linkbus->devices, bus_list) in pcie_aspm_configure_common_clock()
469 child_old_ccc[PCI_FUNC(child->devfn)]); in pcie_aspm_configure_common_clock()
517 case 1: in calc_l12_pwron()
527 * Encode an LTR_L1.2_THRESHOLD value for the L1 PM Substates Control 1
532 * See PCIe r6.0, sec 5.5.1, 6.18, 7.8.3.3.
539 * LTR_L1.2_THRESHOLD_Value ("value") is a 10-bit field with max in encode_l12_threshold()
542 if (threshold_ns <= 1 * FIELD_MAX(PCI_L1SS_CTL1_LTR_L12_TH_VALUE)) { in encode_l12_threshold()
543 *scale = 0; /* Value times 1ns */ in encode_l12_threshold()
546 *scale = 1; /* Value times 32ns */ in encode_l12_threshold()
575 if ((endpoint->current_state != PCI_D0) && in pcie_aspm_check_latency()
576 (endpoint->current_state != PCI_UNKNOWN)) in pcie_aspm_check_latency()
579 link = endpoint->bus->self->link_state; in pcie_aspm_check_latency()
582 encoding = FIELD_GET(PCI_EXP_DEVCAP_L0S, endpoint->devcap); in pcie_aspm_check_latency()
586 encoding = FIELD_GET(PCI_EXP_DEVCAP_L1, endpoint->devcap); in pcie_aspm_check_latency()
590 struct pci_dev *dev = pci_function_0(link->pdev->subordinate); in pcie_aspm_check_latency()
593 pcie_capability_read_dword(link->pdev, PCI_EXP_LNKCAP, in pcie_aspm_check_latency()
603 if ((link->aspm_capable & PCIE_LINK_STATE_L0S_UP) && in pcie_aspm_check_latency()
605 link->aspm_capable &= ~PCIE_LINK_STATE_L0S_UP; in pcie_aspm_check_latency()
608 if ((link->aspm_capable & PCIE_LINK_STATE_L0S_DW) && in pcie_aspm_check_latency()
610 link->aspm_capable &= ~PCIE_LINK_STATE_L0S_DW; in pcie_aspm_check_latency()
613 * Every switch on the path to root complex need 1 in pcie_aspm_check_latency()
625 if ((link->aspm_capable & PCIE_LINK_STATE_L1) && in pcie_aspm_check_latency()
627 link->aspm_capable &= ~PCIE_LINK_STATE_L1; in pcie_aspm_check_latency()
630 link = link->parent; in pcie_aspm_check_latency()
638 struct pci_dev *child = link->downstream, *parent = link->pdev; in aspm_calc_l12_info()
645 /* Choose the greater of the two Port Common_Mode_Restore_Times */ in aspm_calc_l12_info()
650 /* Choose the greater of the two Port T_POWER_ON times */ in aspm_calc_l12_info()
673 * Based on PCIe r3.1, sec 5.5.3.3.1, Figures 5-16 and 5-17, and in aspm_calc_l12_info()
674 * Table 5-11. T(POWER_OFF) is at most 2us and T(L1.2) is at in aspm_calc_l12_info()
684 pci_read_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, &pctl1); in aspm_calc_l12_info()
685 pci_read_config_dword(parent, parent->l1ss + PCI_L1SS_CTL2, &pctl2); in aspm_calc_l12_info()
686 pci_read_config_dword(child, child->l1ss + PCI_L1SS_CTL1, &cctl1); in aspm_calc_l12_info()
687 pci_read_config_dword(child, child->l1ss + PCI_L1SS_CTL2, &cctl2); in aspm_calc_l12_info()
693 /* Disable L1.2 while updating. See PCIe r5.0, sec 5.5.4, 7.8.3.3 */ in aspm_calc_l12_info()
699 child->l1ss + PCI_L1SS_CTL1, in aspm_calc_l12_info()
702 parent->l1ss + PCI_L1SS_CTL1, in aspm_calc_l12_info()
707 pci_write_config_dword(parent, parent->l1ss + PCI_L1SS_CTL2, ctl2); in aspm_calc_l12_info()
708 pci_write_config_dword(child, child->l1ss + PCI_L1SS_CTL2, ctl2); in aspm_calc_l12_info()
711 pci_clear_and_set_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, in aspm_calc_l12_info()
715 pci_clear_and_set_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, in aspm_calc_l12_info()
719 pci_clear_and_set_config_dword(child, child->l1ss + PCI_L1SS_CTL1, in aspm_calc_l12_info()
726 parent->l1ss + PCI_L1SS_CTL1, 0, in aspm_calc_l12_info()
729 child->l1ss + PCI_L1SS_CTL1, 0, in aspm_calc_l12_info()
736 struct pci_dev *child = link->downstream, *parent = link->pdev; in aspm_l1ss_init()
740 if (!parent->l1ss || !child->l1ss) in aspm_l1ss_init()
744 pci_read_config_dword(parent, parent->l1ss + PCI_L1SS_CAP, in aspm_l1ss_init()
746 pci_read_config_dword(child, child->l1ss + PCI_L1SS_CAP, in aspm_l1ss_init()
755 * If we don't have LTR for the entire path from the Root Complex in aspm_l1ss_init()
757 * LTR_L1.2_THRESHOLD. See PCIe r4.0, secs 5.5.4, 6.18. in aspm_l1ss_init()
759 if (!child->ltr_path) in aspm_l1ss_init()
763 link->aspm_support |= PCIE_LINK_STATE_L1_1; in aspm_l1ss_init()
765 link->aspm_support |= PCIE_LINK_STATE_L1_2; in aspm_l1ss_init()
767 link->aspm_support |= PCIE_LINK_STATE_L1_1_PCIPM; in aspm_l1ss_init()
769 link->aspm_support |= PCIE_LINK_STATE_L1_2_PCIPM; in aspm_l1ss_init()
772 pci_read_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, in aspm_l1ss_init()
775 pci_read_config_dword(child, child->l1ss + PCI_L1SS_CTL1, in aspm_l1ss_init()
779 link->aspm_enabled |= PCIE_LINK_STATE_L1_1; in aspm_l1ss_init()
781 link->aspm_enabled |= PCIE_LINK_STATE_L1_2; in aspm_l1ss_init()
783 link->aspm_enabled |= PCIE_LINK_STATE_L1_1_PCIPM; in aspm_l1ss_init()
785 link->aspm_enabled |= PCIE_LINK_STATE_L1_2_PCIPM; in aspm_l1ss_init()
787 if (link->aspm_support & PCIE_LINK_STATE_L1_2_MASK) in aspm_l1ss_init()
793 struct pci_dev *child = link->downstream, *parent = link->pdev; in pcie_aspm_cap_init()
796 struct pci_bus *linkbus = parent->subordinate; in pcie_aspm_cap_init()
800 link->aspm_enabled = PCIE_LINK_STATE_ASPM_ALL; in pcie_aspm_cap_init()
801 link->aspm_disable = PCIE_LINK_STATE_ASPM_ALL; in pcie_aspm_cap_init()
818 * Re-read upstream/downstream components' register state after in pcie_aspm_cap_init()
820 * read-only Link Capabilities may change depending on common clock in pcie_aspm_cap_init()
821 * configuration (PCIe r5.0, sec 7.5.3.6). in pcie_aspm_cap_init()
845 link->aspm_support |= PCIE_LINK_STATE_L0S; in pcie_aspm_cap_init()
848 link->aspm_enabled |= PCIE_LINK_STATE_L0S_UP; in pcie_aspm_cap_init()
850 link->aspm_enabled |= PCIE_LINK_STATE_L0S_DW; in pcie_aspm_cap_init()
854 link->aspm_support |= PCIE_LINK_STATE_L1; in pcie_aspm_cap_init()
857 link->aspm_enabled |= PCIE_LINK_STATE_L1; in pcie_aspm_cap_init()
869 link->aspm_default = link->aspm_enabled; in pcie_aspm_cap_init()
872 link->aspm_capable = link->aspm_support; in pcie_aspm_cap_init()
875 list_for_each_entry(child, &linkbus->devices, bus_list) { in pcie_aspm_cap_init()
888 struct pci_dev *child = link->downstream, *parent = link->pdev; in pcie_config_aspm_l1ss()
901 * PCIe r6.2, sec 5.5.4, rules for enabling L1 PM Substates: in pcie_config_aspm_l1ss()
902 * - Clear L1.x enable bits at child first, then at parent in pcie_config_aspm_l1ss()
903 * - Set L1.x enable bits at parent first, then at child in pcie_config_aspm_l1ss()
904 * - ASPM/PCIPM L1.2 must be disabled while programming timing in pcie_config_aspm_l1ss()
909 pci_clear_and_set_config_dword(child, child->l1ss + PCI_L1SS_CTL1, in pcie_config_aspm_l1ss()
911 pci_clear_and_set_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, in pcie_config_aspm_l1ss()
915 pci_clear_and_set_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1, in pcie_config_aspm_l1ss()
917 pci_clear_and_set_config_dword(child, child->l1ss + PCI_L1SS_CTL1, in pcie_config_aspm_l1ss()
930 struct pci_dev *child = link->downstream, *parent = link->pdev; in pcie_config_aspm_link()
931 struct pci_bus *linkbus = parent->subordinate; in pcie_config_aspm_link()
934 state &= (link->aspm_capable & ~link->aspm_disable); in pcie_config_aspm_link()
941 if (parent->current_state != PCI_D0 || child->current_state != PCI_D0) { in pcie_config_aspm_link()
943 state |= (link->aspm_enabled & PCIE_LINK_STATE_L1_SS_PCIPM); in pcie_config_aspm_link()
947 if (link->aspm_enabled == state) in pcie_config_aspm_link()
960 * Per PCIe r6.2, sec 5.5.4, setting either or both of the enable in pcie_config_aspm_link()
971 * value for all functions of a multi-function device. in pcie_config_aspm_link()
973 list_for_each_entry(child, &linkbus->devices, bus_list) in pcie_config_aspm_link()
977 if (link->aspm_capable & PCIE_LINK_STATE_L1SS) in pcie_config_aspm_link()
981 list_for_each_entry(child, &linkbus->devices, bus_list) in pcie_config_aspm_link()
984 link->aspm_enabled = state; in pcie_config_aspm_link()
987 pci_save_aspm_l1ss_state(link->downstream); in pcie_config_aspm_link()
988 pci_update_aspm_saved_state(link->downstream); in pcie_config_aspm_link()
997 link = link->parent; in pcie_config_aspm_path()
1003 link->pdev->link_state = NULL; in free_link_state()
1013 * Some functions in a slot might not all be PCIe functions, in pcie_aspm_sanity_check()
1016 list_for_each_entry(child, &pdev->subordinate->devices, bus_list) { in pcie_aspm_sanity_check()
1018 return -EINVAL; in pcie_aspm_sanity_check()
1023 * pre-1.1 device in pcie_aspm_sanity_check()
1030 * Disable ASPM for pre-1.1 PCIe device, we follow MS to use in pcie_aspm_sanity_check()
1035 …pci_info(child, "disabling ASPM on pre-1.1 PCIe device. You can enable it with 'pcie_aspm=force'\… in pcie_aspm_sanity_check()
1036 return -EINVAL; in pcie_aspm_sanity_check()
1050 INIT_LIST_HEAD(&link->sibling); in alloc_pcie_link_state()
1051 link->pdev = pdev; in alloc_pcie_link_state()
1052 link->downstream = pci_function_0(pdev->subordinate); in alloc_pcie_link_state()
1055 * Root Ports and PCI/PCI-X to PCIe Bridges are roots of PCIe in alloc_pcie_link_state()
1056 * hierarchies. Note that some PCIe host implementations omit in alloc_pcie_link_state()
1057 * the root ports entirely, in which case a downstream port on in alloc_pcie_link_state()
1058 * a switch may become the root of the link state chain for all in alloc_pcie_link_state()
1063 !pdev->bus->parent->self) { in alloc_pcie_link_state()
1064 link->root = link; in alloc_pcie_link_state()
1068 parent = pdev->bus->parent->self->link_state; in alloc_pcie_link_state()
1074 link->parent = parent; in alloc_pcie_link_state()
1075 link->root = link->parent->root; in alloc_pcie_link_state()
1078 list_add(&link->sibling, &link_list); in alloc_pcie_link_state()
1079 pdev->link_state = link; in alloc_pcie_link_state()
1087 list_for_each_entry(child, &pdev->subordinate->devices, bus_list) in pcie_aspm_update_sysfs_visibility()
1088 sysfs_update_group(&child->dev.kobj, &aspm_ctrl_attr_group); in pcie_aspm_update_sysfs_visibility()
1093 * It is called after the pcie and its children devices are scanned.
1094 * @pdev: the root port or switch downstream port
1104 if (pdev->link_state) in pcie_aspm_init_link_state()
1110 * downstream port. in pcie_aspm_init_link_state()
1115 /* VIA has a strange chipset, root port is under a bridge */ in pcie_aspm_init_link_state()
1117 pdev->bus->self) in pcie_aspm_init_link_state()
1121 if (list_empty(&pdev->subordinate->devices)) in pcie_aspm_init_link_state()
1166 if (bridge && bridge->ltr_path) { in pci_bridge_reconfigure_ltr()
1169 pci_dbg(bridge, "re-enabling LTR\n"); in pci_bridge_reconfigure_ltr()
1178 struct pci_host_bridge *host = pci_find_host_bridge(pdev->bus); in pci_configure_ltr()
1192 pdev->ltr_path = 1; in pci_configure_ltr()
1197 if (bridge && bridge->ltr_path) in pci_configure_ltr()
1198 pdev->ltr_path = 1; in pci_configure_ltr()
1203 if (!host->native_ltr) in pci_configure_ltr()
1207 * Software must not enable LTR in an Endpoint unless the Root in pci_configure_ltr()
1209 * PCIe r4.0, sec 6.18. in pci_configure_ltr()
1214 pdev->ltr_path = 1; in pci_configure_ltr()
1219 * If we're configuring a hot-added device, LTR was likely in pci_configure_ltr()
1220 * disabled in the upstream bridge, so re-enable it before enabling in pci_configure_ltr()
1224 if (bridge && bridge->ltr_path) { in pci_configure_ltr()
1228 pdev->ltr_path = 1; in pci_configure_ltr()
1232 /* Recheck latencies and update aspm_capable for links under the root */
1233 static void pcie_update_aspm_capable(struct pcie_link_state *root) in pcie_update_aspm_capable() argument
1236 BUG_ON(root->parent); in pcie_update_aspm_capable()
1238 if (link->root != root) in pcie_update_aspm_capable()
1240 link->aspm_capable = link->aspm_support; in pcie_update_aspm_capable()
1244 struct pci_bus *linkbus = link->pdev->subordinate; in pcie_update_aspm_capable()
1245 if (link->root != root) in pcie_update_aspm_capable()
1247 list_for_each_entry(child, &linkbus->devices, bus_list) { in pcie_update_aspm_capable()
1259 struct pci_dev *parent = pdev->bus->self; in pcie_aspm_exit_link_state()
1260 struct pcie_link_state *link, *root, *parent_link; in pcie_aspm_exit_link_state() local
1262 if (!parent || !parent->link_state) in pcie_aspm_exit_link_state()
1268 link = parent->link_state; in pcie_aspm_exit_link_state()
1269 root = link->root; in pcie_aspm_exit_link_state()
1270 parent_link = link->parent; in pcie_aspm_exit_link_state()
1274 * link->downstream) being removed. in pcie_aspm_exit_link_state()
1277 * switch upstream port, this link state is parent_link to all in pcie_aspm_exit_link_state()
1280 if (pdev != link->downstream) in pcie_aspm_exit_link_state()
1284 list_del(&link->sibling); in pcie_aspm_exit_link_state()
1289 pcie_update_aspm_capable(root); in pcie_aspm_exit_link_state()
1299 * @pdev: the root port or switch downstream port
1304 struct pcie_link_state *link = pdev->link_state; in pcie_aspm_pm_state_change()
1315 pcie_update_aspm_capable(link->root); in pcie_aspm_pm_state_change()
1324 struct pcie_link_state *link = pdev->link_state; in pcie_aspm_powersave_config_link()
1352 return bridge->link_state; in pcie_aspm_get_link()
1382 return -EINVAL; in __pci_disable_link_state()
1393 return -EPERM; in __pci_disable_link_state()
1399 link->aspm_disable |= pci_calc_aspm_disable_mask(state); in __pci_disable_link_state()
1403 link->clkpm_disable = 1; in __pci_disable_link_state()
1421 * pci_disable_link_state - Disable device's link state, so the link will
1440 return -EINVAL; in __pci_enable_link_state()
1449 return -EPERM; in __pci_enable_link_state()
1455 link->aspm_default = pci_calc_aspm_enable_mask(state); in __pci_enable_link_state()
1458 link->clkpm_default = (state & PCIE_LINK_STATE_CLKPM) ? 1 : 0; in __pci_enable_link_state()
1468 * pci_enable_link_state - Clear and set the default device link state so that
1474 * Note: Ensure devices are in D0 before enabling PCI-PM L1 PM Substates, per
1475 * PCIe r6.0, sec 5.5.4.
1487 * pci_enable_link_state_locked - Clear and set the default device link state
1493 * Note: Ensure devices are in D0 before enabling PCI-PM L1 PM Substates, per
1494 * PCIe r6.0, sec 5.5.4.
1516 return -EPERM; in pcie_aspm_set_policy()
1551 * pcie_aspm_enabled - Check if PCIe ASPM has been enabled for a device.
1566 return link->aspm_enabled; in pcie_aspm_enabled()
1577 return sysfs_emit(buf, "%d\n", (link->aspm_enabled & state) ? 1 : 0); in aspm_attr_show_common()
1589 return -EINVAL; in aspm_attr_store_common()
1595 link->aspm_disable &= ~state; in aspm_attr_store_common()
1598 link->aspm_disable &= ~PCIE_LINK_STATE_L1; in aspm_attr_store_common()
1600 link->aspm_disable |= state; in aspm_attr_store_common()
1602 link->aspm_disable |= PCIE_LINK_STATE_L1SS; in aspm_attr_store_common()
1636 return sysfs_emit(buf, "%d\n", link->clkpm_enabled); in ASPM_ATTR()
1648 return -EINVAL; in clkpm_store()
1653 link->clkpm_disable = !state_enable; in clkpm_store()
1700 return link->clkpm_capable ? a->mode : 0; in aspm_ctrl_attrs_are_visible()
1702 return link->aspm_capable & aspm_state_map[n - 1] ? a->mode : 0; in aspm_ctrl_attrs_are_visible()
1715 aspm_disabled = 1; in pcie_aspm_disable()
1717 pr_info("PCIe ASPM is disabled\n"); in pcie_aspm_disable()
1719 aspm_force = 1; in pcie_aspm_disable()
1720 pr_info("PCIe ASPM is forcibly enabled\n"); in pcie_aspm_disable()
1722 return 1; in pcie_aspm_disable()
1737 aspm_disabled = 1; in pcie_no_aspm()