From patchwork Fri Nov 1 20:45:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 11223663 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4104013BD for ; Fri, 1 Nov 2019 20:46:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20ABB21906 for ; Fri, 1 Nov 2019 20:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572641189; bh=gBtBxUPX0z0dr/96PZO7T5LUfDsyS3pS2T9fKmfigx0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TZdRErCd60aEJCqbAxieW8amQ1813XZrk1/ID9DGE4E64G+HqI+vZY/r3CQfgvRo1 114zLlZ/oN0b08ixGSZowytZw0dKED/xiWi/z/1+3euAEDTawO9Z0F79KYY/pEMU0U TR9L1kwqEJnAZi8VHOXUFHbnIfDC60440aj2vcgQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727950AbfKAUq2 (ORCPT ); Fri, 1 Nov 2019 16:46:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:55234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbfKAUq2 (ORCPT ); Fri, 1 Nov 2019 16:46:28 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64153217D9; Fri, 1 Nov 2019 20:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572641187; bh=gBtBxUPX0z0dr/96PZO7T5LUfDsyS3pS2T9fKmfigx0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V5GePef3mZHVsWfixm6pT0lp9b+3EXpxI+IeheoSd6Rox+c0CPhnRowItQi5+8uOk bShJdg1uDunvD69b+lR9SHlMBqfL9h6ZPqXLIOk1KDiO28bXa2cD8EAvlhvuTH0sjv WlFeVltFWmAL1xMV1cCmYHR1Rbw6KRBmwr9zQtDg= From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 1/6] PCI/PM: Apply D2 delay as milliseconds, not microseconds Date: Fri, 1 Nov 2019 15:45:53 -0500 Message-Id: <20191101204558.210235-2-helgaas@kernel.org> X-Mailer: git-send-email 2.24.0.rc1.363.gb1bccd3e3d-goog In-Reply-To: <20191101204558.210235-1-helgaas@kernel.org> References: <20191101204558.210235-1-helgaas@kernel.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Bjorn Helgaas PCI_PM_D2_DELAY is defined as 200, which is milliseconds, but previously we used udelay(), which only waited for 200 microseconds. Use msleep() instead so we wait the correct amount of time. See PCIe r5.0, sec 5.9. Signed-off-by: Bjorn Helgaas Reviewed-by: Rafael J. Wysocki --- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e7982af9a5d8..cd96874ae76d 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -886,7 +886,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state) if (state == PCI_D3hot || dev->current_state == PCI_D3hot) pci_dev_d3_sleep(dev); else if (state == PCI_D2 || dev->current_state == PCI_D2) - udelay(PCI_PM_D2_DELAY); + msleep(PCI_PM_D2_DELAY); pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);