From patchwork Wed Aug 23 04:56:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9916573 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 EADC360327 for ; Wed, 23 Aug 2017 04:57:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCCE828864 for ; Wed, 23 Aug 2017 04:57:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D192F28956; Wed, 23 Aug 2017 04:57:17 +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 9010828864 for ; Wed, 23 Aug 2017 04:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753401AbdHWE5Q (ORCPT ); Wed, 23 Aug 2017 00:57:16 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53170 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbdHWE4S (ORCPT ); Wed, 23 Aug 2017 00:56:18 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D0EAD606DD; Wed, 23 Aug 2017 04:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503464177; bh=UGcpZdiCLTj77CEsQm1wmDPDICpcRem5qLsETktpF6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V1Ski33YFc+DJ+trdxKtSVZ16VRWQ8rLmRfaKv/6xQrFbFsgE42gjG/JxxHi04+K3 rbyyj7PpI9AAmyXTjcoxcgdsBRyO8LYGYBNdsPbiHrDwjTHqZS/EJBqm2+86bL4oS5 gfMmXY23t+osixn0S+fMCLPJ7b/ms+ZLRhRq0jBY= 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 BBD79606DB; Wed, 23 Aug 2017 04:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503464177; bh=UGcpZdiCLTj77CEsQm1wmDPDICpcRem5qLsETktpF6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V1Ski33YFc+DJ+trdxKtSVZ16VRWQ8rLmRfaKv/6xQrFbFsgE42gjG/JxxHi04+K3 rbyyj7PpI9AAmyXTjcoxcgdsBRyO8LYGYBNdsPbiHrDwjTHqZS/EJBqm2+86bL4oS5 gfMmXY23t+osixn0S+fMCLPJ7b/ms+ZLRhRq0jBY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BBD79606DB 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, alex.williamson@redhat.com Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Bjorn Helgaas , linux-kernel@vger.kernel.org Subject: [PATCH V12 2/5] PCI: add pci_bus_crs_visibility_pending() function to detect CRS response Date: Wed, 23 Aug 2017 00:56:08 -0400 Message-Id: <1503464171-6471-2-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503464171-6471-1-git-send-email-okaya@codeaurora.org> References: <1503464171-6471-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 We need a wrapper function to determine when a particular device is returning Configuration Request Retry Status (CRS) response. This will only happen if the root port supports CRS visibility. Signed-off-by: Sinan Kaya --- drivers/pci/pci.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 22e0617..7fa583a 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -235,6 +235,10 @@ enum pci_bar_type { pci_bar_mem64, /* A 64-bit memory BAR */ }; +static inline bool pci_bus_crs_visibility_pending(u32 l) +{ + return (l & 0xffff) == 0x0001; +} bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl, int crs_timeout); int pci_setup_device(struct pci_dev *dev);