Commit d6d38574 authored by Shaohua Li's avatar Shaohua Li Committed by Jesse Barnes
Browse files

PCI: add an option to allow ASPM enabled forcibly



A new option, pcie_aspm=force, will force ASPM to be enabled, even on system
with PCIe 1.0 devices.

Signed-off-by: default avatarShaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 149e1637
Loading
Loading
Loading
Loading
+14 −6
Original line number Original line Diff line number Diff line
@@ -55,7 +55,7 @@ struct pcie_link_state {
	struct endpoint_state endpoints[8];
	struct endpoint_state endpoints[8];
};
};


static int aspm_disabled;
static int aspm_disabled, aspm_force;
static DEFINE_MUTEX(aspm_lock);
static DEFINE_MUTEX(aspm_lock);
static LIST_HEAD(link_list);
static LIST_HEAD(link_list);


@@ -527,9 +527,10 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev)
		 */
		 */
		pci_read_config_dword(child_dev, child_pos + PCI_EXP_DEVCAP,
		pci_read_config_dword(child_dev, child_pos + PCI_EXP_DEVCAP,
			&reg32);
			&reg32);
		if (!(reg32 & PCI_EXP_DEVCAP_RBER)) {
		if (!(reg32 & PCI_EXP_DEVCAP_RBER && !aspm_force)) {
			printk("Pre-1.1 PCIe device detected, "
			printk("Pre-1.1 PCIe device detected, "
				"disable ASPM for %s\n", pci_name(pdev));
				"disable ASPM for %s. It can be enabled forcedly"
				" with 'pcie_aspm=force'\n", pci_name(pdev));
			return -EINVAL;
			return -EINVAL;
		}
		}
	}
	}
@@ -815,14 +816,21 @@ void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)


static int __init pcie_aspm_disable(char *str)
static int __init pcie_aspm_disable(char *str)
{
{
	if (!strcmp(str, "off")) {
		aspm_disabled = 1;
		aspm_disabled = 1;
		printk(KERN_INFO "PCIe ASPM is disabled\n");
	} else if (!strcmp(str, "force")) {
		aspm_force = 1;
		printk(KERN_INFO "PCIe ASPM is forcedly enabled\n");
	}
	return 1;
	return 1;
}
}


__setup("pcie_noaspm", pcie_aspm_disable);
__setup("pcie_aspm=", pcie_aspm_disable);


void pcie_no_aspm(void)
void pcie_no_aspm(void)
{
{
	if (!aspm_force)
		aspm_disabled = 1;
		aspm_disabled = 1;
}
}