From patchwork Mon Oct 3 05:37:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9360049 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 024046075E for ; Mon, 3 Oct 2016 05:39:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E83BD2899F for ; Mon, 3 Oct 2016 05:39:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCEC0289FE; Mon, 3 Oct 2016 05:39:18 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A086A2899F for ; Mon, 3 Oct 2016 05:39:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bqvwl-000109-7C; Mon, 03 Oct 2016 05:37:51 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bqvwQ-0000wS-9Y for linux-arm-kernel@lists.infradead.org; Mon, 03 Oct 2016 05:37:31 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A459861AB6; Mon, 3 Oct 2016 05:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475473033; bh=HRs2LGBxmdO8+RCMdMeJ3yu3gqmutqlPfgDPvVVoHLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ME8i7QyJ96nhyfqnTuXVwIXrrvY0LeQ19A6dCqMzI/Kxr7053b/Ng0J8clUB9c626 e38ETEZb2qaUvl8rBJ64Qzi5Ljffo+6nG0WWCZlHJKMMTXzzfovscGqGYTiOnKZ72p LCqAXx1Qja2cJ51GzzE7LiAFNsijjMrN6JItGa30= 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 4BF9261AC5; Mon, 3 Oct 2016 05:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475473033; bh=HRs2LGBxmdO8+RCMdMeJ3yu3gqmutqlPfgDPvVVoHLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ME8i7QyJ96nhyfqnTuXVwIXrrvY0LeQ19A6dCqMzI/Kxr7053b/Ng0J8clUB9c626 e38ETEZb2qaUvl8rBJ64Qzi5Ljffo+6nG0WWCZlHJKMMTXzzfovscGqGYTiOnKZ72p LCqAXx1Qja2cJ51GzzE7LiAFNsijjMrN6JItGa30= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 4BF9261AC5 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, alex.williamson@redhat.com, vikrams@codeaurora.org Subject: [PATCH V3 2/2] PCI: handle CRS returned by device after FLR Date: Mon, 3 Oct 2016 01:37:00 -0400 Message-Id: <1475473021-14251-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475473021-14251-1-git-send-email-okaya@codeaurora.org> References: <1475473021-14251-1-git-send-email-okaya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161002_223730_472049_F718D322 X-CRM114-Status: GOOD ( 10.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sinan Kaya , linux-arm-msm@vger.kernel.org, Lorenzo.Pieralisi@arm.com, linux-kernel@vger.kernel.org, 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 An endpoint is allowed to issue CRS following an FLR request to indicate that it is not ready to accept new requests. Changing the polling mechanism in FLR wait function to go read the vendor ID instead of the command/status register. A CRS indication will only be given if the address to be read is vendor ID. Signed-off-by: Sinan Kaya --- drivers/pci/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index c8749b9..7580b00 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3725,7 +3725,8 @@ static void pci_flr_wait(struct pci_dev *dev) do { msleep(100); - pci_read_config_dword(dev, PCI_COMMAND, &id); + pci_bus_read_dev_vendor_id(dev->bus, dev->devfn, &id, + 60 * 1000); } while (i++ < 10 && id == ~0); if (id == ~0)