From patchwork Tue Jan 2 17:00:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10141037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 189126034B for ; Tue, 2 Jan 2018 17:00:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09F5428D2E for ; Tue, 2 Jan 2018 17:00:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F297628C84; Tue, 2 Jan 2018 17:00:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 80EB928D2F for ; Tue, 2 Jan 2018 17:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=W43sNj9shJCzCzqn0i8XOOugdio7hwD3MpEgyfVaHyc=; b=AYLwlSvKhI+cmD8DyJ7OJGPV+M Hen1EqymdwPXzcQuZAXs7JzUa8WPjm5NDVUS0R+CzPCErHgHMqDnaLaYVi1m7IYeUjk4tqGAdBOcV RfhXDHuc8HmDChfjjIovq3zJx8DQxTm/g+49nSKjNCrLanO2ACoRlU0Bp5Bb/I/NaW6eXlXxaa9N1 Yenzo8S/elhvrYRquMS+ylcSW9IoQlxNOZGM8IA8qrFDCWUv9zknqyI9UK1i6djnVKvCtoCkmbAea qIfFZm6TNiRiOEFWW3eGUJ2jvYD6PFU2rTcYQIduRHYINTQrIpbWo40cOpIHzyCqFs1+d/RnQxUQJ tLFYKPYA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eWPvm-0000WT-Av; Tue, 02 Jan 2018 17:00:50 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eWPvd-0008VO-FU for linux-arm-kernel@lists.infradead.org; Tue, 02 Jan 2018 17:00:46 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B625560B72; Tue, 2 Jan 2018 17:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1514912435; bh=XDG6bRR1XamUQHiRecICd3/49kmpqHOv5UuTZWz5wck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ccfLA8kQpzhob9nty6L6a2FrROXdGh7ULke4MHmME0LuaVIc40/B+KNQZw4pYFSGF gP5i4qRzYe2MFTNkEiuWob2VF7atJ4rQI2j5RPxhl3G0m5phD0F1JhhY6Rwu9VkyjE Mvpj1GuMNSHFg4dFAvbj4Yvgt1RSHljD/EweIFwk= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 83EA360B81; Tue, 2 Jan 2018 17:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1514912435; bh=XDG6bRR1XamUQHiRecICd3/49kmpqHOv5UuTZWz5wck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ccfLA8kQpzhob9nty6L6a2FrROXdGh7ULke4MHmME0LuaVIc40/B+KNQZw4pYFSGF gP5i4qRzYe2MFTNkEiuWob2VF7atJ4rQI2j5RPxhl3G0m5phD0F1JhhY6Rwu9VkyjE Mvpj1GuMNSHFg4dFAvbj4Yvgt1RSHljD/EweIFwk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 83EA360B81 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org, timur@codeaurora.org Subject: [PATCH V3 4/6] PCI: Wait device ready after pci_pm_reset() Date: Tue, 2 Jan 2018 12:00:21 -0500 Message-Id: <1514912423-13341-5-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1514912423-13341-1-git-send-email-okaya@codeaurora.org> References: <1514912423-13341-1-git-send-email-okaya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180102_090041_760031_4AF710C5 X-CRM114-Status: GOOD ( 10.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sinan Kaya , linux-arm-msm@vger.kernel.org, Bjorn Helgaas , open list , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Rev 3.1 Sec 2.3.1 Request Handling Rules says a device can issue CRS following a D3hot->D0 transition. Add pci_dev_wait() call to see if device is available before returning. Signed-off-by: Sinan Kaya Reviewed-by: Christoph Hellwig --- 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 736d809..09eae93 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4116,7 +4116,7 @@ static int pci_pm_reset(struct pci_dev *dev, int probe) pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, csr); pci_dev_d3_sleep(dev); - return 0; + return pci_dev_wait(dev, "PM D3->D0", PCIE_RESET_READY_POLL_MS); } void pci_reset_secondary_bus(struct pci_dev *dev)