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: 804740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=codeaurora.org header.i=@codeaurora.org header.b="V1Ski33Y"; dkim=pass (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="V1Ski33Y"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xcZsn4lB3z9s8V for ; Wed, 23 Aug 2017 14:57:17 +1000 (AEST) 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= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 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 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);