Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4046624pxk; Tue, 29 Sep 2020 12:50:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOn3ck7ZVLvN8wGrzcPgSK/eBunaUnMyqguS4B99SPaGk2EH96QW9KYKj85l2C24z65yyX X-Received: by 2002:a05:6402:326:: with SMTP id q6mr5116394edw.216.1601409005481; Tue, 29 Sep 2020 12:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601409005; cv=none; d=google.com; s=arc-20160816; b=NK4aG7myQ/S4xuoJyAN488kqS3N3iPQZeJnGwohgubMFgU9CMIAseIKaRvpu90DmzN K1pByAOAsc3eAnwUBdHC1reYQcQ3JZzMopTe5LisYgAoo5yoPRKLZaXCZSugcytq8CRO JF92wCdDzYsVmzRSsM/elQdgEdXJdRZD87c4lVyMB56sj3p2LqrX67bt49/0b09EAoVT KD22VaNvq8VaBFg9l1AVUlaiFgs1CSKouoBm9cmBxwfM5HwSpOTzchdOdCjoRndapLpo SbFfDrqZ0yS6ohU9Mm5q/qh6eSnhxH74ET3whEu7lsOya7lFDsQhklHqTu1JHwiLZGSv HXoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nY0IjJ8SpX3i5c2D/UZng76PqyFgw141YJsSzFn5oCk=; b=ope6eThahxKQmBH0iM/fQtQSliP0TslhSvE6AtZKOtrZutTO4Hp8ogDkjPmlwclmhL gp1IjCET8UWaunUZNNliNVP8aWuZWExVxF9q8Fk+JG3bIbTwdFRfF0OXtlexKTok8OD+ IRgwQjnUeDzBaN8zQPNG/wEIQlH8YK2tXxgPKADJcNHRMUXg1+rS9k/sxhZLh1MTOMDL 3nn2eZ6vOmz/O82Us2QWoscm/Eft6Za7JQVS2drQFlnVo0lic71Nd7QmKzctIsbtzqUt PmGScWEVFpgmWCtusEQ9FtFuGwDXrZa4t9to9jw1YUIV+S6nrrOuOncwlZIobapMIh+g ZYkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PN7We8oS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si3325482ejw.12.2020.09.29.12.49.41; Tue, 29 Sep 2020 12:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PN7We8oS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728869AbgI2TsK (ORCPT + 99 others); Tue, 29 Sep 2020 15:48:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:44850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728723AbgI2TsJ (ORCPT ); Tue, 29 Sep 2020 15:48:09 -0400 Received: from localhost (52.sub-72-107-123.myvzw.com [72.107.123.52]) (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 4CA0820774; Tue, 29 Sep 2020 19:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601408888; bh=GICoHa9khuYYRMn6zdxlSfQZX6PczQtkdPZXWahn1ZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PN7We8oSHI5WLB7fkbkuKP/tmWdaVqIuKvjSv6Pt6HtBKA6VdIWEjEXg0e1SpBkNe slM04vCHkQA+CniuSdHyTehcPhg5rR3gq68zgKKg1YMO+LIQAhTNc+QVDKh+mPTbKm Zmbo30yTUoS8do7ePU4z12x++yZT+a9OPZpy+XBM= From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J . Wysocki" , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Bjorn Helgaas Subject: [PATCH 2/2] PCI/PM: Revert "PCI/PM: Apply D2 delay as milliseconds, not microseconds" Date: Tue, 29 Sep 2020 14:47:48 -0500 Message-Id: <20200929194748.2566828-3-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200929194748.2566828-1-helgaas@kernel.org> References: <20200929194748.2566828-1-helgaas@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas This reverts commit 7e24bc347e57992d532bc2ed700209b0fc0a4bf5. 7e24bc347e57 was based on PCIe r5.0, sec 5.9, which claims we need a 200 ms delay when transitioning to or from D2. However, sec 5.3.1.3 states the delay as 200 μs (microseconds), as does the table in PCIe r4.0, sec 5.9.1. This looks like a typo in the r5.0 spec, so revert back to a 200 μs delay instead of a 200 ms delay. Fixes: 7e24bc347e57 ("PCI/PM: Apply D2 delay as milliseconds, not microseconds") Signed-off-by: Bjorn Helgaas --- drivers/pci/pci.c | 2 +- drivers/pci/pci.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index c4a26532a447..d69578ad44a0 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1065,7 +1065,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) - msleep(PCI_PM_D2_DELAY); + udelay(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); diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index f0a9cbe01bc7..f86cae9aa1f4 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -43,9 +43,9 @@ int pci_probe_reset_function(struct pci_dev *dev); int pci_bridge_secondary_bus_reset(struct pci_dev *dev); int pci_bus_error_reset(struct pci_dev *dev); -#define PCI_PM_D2_DELAY 200 -#define PCI_PM_D3HOT_WAIT 10 -#define PCI_PM_D3COLD_WAIT 100 +#define PCI_PM_D2_DELAY 200 /* usec; see PCIe r4.0, sec 5.9.1 */ +#define PCI_PM_D3HOT_WAIT 10 /* msec */ +#define PCI_PM_D3COLD_WAIT 100 /* msec */ /** * struct pci_platform_pm_ops - Firmware PM callbacks -- 2.25.1