The patch titled aspm: use msleep instead of cpu_relax during link retraining has been removed from the -mm tree. Its filename was aspm-use-msleep-instead-of-cpu_relax-during-link-retraining.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: aspm: use msleep instead of cpu_relax during link retraining From: Andrew Patterson <andrew.patterson@xxxxxx> The cpu_relax() function can be a noop on certain architectures like IA-64 when CPU threads are disabled, so use msleep instead during link retraining busy/wait loop. Introduce define LINK_RETRAIN_TIMEOUT instead of hard-coding timeout in pcie_aspm_configure_common_clock. Signed-off-by: Andrew Patterson <andrew.patterson@xxxxxx> Cc: "Li, Shaohua" <shaohua.li@xxxxxxxxx> Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/pci/pcie/aspm.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff -puN drivers/pci/pcie/aspm.c~aspm-use-msleep-instead-of-cpu_relax-during-link-retraining drivers/pci/pcie/aspm.c --- a/drivers/pci/pcie/aspm.c~aspm-use-msleep-instead-of-cpu_relax-during-link-retraining +++ a/drivers/pci/pcie/aspm.c @@ -17,6 +17,7 @@ #include <linux/init.h> #include <linux/slab.h> #include <linux/jiffies.h> +#include <linux/delay.h> #include <linux/pci-aspm.h> #include "../pci.h" @@ -70,6 +71,8 @@ static const char *policy_str[] = { [POLICY_POWERSAVE] = "powersave" }; +#define LINK_RETRAIN_TIMEOUT HZ + static int policy_to_aspm_state(struct pci_dev *pdev) { struct pcie_link_state *link_state = pdev->link_state; @@ -217,16 +220,18 @@ static void pcie_aspm_configure_common_c pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); /* Wait for link training end */ - /* break out after waiting for 1 second */ + /* break out after waiting for timeout */ start_jiffies = jiffies; - while ((jiffies - start_jiffies) < HZ) { + for (;;) { pci_read_config_word(pdev, pos + PCI_EXP_LNKSTA, ®16); if (!(reg16 & PCI_EXP_LNKSTA_LT)) break; - cpu_relax(); + if ((jiffies - start_jiffies) >= LINK_RETRAIN_TIMEOUT) + break; + msleep(1); } /* training failed -> recover */ - if ((jiffies - start_jiffies) >= HZ) { + if ((jiffies - start_jiffies) >= LINK_RETRAIN_TIMEOUT) { dev_printk (KERN_ERR, &pdev->dev, "ASPM: Could not configure" " common clock\n"); i = 0; _ Patches currently in -mm which might be from andrew.patterson@xxxxxx are linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html