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: 9360041 X-Patchwork-Delegate: bhelgaas@google.com 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 68561608A6 for ; Mon, 3 Oct 2016 05:37:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A0D4289FD for ; Mon, 3 Oct 2016 05:37:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EDB928A00; Mon, 3 Oct 2016 05:37:47 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07B81289FD for ; Mon, 3 Oct 2016 05:37:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752428AbcJCFhf (ORCPT ); Mon, 3 Oct 2016 01:37:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35327 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246AbcJCFhP (ORCPT ); Mon, 3 Oct 2016 01:37:15 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DE65661AEF; 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 Cc: Lorenzo.Pieralisi@arm.com, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , linux-kernel@vger.kernel.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> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.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)