From patchwork Fri Sep 16 20:06:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9336639 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 CF3D9601C2 for ; Fri, 16 Sep 2016 20:08:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD93C2A001 for ; Fri, 16 Sep 2016 20:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B255E2A097; Fri, 16 Sep 2016 20:08:49 +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 3E74C2A001 for ; Fri, 16 Sep 2016 20:08:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965287AbcIPUHI (ORCPT ); Fri, 16 Sep 2016 16:07:08 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46826 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965431AbcIPUGz (ORCPT ); Fri, 16 Sep 2016 16:06:55 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BD4D761833; Fri, 16 Sep 2016 20:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1474056413; bh=+uS7fCpblG/pIJK36hXr87NFUq20tR/XUyXk8s33BFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gDCMboF/5o12dNwwn6VyTjm1+BLyQvf9dSQbTy/hHdedicJZ/Cvs75EDLvRoh3VyX a1+KgeXEsBkORWHb8IUx2bkJpXfWakit4O9G1Mu5VQD2r6BFfj8u23kCF0oz0f43dk zDzla4vv2FWMA/96/fGtJCJ4XrmEBcAZ4vY6mIGc= 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 7D95C6180B; Fri, 16 Sep 2016 20:06:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1474056413; bh=+uS7fCpblG/pIJK36hXr87NFUq20tR/XUyXk8s33BFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gDCMboF/5o12dNwwn6VyTjm1+BLyQvf9dSQbTy/hHdedicJZ/Cvs75EDLvRoh3VyX a1+KgeXEsBkORWHb8IUx2bkJpXfWakit4O9G1Mu5VQD2r6BFfj8u23kCF0oz0f43dk zDzla4vv2FWMA/96/fGtJCJ4XrmEBcAZ4vY6mIGc= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 7D95C6180B 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: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , linux-kernel@vger.kernel.org Subject: [PATCH V2 5/5] PCI: handle CRS returned by device after FLR Date: Fri, 16 Sep 2016 16:06:34 -0400 Message-Id: <1474056395-21843-6-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1474056395-21843-1-git-send-email-okaya@codeaurora.org> References: <1474056395-21843-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 e913467..1def11e 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3729,7 +3729,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)